First attempt at adopting Parcel (#1186)

* Upgrade sharp

* First attempt at adopting Parcel

* Get multiple targets working for Parcel

* Use lts node for Netlify deploy

* Update deploy script to reflect new demo site dir

* Inline css into library bundles

* More updates

* Remove uri optimization

* Upgrade parcel

* Fix butterchurn logo import for Parcel

* Add browser build

* List browser build

* Prefer jest-swc to babel

* Preserve old build artifact location

* Ignore dist

* Minify library bundles

* Switch to postcss to use uri optimization plugin

* Serve from the correct location

* Clarifying comments

* Ignore bundle reports in git

* Refine Parcel builds

* Try to be more explicit with port

* Use relative path to create build dir

* Try to force supporting chrome 76

* Update the location of the test skin in integration test to work with Parcel
This commit is contained in:
Jordan Eldredge 2023-01-20 11:15:39 -08:00 committed by GitHub
parent f84abfeac5
commit 6a71878a98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 2067 additions and 3207 deletions

View File

@ -23,6 +23,7 @@ jobs:
yarn workspace ani-cursor build
yarn workspace webamp build
yarn workspace webamp build-library
yarn workspace webamp move-library
- name: Lint
run: |
yarn lint

5
.gitignore vendored
View File

@ -1,2 +1,5 @@
node_modules
.vscode
.vscode
.parcel-cache
dist
parcel-bundle-reports

3
.parcelrc Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "@parcel/config-default"
}

View File

@ -2,5 +2,6 @@
packages/webamp/demo/built/
packages/webamp/built/
packages/webamp/dist/
packages/webamp-modern/build/
packages/webamp-modern/tools/eslint-rules/dist/

View File

@ -1,6 +0,0 @@
module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
],
};

View File

@ -13,4 +13,7 @@ module.exports = {
],
testEnvironment: "jsdom",
setupFiles: ["<rootDir>/packages/skin-database/jest-setup.js"],
transform: {
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
};

View File

@ -3,4 +3,4 @@ yarn workspace ani-cursor build
yarn workspace webamp build
yarn workspace webamp build-library
yarn workspace webamp-modern build
mv packages/webamp-modern/build packages/webamp/demo/built/modern
mv packages/webamp-modern/build packages/webamp/dist/demo-site/modern

View File

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

View File

@ -16,12 +16,19 @@
},
"devDependencies": {
"@babel/preset-typescript": "^7.16.7",
"@parcel/optimizer-data-url": "2.7.0",
"@parcel/transformer-inline-string": "^2.8.2",
"@swc/core": "^1.3.24",
"@swc/jest": "^0.2.24",
"@typescript-eslint/parser": "^5.13.0",
"assert": "^2.0.0",
"eslint": "^8.14.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-prettier": "^4.0.0",
"events": "^3.3.0",
"jest": "^27.5.1",
"prettier": "^2.3.2"
"prettier": "^2.3.2",
"stream-browserify": "^3.0.0"
},
"prettier": {
"trailingComma": "es5"
@ -30,5 +37,6 @@
"projects": [
"config/jest.*.js"
]
}
},
"dependencies": {}
}

View File

