Move modern code out of sub directory

This commit is contained in:
Jordan Eldredge 2020-07-03 21:21:31 -07:00
parent d08dee9c9b
commit 9ded1acbf5
231 changed files with 15 additions and 84 deletions

View file

@ -63,7 +63,6 @@
}
],
"block-scoped-var": "warn",
"camelcase": "error",
"constructor-super": "error",
"dot-notation": "error",
"eqeqeq": ["error", "smart"],

View file

@ -1,7 +1,6 @@
**/node_modules
/built
/demo/built
/coverage
/examples/webpack/bundle.js
**/__diff_output__/

View file

@ -1,8 +1,6 @@
package.json
**/*.min.css
**/base-skin.css
demo/js/googleAnalytics.min.js
built/*
demo/built/*
coverage/*
examples/webpack/bundle.js

View file

@ -24,7 +24,7 @@ In addition to the Maki interpreter, we also need an implementation of the Maki
We also have a tool for examining a corpus of modern skins an extracting which methods of the standard libary they use. This lives in `modern/src/maki-interpreter/tools/extract-functions.js` it's not really built for anyone but Jordan to run, so it has a few paths hard coded into it. This could be fixed if somebody else had the interest. By running `yarn analyze-wals` it will look in a specific hard-coded folder for skins and extract method data from them. It will then write that data to `modern/resources/maki-skin-data.json`. This data is invaluable for prioritizing which methods we should implement next. Some methods are only used by a very small number of skins. Others are not used at all.
The data extracted by the `extract-functions.js` utility and the list of unimplmented methods which is validated by `modern/src/objects.test.js` can be visualized visiting [https://webamp.org/modern/ready/](https://webamp.org/modern/ready/) or `localhost:8080/modern/ready` if developing locally. This dashboard makes it very easy to see current progress and explore the usage of different methods. Keep in mind that as of this writting some ~20% of `.maki` files fail to parse, so the data on this page represents a lower bound of actual usage.
The data extracted by the `extract-functions.js` utility and the list of unimplmented methods which is validated by `modern/src/objects.test.js` can be visualized visiting [https://webamp.org/ready/](https://webamp.org/ready/) or `localhost:8080/ready` if developing locally. This dashboard makes it very easy to see current progress and explore the usage of different methods. Keep in mind that as of this writting some ~20% of `.maki` files fail to parse, so the data on this page represents a lower bound of actual usage.
## Architecture
@ -39,7 +39,7 @@ yarn
yarn start
```
Then open: `http://localhost:8080/modern/`.
Then open: `http://localhost:8080/`.
## Tests

View file

@ -42,16 +42,16 @@ module.exports = {
},
plugins: [
new HtmlWebpackPlugin({
filename: "modern/index.html",
template: "../modern/index.html",
filename: "index.html",
template: "./index.html",
chunks: ["modern"],
}),
// Ideally we could just do this via client-side routing, but it's tricky
// with both the real app and this sub directory. So we just hack it to
// duplicate the html file in both places and move on with our lives.
new HtmlWebpackPlugin({
filename: "modern/ready/index.html",
template: "../modern/index.html",
filename: "./ready/index.html",
template: "./index.html",
chunks: ["modern"],
}),
],
@ -62,7 +62,7 @@ module.exports = {
maxAssetSize: 7000000,
},
entry: {
modern: ["../modern/src/index.js"],
modern: ["./src/index.js"],
},
context: path.resolve(__dirname, "../"),
output: {

View file

@ -1,58 +0,0 @@
const path = require("path");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
module.exports = {
devtool: "source-map",
mode: "production",
resolve: {
extensions: [".js", ".ts", ".tsx"],
},
module: {
rules: [
{
test: /\.css$/,
use: [
"style-loader",
{ loader: "css-loader", options: { importLoaders: 1 } },
// We really only need this in prod. We could find a way to disable it in dev.
],
},
{
test: /\.(js|ts|tsx)$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
envName: "library",
},
},
},
],
noParse: [/jszip\.js$/],
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "library-report.html",
openAnalyzer: false,
}),
],
performance: {
// We do some crazy shit okay! Don't judge!
maxEntrypointSize: 9000000,
maxAssetSize: 9000000,
},
entry: {
bundle: "./js/webamp.js",
"bundle.min": "./js/webamp.js",
"lazy-bundle": "./js/webampLazy.tsx",
"lazy-bundle.min": "./js/webampLazy.tsx",
},
output: {
path: path.resolve(__dirname, "../built"),
filename: "webamp.[name].js",
library: "Webamp",
libraryTarget: "umd",
libraryExport: "default",
},
};

View file

@ -1,6 +1,6 @@
const makiClassRule = require("./modern/eslint/maki-class");
const makiMissingMethods = require("./modern/eslint/maki-missing-methods");
const makiMethodTypes = require("./modern/eslint/maki-method-types");
const makiClassRule = require("./eslint/maki-class");
const makiMissingMethods = require("./eslint/maki-missing-methods");
const makiMethodTypes = require("./eslint/maki-method-types");
module.exports = {
"maki-class": makiClassRule,

View file

@ -37,7 +37,7 @@ const TYPE_MAP = {
function getTypeData(makiType) {
const type = TYPE_MAP[makiType.toLowerCase()];
if (type == null) {
console.warn(`Could not find type for "${makiType}"`);
// console.warn(`Could not find type for "${makiType}"`);
}
return type;
}

View file

@ -1,6 +0,0 @@
{
"rules": {
// TODO: Turn these all back on
"camelcase": "off"
}
}

View file

@ -4,10 +4,10 @@
"description": "Winamp Modern Skins in the browser",
"scripts": {
"lint-fix": "eslint . --ext ts,tsx,js --fix",
"lint": "eslint . --ext ts,tsx,js --rulesdir=modern/eslint",
"lint": "eslint . --ext ts,tsx,js --rulesdir=eslint",
"type-check": "tsc",
"serve": "http-server ./demo/built",
"start": "webpack-dev-server --open --config=demo/config/webpack.dev.js",
"serve": "http-server ./built",
"start": "webpack-dev-server --open --config=config/webpack.dev.js",
"test": "jest --config=config/jest.unit.js",
"tdd": "jest --config=config/jest.unit.js --watch",
"format": "prettier --write \"**/*.{js,ts,tsx,d.ts,css}\"",

Some files were not shown because too many files have changed in this diff Show more