Start adopting Yarn workspaces (#985)

* Start adopting Yarn workspaces

My plan is to move the existing package into a workspace and then split
out the things that really ought to be their own packages. For example,
the demo site and the experiments really ought to be separate.

Fix lint command

* Use workspaces in CI

* Fix deploy for monorepo
This commit is contained in:
Jordan Eldredge 2020-05-17 22:12:17 -07:00 committed by GitHub
parent 50b25433fc
commit 975d712662
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
634 changed files with 3747 additions and 4198 deletions

4
.gitattributes vendored
View file

@ -1,2 +1,2 @@
experiments/* linguist-vendored
modern/resources/* linguist-vendored
packages/webamp/experiments/* linguist-vendored
packages/webamp/modern/resources/* linguist-vendored

View file

@ -16,7 +16,7 @@ jobs:
node-version: 12.x
- name: Run Tests
run: |
cd experiments/archive-org-integration-tests
cd packages/webamp/experiments/archive-org-integration-tests
yarn
node ./index.js
env:
@ -25,4 +25,4 @@ jobs:
if: failure()
with:
name: error
path: experiments/archive-org-integration-tests/error.png
path: packages/webamp/experiments/archive-org-integration-tests/error.png

View file

@ -20,16 +20,16 @@ jobs:
run: yarn
- name: Lint
run: |
yarn lint
yarn type-check
yarn workspace webamp lint
yarn workspace webamp type-check
- name: Build
run: |
yarn build
yarn build-library
yarn workspace webamp build
yarn workspace webamp build-library
- name: Run Unit Tests
run: yarn test
run: yarn workspace webamp test
- name: Run Integration Tests
run: yarn integration-tests
run: yarn workspace webamp integration-tests
env:
CI: true
- name: Upload Screenshot Diffs
@ -37,14 +37,14 @@ jobs:
uses: actions/upload-artifact@v1
with:
name: image_diffs
path: js/__tests__/__image_snapshots__/__diff_output__/
path: packages/webamp/js/__tests__/__image_snapshots__/__diff_output__/
- name: Generate New Screenshots
if: failure()
run: |
yarn integration-tests -u
yarn workspace webamp integration-tests -u
- name: Upload New Screenshots
if: failure()
uses: actions/upload-artifact@v1
with:
name: new_images
path: js/__tests__/__image_snapshots__/
path: packages/webamp/js/__tests__/__image_snapshots__/

8
.gitignore vendored
View file

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

View file

@ -1,6 +1,6 @@
[build]
command = "npm run build && npm run build-library"
publish = "demo/built"
command = "yarn deploy"
publish = "packages/webamp/demo/built"
# A short URL for listeners of https://changelog.com/podcast/291
[[redirects]]

View file

@ -1,160 +1,14 @@
{
"name": "webamp",
"version": "1.4.1-beta01",
"description": "Winamp 2 implemented in HTML5 and JavaScript",
"main": "built/webamp.bundle.js",
"files": [
"built/webamp.bundle.js",
"built/webamp.bundle.min.js",
"built/webamp.bundle.min.js.map",
"built/webamp-lazy.bundle.js",
"built/webamp-lazy.bundle.min.js",
"built/webamp.lazy-bundle.min.js.map",
"index.d.ts"
"name": "webamp-monorepo",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"lint-fix": "eslint . --ext ts,tsx,js --fix",
"lint": "eslint . --ext ts,tsx,js --rulesdir=modern/eslint",
"type-check": "tsc",
"build": "webpack --config=demo/config/webpack.prod.js",
"build-library": "webpack --config=config/webpack.library.js",
"prepublishOnly": "npm run build-library",
"serve": "http-server ./demo/built",
"start": "webpack-dev-server --open --config=demo/config/webpack.dev.js",
"stats": "webpack --config=demo/config/webpack.prod.js --json > stats.json",
"stats-library": "webpack --config=config/webpack.library.js --json > stats.json",
"test": "jest --config=config/jest.unit.js",
"tdd": "jest --config=config/jest.unit.js --watch",
"format": "prettier --write \"**/*.{js,ts,tsx,d.ts,css}\"",
"integration-tests": "jest --config=config/jest.integration.js --runInBand",
"build-skin": "rm skins/base-2.91.wsz && cd skins/base-2.91 && zip -x .* -x 'Skining Updates.txt' -r ../base-2.91.wsz .",
"build-skin-png": "rm skins/base-2.91-png.wsz && cd skins/base-2.91-png && zip -x .* -x 'Skining Updates.txt' -r ../base-2.91-png.wsz .",
"compile-skin": "node scripts/compileSkin.js > css/base-skin.css",
"skin-info": "unzip -vl skins/base-2.91.wsz",
"build-presets": "node scripts/parsePresetFiles.js > presets/builtin.json",
"analyze-wals": "babel-node --extensions=\".ts,.js,.tsx\" modern/src/maki-interpreter/tools/extract-functions.js > modern/resources/maki-skin-data.json",
"extract-object-types": "babel-node --extensions=\".ts,.js,.tsx\" modern/src/maki-interpreter/tools/extract-object-types.js",
"extract-attributes": "babel-node --extensions=\".ts,.js,.tsx\" modern/src/maki-interpreter/tools/extract-attributes.js > modern/resources/attribute-skin-data.json",
"maki-interfaces": "babel-node --extensions=\".ts,.js,.tsx\" modern/src/maki-interpreter/tools/build-typescript-interfaces.js > modern/__generated__/makiInterfaces.ts"
"deploy": "yarn workspace webamp build && yarn workspace webamp build-library"
},
"repository": {
"type": "git",
"url": "git+https://github.com/captbaritone/webamp.git"
},
"keywords": [
"Winamp",
"HTML5",
"audio",
"web-audio-api"
],
"author": "Jordan Eldredge <jordan@jordaneldredge.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/captbaritone/webamp/issues"
},
"homepage": "https://github.com/captbaritone/webamp/",
"devDependencies": {
"@babel/core": "^7.7.2",
"@babel/node": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/polyfill": "^7.7.0",
"@babel/preset-env": "^7.7.1",
"@babel/preset-react": "^7.7.0",
"@babel/preset-typescript": "^7.7.2",
"@babel/runtime": "^7.7.2",
"@sentry/browser": "5.9.1",
"@types/classnames": "^2.2.6",
"@types/css-font-loading-module": "^0.0.2",
"@types/fscreen": "^1.0.1",
"@types/invariant": "^2.2.29",
"@types/jest": "^23.3.2",
"@types/jszip": "^3.1.5",
"@types/lodash": "^4.14.116",
"@types/lodash-es": "^4.17.1",
"@types/rc-slider": "^8.6.3",
"@types/react": "^16.8.13",
"@types/react-dom": "^16.8.4",
"@types/react-redux": "^7.1.1",
"@types/webaudioapi": "^0.0.27",
"@typescript-eslint/eslint-plugin": "^2.6.1",
"@typescript-eslint/parser": "^2.7.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^9.0.0-beta.3",
"babel-jest": "^23.4.2",
"babel-loader": "^8.0.4",
"butterchurn": "^2.6.7",
"canvas-mock": "0.0.0",
"classnames": "^2.2.5",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.1",
"cssnano": "^4.1.10",
"data-uri-to-buffer": "^2.0.0",
"eslint": "^6.5.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.16.0",
"file-loader": "^2.0.0",
"git-revision-webpack-plugin": "^3.0.3",
"glob": "^7.1.4",
"html-webpack-inline-svg-plugin": "^1.2.4",
"html-webpack-plugin": "^3.2.0",
"http-server": "^0.11.1",
"imagemin": "^6.1.0",
"imagemin-optipng": "^6.0.0",
"invariant": "^2.2.3",
"jest": "^24.9.0",
"jest-image-snapshot": "^2.12.0",
"jest-puppeteer": "^4.4.0",
"jszip": "^3.1.3",
"lodash": "^4.17.11",
"milkdrop-preset-converter-aws": "^0.1.6",
"music-metadata-browser": "^0.6.1",
"postcss": "^7.0.18",
"postcss-loader": "^3.0.0",
"prettier": "^2.0.4",
"puppeteer": "^1.15.0",
"rc-slider": "^8.7.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "^7.1.0",
"react-test-renderer": "^16.8.1",
"redux": "^4.0.1",
"redux-devtools-extension": "^2.13.2",
"redux-thunk": "^2.3.0",
"reselect": "^3.0.1",
"screenfull": "^4.0.0",
"style-loader": "^0.23.1",
"tinyqueue": "^1.2.3",
"typescript": "^3.7.2",
"url-loader": "^1.1.2",
"webpack": "^4.41.2",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.8.2",
"webpack-merge": "^4.1.2",
"winamp-eqf": "^1.0.0"
"prettier": "^2.0.5"
},
"jest": {
"globalSetup": "jest-environment-puppeteer/setup",
"globalTeardown": "jest-environment-puppeteer/teardown",
"projects": [
"config/jest.*.js"
]
},
"prettier": {
"trailingComma": "es5"
},
"dependencies": {
"eslint-plugin-react-hooks": "^2.1.2",
"fscreen": "^1.0.2",
"react-dropzone": "^10.1.7",
"redux-sentry-middleware": "^0.1.3",
"xml-js": "^1.6.11"
}
"prettier": {}
}

7
packages/webamp/.gitignore vendored Normal file
View file

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

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 138 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 881 B

After

Width:  |  Height:  |  Size: 881 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 354 B

Before After
Before After

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