@ -1,637 +0,0 @@
{
"name": "skin-museum-og",
"version": "0.1.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "skin-museum-og",
"version": "0.1.0",
"dependencies": {
"next": "13.0.3",
"react": "18.2.0",
"react-dom": "18.2.0"
}
},
"node_modules/@next/env": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.3.tgz",
"integrity": "sha512-/4WzeG61Ot/PxsghXkSqQJ6UohFfwXoZ3dtsypmR9EBP+OIax9JRq0trq8Z/LCT9Aq4JbihVkaazRWguORjTAw=="
},
"node_modules/@next/swc-android-arm-eabi": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.3.tgz",
"integrity": "sha512-uxfUoj65CdFc1gX2q7GtBX3DhKv9Kn343LMqGNvXyuTpYTGMmIiVY7b9yF8oLWRV0gVKqhZBZifUmoPE8SJU6Q==",
"cpu": [
"arm"
],
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-android-arm64": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.0.3.tgz",
"integrity": "sha512-t2k+WDfg7Cq2z/EnalKGsd/9E5F4Hdo1xu+UzZXYDpKUI9zgE6Bz8ajQb8m8txv3qOaWdKuDa5j5ziq9Acd1Xw==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-darwin-arm64": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.3.tgz",
"integrity": "sha512-wV6j6SZ1bc/YHOLCLk9JVqaZTCCey6HBV7inl2DriHsHqIcO6F3+QiYf0KXwRP9BE0GSZZrYd5mZQm2JPTHdJA==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-darwin-x64": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.3.tgz",
"integrity": "sha512-jaI2CMuYWvUtRixV3AIjUhnxUDU1FKOR+8hADMhYt3Yz+pCKuj4RZ0n0nY5qUf3qT1AtvnJXEgyatSFJhSp/wQ==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-freebsd-x64": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.3.tgz",
"integrity": "sha512-nbyT0toBTJrcj5TCB9pVnQpGJ3utGyQj4CWegZs1ulaeUQ5Z7CS/qt8nRyYyOKYHtOdSCJ9Nw5F/RgKNkdpOdw==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-linux-arm-gnueabihf": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.3.tgz",
"integrity": "sha512-1naLxYvRUQCoFCU1nMkcQueRc0Iux9xBv1L5pzH2ejtIWFg8BrSgyuluJG4nyAhFCx4WG863IEIkAaefOowVdA==",
"cpu": [
"arm"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-linux-arm64-gnu": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.3.tgz",
"integrity": "sha512-3Z4A8JkuGWpMVbUhUPQInK/SLY+kijTT78Q/NZCrhLlyvwrVxaQALJNlXzxDLraUgv4oVH0Wz/FIw1W9PUUhxA==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-linux-arm64-musl": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.3.tgz",
"integrity": "sha512-MoYe9SM40UaunTjC+01c9OILLH3uSoeri58kDMu3KF/EFEvn1LZ6ODeDj+SLGlAc95wn46hrRJS2BPmDDE+jFQ==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-linux-x64-gnu": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.3.tgz",
"integrity": "sha512-z22T5WGnRanjLMXdF0NaNjSpBlEzzY43t5Ysp3nW1oI6gOkub6WdQNZeHIY7A2JwkgSWZmtjLtf+Fzzz38LHeQ==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-linux-x64-musl": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.3.tgz",
"integrity": "sha512-ZOMT7zjBFmkusAtr47k8xs/oTLsNlTH6xvYb+iux7yly2hZGwhfBLzPGBsbeMZukZ96IphJTagT+C033s6LNVA==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-win32-arm64-msvc": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.3.tgz",
"integrity": "sha512-Q4BM16Djl+Oah9UdGrvjFYgoftYB2jNd+rtRGPX5Mmxo09Ry/KiLbOZnoUyoIxKc1xPyfqMXuaVsAFQLYs0KEQ==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-win32-ia32-msvc": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.3.tgz",
"integrity": "sha512-Sa8yGkNeRUsic8Qjf7MLIAfP0p0+einK/wIqJ8UO1y76j+8rRQu42AMs5H4Ax1fm9GEYq6I8njHtY59TVpTtGQ==",
"cpu": [
"ia32"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@next/swc-win32-x64-msvc": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.3.tgz",
"integrity": "sha512-IAptmSqA7k4tQzaw2NAkoEjj3+Dz9ceuvlEHwYh770MMDL4V0ku2m+UHrmn5HUCEDHhgwwjg2nyf6728q2jr1w==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">= 10"
}
},
"node_modules/@swc/helpers": {
"version": "0.4.11",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.11.tgz",
"integrity": "sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==",
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001431",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz",
"integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
}
]
},
"node_modules/client-only": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",
"integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"node_modules/loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"dependencies": {
"js-tokens": "^3.0.0 || ^4.0.0"
},
"bin": {
"loose-envify": "cli.js"
}
},
"node_modules/nanoid": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==",
"bin": {
"nanoid": "bin/nanoid.cjs"
},
"engines": {
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/next": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/next/-/next-13.0.3.tgz",
"integrity": "sha512-rFQeepcenRxKzeKlh1CsmEnxsJwhIERtbUjmYnKZyDInZsU06lvaGw5DT44rlNp1Rv2MT/e9vffZ8vK+ytwXHA==",
"dependencies": {
"@next/env": "13.0.3",
"@swc/helpers": "0.4.11",
"caniuse-lite": "^1.0.30001406",
"postcss": "8.4.14",
"styled-jsx": "5.1.0",
"use-sync-external-store": "1.2.0"
},
"bin": {
"next": "dist/bin/next"
},
"engines": {
"node": ">=14.6.0"
},
"optionalDependencies": {
"@next/swc-android-arm-eabi": "13.0.3",
"@next/swc-android-arm64": "13.0.3",
"@next/swc-darwin-arm64": "13.0.3",
"@next/swc-darwin-x64": "13.0.3",
"@next/swc-freebsd-x64": "13.0.3",
"@next/swc-linux-arm-gnueabihf": "13.0.3",
"@next/swc-linux-arm64-gnu": "13.0.3",
"@next/swc-linux-arm64-musl": "13.0.3",
"@next/swc-linux-x64-gnu": "13.0.3",
"@next/swc-linux-x64-musl": "13.0.3",
"@next/swc-win32-arm64-msvc": "13.0.3",
"@next/swc-win32-ia32-msvc": "13.0.3",
"@next/swc-win32-x64-msvc": "13.0.3"
},
"peerDependencies": {
"fibers": ">= 3.1.0",
"node-sass": "^6.0.0 || ^7.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.3.0"
},
"peerDependenciesMeta": {
"fibers": {
"optional": true
},
"node-sass": {
"optional": true
},
"sass": {
"optional": true
}
}
},
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
},
"node_modules/postcss": {
"version": "8.4.14",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
"integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
}
],
"dependencies": {
"nanoid": "^3.3.4",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/react": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
"integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
"dependencies": {
"loose-envify": "^1.1.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/react-dom": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
"integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.0"
},
"peerDependencies": {
"react": "^18.2.0"
}
},
"node_modules/scheduler": {
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",
"integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
"dependencies": {
"loose-envify": "^1.1.0"
}
},
"node_modules/source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/styled-jsx": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz",
"integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==",
"dependencies": {
"client-only": "0.0.1"
},
"engines": {
"node": ">= 12.0.0"
},
"peerDependencies": {
"react": ">= 16.8.0 || 17.x.x || ^18.0.0-0"
},
"peerDependenciesMeta": {
"@babel/core": {
"optional": true
},
"babel-plugin-macros": {
"optional": true
}
}
},
"node_modules/tslib": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
},
"node_modules/use-sync-external-store": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
"integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
}
},
"dependencies": {
"@next/env": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.3.tgz",
"integrity": "sha512-/4WzeG61Ot/PxsghXkSqQJ6UohFfwXoZ3dtsypmR9EBP+OIax9JRq0trq8Z/LCT9Aq4JbihVkaazRWguORjTAw=="
},
"@next/swc-android-arm-eabi": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-13.0.3.tgz",
"integrity": "sha512-uxfUoj65CdFc1gX2q7GtBX3DhKv9Kn343LMqGNvXyuTpYTGMmIiVY7b9yF8oLWRV0gVKqhZBZifUmoPE8SJU6Q==",
"optional": true
},
"@next/swc-android-arm64": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-13.0.3.tgz",
"integrity": "sha512-t2k+WDfg7Cq2z/EnalKGsd/9E5F4Hdo1xu+UzZXYDpKUI9zgE6Bz8ajQb8m8txv3qOaWdKuDa5j5ziq9Acd1Xw==",
"optional": true
},
"@next/swc-darwin-arm64": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.3.tgz",
"integrity": "sha512-wV6j6SZ1bc/YHOLCLk9JVqaZTCCey6HBV7inl2DriHsHqIcO6F3+QiYf0KXwRP9BE0GSZZrYd5mZQm2JPTHdJA==",
"optional": true
},
"@next/swc-darwin-x64": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.0.3.tgz",
"integrity": "sha512-jaI2CMuYWvUtRixV3AIjUhnxUDU1FKOR+8hADMhYt3Yz+pCKuj4RZ0n0nY5qUf3qT1AtvnJXEgyatSFJhSp/wQ==",
"optional": true
},
"@next/swc-freebsd-x64": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-13.0.3.tgz",
"integrity": "sha512-nbyT0toBTJrcj5TCB9pVnQpGJ3utGyQj4CWegZs1ulaeUQ5Z7CS/qt8nRyYyOKYHtOdSCJ9Nw5F/RgKNkdpOdw==",
"optional": true
},
"@next/swc-linux-arm-gnueabihf": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-13.0.3.tgz",
"integrity": "sha512-1naLxYvRUQCoFCU1nMkcQueRc0Iux9xBv1L5pzH2ejtIWFg8BrSgyuluJG4nyAhFCx4WG863IEIkAaefOowVdA==",
"optional": true
},
"@next/swc-linux-arm64-gnu": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.0.3.tgz",
"integrity": "sha512-3Z4A8JkuGWpMVbUhUPQInK/SLY+kijTT78Q/NZCrhLlyvwrVxaQALJNlXzxDLraUgv4oVH0Wz/FIw1W9PUUhxA==",
"optional": true
},
"@next/swc-linux-arm64-musl": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.0.3.tgz",
"integrity": "sha512-MoYe9SM40UaunTjC+01c9OILLH3uSoeri58kDMu3KF/EFEvn1LZ6ODeDj+SLGlAc95wn46hrRJS2BPmDDE+jFQ==",
"optional": true
},
"@next/swc-linux-x64-gnu": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.0.3.tgz",
"integrity": "sha512-z22T5WGnRanjLMXdF0NaNjSpBlEzzY43t5Ysp3nW1oI6gOkub6WdQNZeHIY7A2JwkgSWZmtjLtf+Fzzz38LHeQ==",
"optional": true
},
"@next/swc-linux-x64-musl": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.0.3.tgz",
"integrity": "sha512-ZOMT7zjBFmkusAtr47k8xs/oTLsNlTH6xvYb+iux7yly2hZGwhfBLzPGBsbeMZukZ96IphJTagT+C033s6LNVA==",
"optional": true
},
"@next/swc-win32-arm64-msvc": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.0.3.tgz",
"integrity": "sha512-Q4BM16Djl+Oah9UdGrvjFYgoftYB2jNd+rtRGPX5Mmxo09Ry/KiLbOZnoUyoIxKc1xPyfqMXuaVsAFQLYs0KEQ==",
"optional": true
},
"@next/swc-win32-ia32-msvc": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.0.3.tgz",
"integrity": "sha512-Sa8yGkNeRUsic8Qjf7MLIAfP0p0+einK/wIqJ8UO1y76j+8rRQu42AMs5H4Ax1fm9GEYq6I8njHtY59TVpTtGQ==",
"optional": true
},
"@next/swc-win32-x64-msvc": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.0.3.tgz",
"integrity": "sha512-IAptmSqA7k4tQzaw2NAkoEjj3+Dz9ceuvlEHwYh770MMDL4V0ku2m+UHrmn5HUCEDHhgwwjg2nyf6728q2jr1w==",
"optional": true
},
"@swc/helpers": {
"version": "0.4.11",
"resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.11.tgz",
"integrity": "sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==",
"requires": {
"tslib": "^2.4.0"
}
},
"caniuse-lite": {
"version": "1.0.30001431",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz",
"integrity": "sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ=="
},
"client-only": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz",
"integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"requires": {
"js-tokens": "^3.0.0 || ^4.0.0"
}
},
"nanoid": {
"version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
"integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw=="
},
"next": {
"version": "13.0.3",
"resolved": "https://registry.npmjs.org/next/-/next-13.0.3.tgz",
"integrity": "sha512-rFQeepcenRxKzeKlh1CsmEnxsJwhIERtbUjmYnKZyDInZsU06lvaGw5DT44rlNp1Rv2MT/e9vffZ8vK+ytwXHA==",
"requires": {
"@next/env": "13.0.3",
"@next/swc-android-arm-eabi": "13.0.3",
"@next/swc-android-arm64": "13.0.3",
"@next/swc-darwin-arm64": "13.0.3",
"@next/swc-darwin-x64": "13.0.3",
"@next/swc-freebsd-x64": "13.0.3",
"@next/swc-linux-arm-gnueabihf": "13.0.3",
"@next/swc-linux-arm64-gnu": "13.0.3",
"@next/swc-linux-arm64-musl": "13.0.3",
"@next/swc-linux-x64-gnu": "13.0.3",
"@next/swc-linux-x64-musl": "13.0.3",
"@next/swc-win32-arm64-msvc": "13.0.3",
"@next/swc-win32-ia32-msvc": "13.0.3",
"@next/swc-win32-x64-msvc": "13.0.3",
"@swc/helpers": "0.4.11",
"caniuse-lite": "^1.0.30001406",
"postcss": "8.4.14",
"styled-jsx": "5.1.0",
"use-sync-external-store": "1.2.0"
}
},
"picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="
},
"postcss": {
"version": "8.4.14",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.14.tgz",
"integrity": "sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==",
"requires": {
"nanoid": "^3.3.4",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
}
},
"react": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
"integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==",
"requires": {
"loose-envify": "^1.1.0"
}
},
"react-dom": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz",
"integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==",
"requires": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.0"
}
},
"scheduler": {
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",
"integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
"requires": {
"loose-envify": "^1.1.0"
}
},
"source-map-js": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw=="
},
"styled-jsx": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz",
"integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==",
"requires": {
"client-only": "0.0.1"
}
},
"tslib": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
},
"use-sync-external-store": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz",
"integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==",
"requires": {}
}
}
}

