From 17f1f2d7bfd8632a3209e93b82ac418b68f69c8d Mon Sep 17 00:00:00 2001 From: Enrico Sacchetti Date: Sat, 11 Mar 2023 14:02:10 -0500 Subject: [PATCH] build: upgrade svelte-package --- .gitignore | 2 +- package.json | 24 +++++---- svelte.config.js | 3 -- yarn.lock | 132 +++++++++++++++++++++++++++++------------------ 4 files changed, 98 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index 6743f1cf9a..f8bcc68c79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ /lib -/package +/dist node_modules .DS_Store .vscode diff --git a/package.json b/package.json index 5760e7558a..b11ca6ca42 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,16 @@ "license": "Apache-2.0", "description": "Svelte implementation of the Carbon Design System", "type": "module", - "svelte": "src/carbon-components-svelte/index.js", - "module": "src/carbon-components-svelte", + "module": "dist", "scripts": { "test:types": "svelte-check --workspace tests", "lint": "prettier --write \"**/*.{svelte,md,js,json,ts}\"", + "build": "yarn build:sass && yarn build:package", "build:css": "node scripts/build-css", "build:docs": "node scripts/build-docs", "build:lib": "rollup -c", - "build:package": "svelte-package", + "build:sass": "sass --load-path node_modules --no-source-map ./src/carbon-components-svelte/**/*.scss", + "build:package": "svelte-package -i src/carbon-components-svelte", "format": "prettier --write \"./**/*.{svelte,js,md}\"", "prepack": "yarn build:docs & yarn build:lib", "release": "standard-version && yarn prepack" @@ -24,14 +25,14 @@ "@carbon/styles": "^1.20.0", "@rollup/plugin-commonjs": "^21.0.3", "@rollup/plugin-node-resolve": "^13.3.0", - "@sveltejs/package": "^1.0.2", + "@sveltejs/package": "^2.0.2", "@sveltejs/vite-plugin-svelte": "^2.0.2", "@tsconfig/svelte": "^3.0.0", "autoprefixer": "^10.4.8", "carbon-components": "^10.58.3", "carbon-icons-svelte": "^11.2.0", "postcss": "^8.4.16", - "prettier": "^2.7.1", + "prettier": "^2.8.4", "prettier-plugin-svelte": "^2.7.0", "rollup": "^2.78.1", "rollup-plugin-svelte": "^7.1.0", @@ -40,10 +41,10 @@ "standard-version": "^9.5.0", "sveld": "^0.18.0", "svelte": "^3.55.1", - "svelte-check": "^2.8.1", + "svelte-check": "^3.0.4", "svelte-preprocess": "^4.10.7", - "typescript": "^4.7.4", - "vite": "^4.0.4" + "typescript": "^4.9.5", + "vite": "^4.1.4" }, "peerDependencies": { "svelte": "^3.55.1" @@ -77,5 +78,10 @@ "Josef Aidt (https://github.com/josefaidt)", "Eric Liu (https://github.com/metonym)", "Enrico Sacchetti (https://github.com/theetrain)" - ] + ], + "exports": { + ".": { + "svelte": "./dist/index.js" + } + } } diff --git a/svelte.config.js b/svelte.config.js index b96992ddb3..21b5371f13 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,9 +1,6 @@ import { vitePreprocess as preprocess } from "@sveltejs/vite-plugin-svelte"; const config = { - package: { - source: "src/carbon-components-svelte", - }, preprocess: [ preprocess({ scss: { diff --git a/yarn.lock b/yarn.lock index 650e893ee7..e5bb0b6d89 100644 --- a/yarn.lock +++ b/yarn.lock @@ -237,7 +237,7 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/resolve-uri@^3.0.3": +"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== @@ -255,11 +255,19 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13": +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.14": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== +"@jridgewell/trace-mapping@^0.3.17": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" + "@jridgewell/trace-mapping@^0.3.9": version "0.3.14" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" @@ -323,10 +331,10 @@ estree-walker "^1.0.1" picomatch "^2.2.2" -"@sveltejs/package@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@sveltejs/package/-/package-1.0.2.tgz#5b282e91f17754667db76a11fbd40ed4caca7e83" - integrity sha512-VY9U+05d9uNFDj7ScKRlHORYlfPSHwJewBjV+V2RsnViexpLFPUrboC9SiPYDCpLnbeqwXerxhO6twGHUBGeIA== +"@sveltejs/package@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@sveltejs/package/-/package-2.0.2.tgz#3c5a2a67ade8429c6c54b163b081c70cf04b30d8" + integrity sha512-cCOCcO8yMHnhHyaR51nQtvKZ3o/vSU9UYI1EXLT1j2CKNPMuH1/g6JNwKcNNrtQGwwquudc69ZeYy8D/TDNwEw== dependencies: chokidar "^3.5.3" kleur "^4.1.5" @@ -385,6 +393,11 @@ resolved "https://registry.npmjs.org/@types/pug/-/pug-2.0.4.tgz#8772fcd0418e3cd2cc171555d73007415051f4b2" integrity sha1-h3L80EGOPNLMFxVV1zAHQVBR9LI= +"@types/pug@^2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/pug/-/pug-2.0.6.tgz#f830323c88172e66826d0bde413498b61054b5a6" + integrity sha512-SnHmG9wN1UVmagJOnyo/qkk0Z7gejYxOYYmaAwr5u2yFYfsupN3sg10kyzN8Hep/2zbHxCnsumxOoRIRMBwKCg== + "@types/resolve@1.17.1": version "1.17.1" resolved "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" @@ -399,6 +412,13 @@ dependencies: "@types/node" "*" +"@types/sass@^1.43.1": + version "1.43.1" + resolved "https://registry.yarnpkg.com/@types/sass/-/sass-1.43.1.tgz#86bb0168e9e881d7dade6eba16c9ed6d25dc2f68" + integrity sha512-BPdoIt1lfJ6B7rw35ncdwBZrAssjcwzI5LByIrYs+tpXlj/CAkuVdRsgZDdP4lq5EjyWzwxZCqAoFyHKFwp32g== + dependencies: + "@types/node" "*" + JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -908,6 +928,11 @@ detect-indent@^6.0.0: resolved "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd" integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA== +detect-indent@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" + integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== + detect-newline@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" @@ -950,7 +975,7 @@ es6-promise@^3.1.2: resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" integrity sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM= -esbuild@^0.16.3: +esbuild@^0.16.14: version "0.16.17" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.16.17.tgz#fc2c3914c57ee750635fee71b89f615f25065259" integrity sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg== @@ -1832,7 +1857,7 @@ postcss@^8.4.16: picocolors "^1.0.0" source-map-js "^1.0.2" -postcss@^8.4.20: +postcss@^8.4.21: version "8.4.21" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4" integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== @@ -1851,10 +1876,10 @@ prettier@^2.6.2: resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.6.2.tgz#e26d71a18a74c3d0f0597f55f01fb6c06c206032" integrity sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew== -prettier@^2.7.1: - version "2.7.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" - integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== +prettier@^2.8.4: + version "2.8.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3" + integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw== process-nextick-args@~2.0.0: version "2.0.1" @@ -2048,10 +2073,10 @@ rollup@^2.78.1: optionalDependencies: fsevents "~2.3.2" -rollup@^3.7.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.10.0.tgz#6eb19196d8b3b375ca651cb78261faac48e24cd6" - integrity sha512-JmRYz44NjC1MjVF2VKxc0M1a97vn+cDxeqWmnwyAF4FvpjK8YFdHpaqvQB+3IxCvX05vJxKZkoMDU8TShhmJVA== +rollup@^3.10.0: + version "3.18.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.18.0.tgz#2354ba63ba66d6a09c652c3ea0dbcd9dad72bbde" + integrity sha512-J8C6VfEBjkvYPESMQYxKHxNOh4A5a3FlP+0BETGo34HEcE4eTlgCrO2+eWzlu2a/sHs2QUkZco+wscH7jhhgWg== optionalDependencies: fsevents "~2.3.2" @@ -2137,6 +2162,16 @@ sorcery@^0.10.0: sander "^0.5.0" sourcemap-codec "^1.3.0" +sorcery@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.11.0.tgz#310c80ee993433854bb55bb9aa4003acd147fca8" + integrity sha512-J69LQ22xrQB1cIFJhPfgtLuI6BpWRiWu1Y3vSsIwK/eAScqJxd/+CJlUuHQRdX2C9NGFamq+KqNywGgaThwfHw== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.14" + buffer-crc32 "^0.2.5" + minimist "^1.2.0" + sander "^0.5.0" + "source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" @@ -2302,35 +2337,25 @@ sveld@^0.18.0: svelte-preprocess "^4.10.6" typescript "^4.8.4" -svelte-check@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/svelte-check/-/svelte-check-2.8.1.tgz#484499d66ad6a5043e9dfeb91b0dfadf2a9c63b0" - integrity sha512-cibyY1sgt3ONIDnQbSgV2X9AJFhwEslRHNo95lijrYfPzVEvTvbmL2ohsUyqB5L7j1GhLXtQbjCJ4lZZ/fwbeQ== +svelte-check@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/svelte-check/-/svelte-check-3.0.4.tgz#8cd191fd27627da890405385ec80de6529828aee" + integrity sha512-feIyBAA5cSIxq4vq6mwGvGQTHy/wBVQbs5b+/VvE21WN8X7nonAuSqwvZv0UDBowzRka3Rh4gmLPH8rPePz3/w== dependencies: - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/trace-mapping" "^0.3.17" chokidar "^3.4.1" fast-glob "^3.2.7" import-fresh "^3.2.1" picocolors "^1.0.0" sade "^1.7.4" - svelte-preprocess "^4.0.0" - typescript "*" + svelte-preprocess "^5.0.0" + typescript "^4.9.4" svelte-hmr@^0.15.1: version "0.15.1" resolved "https://registry.yarnpkg.com/svelte-hmr/-/svelte-hmr-0.15.1.tgz#d11d878a0bbb12ec1cba030f580cd2049f4ec86b" integrity sha512-BiKB4RZ8YSwRKCNVdNxK/GfY+r4Kjgp9jCLEy0DuqAKfmQtpL38cQK3afdpjw4sqSs4PLi3jIPJIFp259NkZtA== -svelte-preprocess@^4.0.0: - version "4.5.2" - resolved "https://registry.npmjs.org/svelte-preprocess/-/svelte-preprocess-4.5.2.tgz#37976d1e0d866eb382411d486f7468d2275087e9" - integrity sha512-ClUX5NecnGBwI+nJnnBvKKy0XutCq5uHTIKe6cPhpvuOj9AAnyvef9wOZAE93yr85OKPutGCNIJa/X1TrJ7O0Q== - dependencies: - "@types/pug" "^2.0.4" - "@types/sass" "^1.16.0" - detect-indent "^6.0.0" - strip-indent "^3.0.0" - svelte-preprocess@^4.10.6: version "4.10.6" resolved "https://registry.yarnpkg.com/svelte-preprocess/-/svelte-preprocess-4.10.6.tgz#5f9a53e7ed3b85fc7e0841120c725b76ac5a1ba8" @@ -2355,6 +2380,18 @@ svelte-preprocess@^4.10.7: sorcery "^0.10.0" strip-indent "^3.0.0" +svelte-preprocess@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/svelte-preprocess/-/svelte-preprocess-5.0.1.tgz#3dd21a17eb508347d4b26a0d98059d23e2d1b9a0" + integrity sha512-0HXyhCoc9rsW4zGOgtInylC6qj259E1hpFnJMJWTf+aIfeqh4O/QHT31KT2hvPEqQfdjmqBR/kO2JDkkciBLrQ== + dependencies: + "@types/pug" "^2.0.6" + "@types/sass" "^1.43.1" + detect-indent "^6.1.0" + magic-string "^0.27.0" + sorcery "^0.11.0" + strip-indent "^3.0.0" + svelte2tsx@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/svelte2tsx/-/svelte2tsx-0.6.0.tgz#83efa0d4cad8102145c140e956cf152282bbb05d" @@ -2445,21 +2482,16 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@*: - version "4.0.5" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz#ae9dddfd1069f1cb5beb3ef3b2170dd7c1332389" - integrity sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ== - -typescript@^4.7.4: - version "4.7.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235" - integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ== - typescript@^4.8.4: version "4.9.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== +typescript@^4.9.4, typescript@^4.9.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + uglify-js@^3.1.4: version "3.17.4" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" @@ -2486,15 +2518,15 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -vite@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/vite/-/vite-4.0.4.tgz#4612ce0b47bbb233a887a54a4ae0c6e240a0da31" - integrity sha512-xevPU7M8FU0i/80DMR+YhgrzR5KS2ORy1B4xcX/cXLsvnUWvfHuqMmVU6N0YiJ4JWGRJJsLCgjEzKjG9/GKoSw== +vite@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/vite/-/vite-4.1.4.tgz#170d93bcff97e0ebc09764c053eebe130bfe6ca0" + integrity sha512-3knk/HsbSTKEin43zHu7jTwYWv81f8kgAL99G5NWBcA1LKvtvcVAC4JjBH1arBunO9kQka+1oGbrMKOjk4ZrBg== dependencies: - esbuild "^0.16.3" - postcss "^8.4.20" + esbuild "^0.16.14" + postcss "^8.4.21" resolve "^1.22.1" - rollup "^3.7.0" + rollup "^3.10.0" optionalDependencies: fsevents "~2.3.2"