View File

@ -1,5 +1,6 @@
*.min.js
built/
dist/
coverage/
**/node_modules/
examples/webpack/bundle.js

View File

@ -1,3 +1,4 @@
// See jest-puppeteer.config.js for the config that setups the web server.
module.exports = {
displayName: "integration-test",
rootDir: "../",

View File

@ -12,7 +12,7 @@ module.exports = {
"\\.mp3$": "<rootDir>/js/__mocks__/fileMock.js",
},
transform: {
"^.+\\.(js|ts|tsx)$": "babel-jest",
"^.+\\.(t|j)sx?$": ["@swc/jest"],
},
testPathIgnorePatterns: ["/node_modules/"],
testEnvironment: "jsdom",

View File

@ -1,77 +0,0 @@
const path = require("path");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const TerserPlugin = require("terser-webpack-plugin");
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.
{
loader: "postcss-loader",
options: {
plugins: [
require("cssnano"),
require("../scripts/postcss-optimize-data-uri-pngs"),
],
},
},
],
},
{
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,
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
// This allows us to produce both minfied and unminified files.
test: /\.min\.js$/i,
}),
],
},
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,86 +0,0 @@
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
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.
{
loader: "postcss-loader",
options: {
plugins: [
require("cssnano"),
require("../../scripts/postcss-optimize-data-uri-pngs"),
],
},
},
],
},
{
test: /\.(js|ts|tsx)?$/,
exclude: /(node_modules)/,
use: {
loader: "babel-loader",
options: {
envName: "production",
},
},
},
{
test: /\.(wsz|wal|mp3|png|ico|jpg|svg)$/,
use: [
{
loader: "file-loader",
options: {
emitFile: true,
name: "[path][name]-[hash].[ext]",
},
},
],
},
],
noParse: [/jszip\.js$/],
},
plugins: [
new HtmlWebpackPlugin({
template: "./index.html",
chunks: ["webamp"],
}),
new CopyWebpackPlugin([
{
from: "./js/delete-service-worker.js",
to: "service-worker.js",
force: true,
},
{
from: "../assets",
to: "assets",
},
]),
],
performance: {
// We do some crazy shit okay! Don't judge!
maxEntrypointSize: 7000000,
maxAssetSize: 7000000,
},
entry: {
webamp: ["./js/index.tsx"],
},
context: path.resolve(__dirname, "../"),
output: {
filename: "[name]-[hash].js",
chunkFilename: "[name]-[hash].js",
publicPath: "/",
path: path.resolve(__dirname, "../built"),
},
};

View File

@ -1,18 +0,0 @@
const webpack = require("webpack");
const merge = require("webpack-merge");
const common = require("./webpack.common.js");
module.exports = merge(common, {
devtool: "eval-cheap-module-source-map",
mode: "development",
devServer: {
overlay: true,
},
plugins: [
new webpack.DefinePlugin({
SENTRY_DSN: JSON.stringify(
"https://c8c64ef822f54240901bc64f88c234d8@sentry.io/146022"
),
}),
],
});

View File

@ -1,30 +0,0 @@
const webpack = require("webpack");
const merge = require("webpack-merge");
const GitRevisionPlugin = require("git-revision-webpack-plugin");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const common = require("./webpack.common.js");
const gitRevisionPlugin = new GitRevisionPlugin();
const config = merge(common, {
devtool: "source-map",
mode: "production",
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "prod-report.html",
openAnalyzer: false,
}),
new webpack.DefinePlugin({
SENTRY_DSN: JSON.stringify(
"https://12b6be8ef7c44f28ac37ab5ed98fd294@sentry.io/146021"
),
COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash()),
}),
],
});
config.entry.webamp.unshift("./js/googleAnalytics.min.js");
module.exports = config;

View File

@ -15,20 +15,10 @@
/>
<meta property="og:type" content="website" />
<meta property="og:url" content="https://webamp.org" />
<meta
property="og:image"
content="https://webamp.org<%= require('./images/preview.png') %>"
/>
<link
rel="stylesheet"
type="text/css"
href="<%= require('!file-loader?name=[path][name]-[hash].[ext]!./css/page.css') %>"
/>
<link
rel="shortcut icon"
sizes="16x16 32x32"
href="<%= require('./images/favicon.ico') %>"
/>
<meta property="og:image" content="./images/preview.png" />
<link rel="stylesheet" type="text/css" href="./css/page.css" />
<link rel="shortcut icon" sizes="16x16 32x32" href="./images/favicon.ico" />
<!-- See https://goo.gl/qRE0vM -->
<meta name="theme-color" content="#4b4b4b" />
@ -37,17 +27,7 @@
name="google-site-verification"
content="ycocEnfUpYf8u_UmzpqSe0gNooPs0PBjbD7HKw-qa5I"
/>
<!-- Load and register service worker that deletes the service worker we used to have -->
<script>
if ("serviceWorker" in navigator) {
window.addEventListener("load", function () {
navigator.serviceWorker.register("/service-worker.js");
});
}
</script>
</head>
<body>
<div id="app">
<div id="loading" style="display: none">
@ -68,9 +48,7 @@
target="_blank"
href="https://github.com/jberg/butterchurn"
id="butterchurn-share"
style="
background-image: url(<%=require('./images/share/butterchurn-bg.png')%>);
"
style="background-image: url('./images/share/butterchurn-bg.png')"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72.767 72.766">
<path
@ -124,6 +102,7 @@
<!-- https://github.com/captbaritone/webamp/issues/750
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="7py29249dpeddu8" async></script>
-->
<script type="module" src="./js/index.tsx"></script>
<!-- Scripts get injected by html-webpack-plugin -->
</body>
</html>

View File

@ -1,17 +1,17 @@
// @ts-ignore
import osx from "../skins/MacOSXAqua1-5.wsz";
import osx from "url:../skins/MacOSXAqua1-5.wsz";
// @ts-ignore
import topaz from "../skins/TopazAmp1-2.wsz";
import topaz from "url:../skins/TopazAmp1-2.wsz";
// @ts-ignore
import visor from "../skins/Vizor1-01.wsz";
import visor from "url:../skins/Vizor1-01.wsz";
// @ts-ignore
import xmms from "../skins/XMMS-Turquoise.wsz";
import xmms from "url:../skins/XMMS-Turquoise.wsz";
// @ts-ignore
import zaxon from "../skins/ZaxonRemake1-0.wsz";
import zaxon from "url:../skins/ZaxonRemake1-0.wsz";
// @ts-ignore
import green from "../skins/Green-Dimension-V2.wsz";
import green from "url:../skins/Green-Dimension-V2.wsz";
// @ts-ignore
import internetArchive from "../skins/Internet-Archive.wsz";
import internetArchive from "url:../skins/Internet-Archive.wsz";
export default [
{ url: green, name: "Green Dimension V2" },

View File

@ -1,6 +1,6 @@
import { Track, URLTrack, PartialState } from "./Webamp";
// @ts-ignore
import llamaAudio from "../mp3/llama-2.91.mp3";
import llamaAudio from "url:../mp3/llama-2.91.mp3";
interface Config {
initialTracks?: Track[];

View File

@ -1,7 +1,7 @@
import * as Sentry from "@sentry/browser";
import ReactDOM from "react-dom/client";
// @ts-ignore
import isButterchurnSupported from "butterchurn/lib/isSupported.min";
import isButterchurnSupported from "butterchurn/dist/isSupported.min";
import { getWebampConfig } from "./webampConfig";
import * as SoundCloud from "./SoundCloud";
@ -20,8 +20,6 @@ import enableMediaSession from "./mediaSession";
// import { choreograph } from "./choreography";
declare global {
const SENTRY_DSN: string;
const COMMITHASH: string | undefined;
interface Window {
__webamp: WebampLazy;
}
@ -55,8 +53,10 @@ window.addEventListener("dragover", supressDragAndDrop);
window.addEventListener("drop", supressDragAndDrop);
try {
// TODO: Get this working in Parcel.
const COMMITHASH = undefined;
Sentry.init({
dsn: SENTRY_DSN,
dsn: "https://12b6be8ef7c44f28ac37ab5ed98fd294@sentry.io/146021",
release: typeof COMMITHASH === "undefined" ? "DEV" : COMMITHASH,
});
} catch (e) {

View File

@ -2,7 +2,7 @@ import * as Sentry from "@sentry/browser";
// @ts-ignore
import createMiddleware from "redux-sentry-middleware";
// @ts-ignore
import isButterchurnSupported from "butterchurn/lib/isSupported.min";
import isButterchurnSupported from "butterchurn/dist/isSupported.min";
import { loggerMiddleware } from "./eventLogger";
import * as SoundCloud from "./SoundCloud";

View File

@ -5,7 +5,13 @@ module.exports = {
server: {
// Note: We require the the build be run before these tests.
// TODO: Figure out how to get this command to run the build.
command: "npm run serve",
command: "PORT=8080 yarn serve",
port: 8080, // Jest Puppeteer will wait 5000ms for this port to come online.
launchTimeout: 10000, // Jest Puppeteer will wait 10000ms for the server to start.
debug: true,
usedPortAction: "ask", // Note: "kill" will kill the process running on the port.
waitOnScheme: {
verbose: true,
},
},
};

View File

@ -1,3 +1,5 @@
// See jest.integration.js for the config for this test file.
/* global page */
const { toMatchImageSnapshot } = require("jest-image-snapshot");
const path = require("path");
@ -29,10 +31,11 @@ test("can 'pose' for a screenshot", async () => {
expect(await page.screenshot()).toMatchImageSnapshot(snapshotOptions);
});
// *************** IMPORTANT ***************
// If this test starts to fail, check that the cache-bust location of the skin has not changed.
test("can load a skin via the query params", async () => {
await page.goto(
// If this test starts to fail, check that the cache-bust location of the skin has not changed.
`${DOMAIN}/?skinUrl=/skins/MacOSXAqua1-5-88dbd4e043795c98625462a908a2d965.wsz#{"disableMarquee":true}`
`${DOMAIN}/?skinUrl=/MacOSXAqua1-5.698dd4ab.wsz#{"disableMarquee":true}`
);
await page.evaluate(
() => document.getElementsByClassName("loaded-icon").length > 0

View File

@ -20,9 +20,12 @@ import PlaylistWindow from "./PlaylistWindow";
import EqualizerWindow from "./EqualizerWindow";
import Skin from "./Skin";
import "../../css/webamp.css";
import Media from "../media";
import { useTypedSelector, useActionCreator } from "../hooks";
import Css from "./Css";
// @ts-ignore
import cssText from "bundle-text:../../css/webamp.css";
interface Props {
filePickers: FilePicker[];
@ -129,6 +132,7 @@ export default function App({ media, filePickers }: Props) {
return ReactDOM.createPortal(
<StrictMode>
<Css>{cssText}</Css>
<div onBlur={handleBlur}>
<Skin />
<ContextMenuWrapper

View File

@ -0,0 +1,3 @@
import Webamp from "./webamp";
window.Webamp = Webamp;

View File

@ -0,0 +1,3 @@
import Webamp from "./webampLazy";
window.Webamp = Webamp;

View File

@ -2,27 +2,58 @@
"name": "webamp",
"version": "1.5.0",
"description": "Winamp 2 implemented in HTML5 and JavaScript",
"main": "built/webamp.bundle.js",
"main": "dist/webamp-lazy/webampLazy.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",
"dist/webamp/webamp.js",
"dist/webamp/webamp.js.map",
"dist/webamp/webamp-lazy.js",
"dist/webamp/webamp-lazy.js.map",
"index.d.ts"
],
"browser": "dist/webamp-browser/webampBrowser.js",
"browserslist": [
"> 1%",
"last 2 versions",
"chrome > 76",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"targets": {
"webamp-browser": {
"source": "js/webampBrowser.js",
"outputFormat": "global",
"optimize": false
},
"webamp-browser-min": {
"source": "js/webampBrowser.js",
"outputFormat": "global",
"optimize": true
},
"webamp-lazy-browser": {
"source": "js/webampLazyBrowser.js",
"outputFormat": "global",
"optimize": false
},
"webamp-lazy-browser-min": {
"source": "js/webampLazyBrowser.js",
"outputFormat": "global",
"optimize": true
},
"demo-site": {
"source": "demo/index.html"
}
},
"scripts": {
"lint-fix": "eslint . --ext ts,tsx,js --fix",
"lint": "eslint . --ext ts,tsx,js",
"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",
"build": "parcel build --target demo-site",
"build-library": "parcel build --target webamp-browser --target webamp-browser-min --target webamp-lazy-browser --target webamp-lazy-browser-min --reporter @parcel/reporter-bundle-analyzer",
"move-library": "node scripts/moveLibrary.js",
"prepublishOnly": "npm run build-library && npm run move-library",
"serve": "http-server ./dist/demo-site",
"start": "parcel demo/index.html",
"test": "jest --config=config/jest.unit.js",
"tdd": "jest --config=config/jest.unit.js --watch",
"format": "prettier --write \"**/*.{js,ts,tsx,d.ts,css}\"",
@ -50,23 +81,8 @@
},
"homepage": "https://github.com/captbaritone/webamp/",
"devDependencies": {
"@babel/core": "^7.16.0",
"@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",
"@parcel/reporter-bundle-analyzer": "^2.8.2",
"@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": "^27.0.3",
@ -79,44 +95,27 @@
"@types/webaudioapi": "^0.0.27",
"@typescript-eslint/eslint-plugin": "^5.13.0",
"@typescript-eslint/parser": "^5.13.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",
"caniuse-lite": "^1.0.30001154",
"canvas-mock": "0.0.0",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.1",
"cssnano": "^4.1.10",
"data-uri-to-buffer": "^2.0.0",
"eslint": "^8.10.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^4.3.0",
"file-loader": "^2.0.0",
"git-revision-webpack-plugin": "^3.0.3",
"glob": "^7.1.4",
"html-webpack-plugin": "^4.5.0",
"http-server": "^0.11.1",
"imagemin": "^6.1.0",
"imagemin-optipng": "^6.0.0",
"jest": "^27.5.1",
"jest-image-snapshot": "^2.12.0",
"jest-puppeteer": "^4.4.0",
"postcss": "^8.2.10",
"postcss-loader": "^3.0.0",
"jest-puppeteer": "^6.2.0",
"parcel": "^2.8.2",
"postcss": "^8.4.21",
"puppeteer": "^1.15.0",
"react-test-renderer": "^17.0.1",
"redux-sentry-middleware": "^0.1.3",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.4.3",
"typescript": "^3.7.2",
"url-loader": "^1.1.2",
"webpack": "^4.41.2",
"webpack-bundle-analyzer": "^4.3.0",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.8.2",
"webpack-merge": "^4.1.2"
"url-loader": "^1.1.2"
},
"jest": {
"globalSetup": "jest-environment-puppeteer/setup",
@ -129,6 +128,7 @@
"trailingComma": "es5"
},
"dependencies": {
"@sentry/browser": "5.9.1",
"ani-cursor": "^0.0.4",
"butterchurn": "^3.0.0-beta.3",
"butterchurn-presets": "3.0.0-beta.4",
@ -141,9 +141,10 @@
"music-metadata-browser": "^0.6.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.0-beta.1",
"react-redux": "^8.0.5",
"redux": "^5.0.0-alpha.0",
"redux-devtools-extension": "^2.13.9",
"redux-sentry-middleware": "^0.1.3",
"redux-thunk": "^2.4.0",
"reselect": "^3.0.1",
"tinyqueue": "^1.2.3",

View File

@ -0,0 +1,3 @@
module.exports = {
plugins: [require("./scripts/postcss-optimize-data-uri-pngs")],
};

View File

@ -0,0 +1,41 @@
// mkdir built; cp dist/webamp-browser-min/webampBrowser.js built/webamp.bundle.min.js && cp dist/webamp-lazy-browser-min/webampLazyBrowser.js built/webamp.lazy-bundle.min.js
// Script to replicate the location of build artifacts that existed in the old Webpack build.
const fs = require("fs");
const path = require("path");
const BUILD_DIR = path.join(__dirname, "../built");
const DIST_DIR = path.join(__dirname, "../dist");
const TARGETS = [
{
parcelPath: "webamp-browser/webampBrowser.js",
webpackName: "webamp.bundle.js",
},
{
parcelPath: "webamp-browser-min/webampBrowser.js",
webpackName: "webamp.bundle.min.js",
},
{
parcelPath: "webamp-lazy-browser/webampLazyBrowser.js",
webpackName: "webamp.lazy-bundle.js",
},
{
parcelPath: "webamp-lazy-browser-min/webampLazyBrowser.js",
webpackName: "webamp.lazy-bundle.min.js",
},
];
fs.mkdirSync(BUILD_DIR, { recursive: true });
console.log("Copying build artifacts to their old Webpack locations:");
for (const target of TARGETS) {
const from = path.join(DIST_DIR, target.parcelPath);
const to = path.join(BUILD_DIR, target.webpackName);
fs.copyFileSync(from, to);
console.log(`Copied "${from}" to "${to}".`);
const fromMap = `${from}.map`;
const toMap = `${to}.map`;
console.log(`Copied "${fromMap}" to "${toMap}".`);
fs.copyFileSync(fromMap, toMap);
}

4152
yarn.lock

File diff suppressed because it is too large Load Diff