From ec3ebaa15454aeee87c0e0b9f0dee0048a48a5fe Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Thu, 20 Apr 2023 09:43:16 -0700 Subject: [PATCH 01/12] chore: don't bundle dependencies --- package.json | 28 ++--- pnpm-lock.yaml | 286 ++++++++++++++++++---------------------------- rollup.config.mjs | 42 ++++--- 3 files changed, 150 insertions(+), 206 deletions(-) diff --git a/package.json b/package.json index 9c2ada6782d7..eac57dee17ee 100644 --- a/package.json +++ b/package.json @@ -111,9 +111,21 @@ "url": "https://github.com/sveltejs/svelte/issues" }, "homepage": "https://svelte.dev", - "devDependencies": { + "dependencies": { "@ampproject/remapping": "^2.2.1", "@jridgewell/sourcemap-codec": "^1.4.15", + "acorn": "^8.8.2", + "aria-query": "^5.1.3", + "axobject-query": "^3.1.1", + "code-red": "^1.0.0", + "css-tree": "^2.3.1", + "estree-walker": "^3.0.3", + "is-reference": "^3.0.1", + "locate-character": "^2.0.5", + "magic-string": "^0.30.0", + "periscopic": "^3.1.0" + }, + "devDependencies": { "@rollup/plugin-commonjs": "^24.1.0", "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.2", @@ -128,34 +140,22 @@ "@types/node": "^14.14.31", "@typescript-eslint/eslint-plugin": "^5.58.0", "@typescript-eslint/parser": "^5.58.0", - "acorn": "^8.8.2", "agadoo": "^3.0.0", - "aria-query": "^5.1.3", - "axobject-query": "^3.1.1", - "code-red": "^1.0.0", - "css-tree": "^2.3.1", "eslint": "^8.35.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-svelte3": "^4.0.0", - "estree-walker": "^3.0.3", - "is-reference": "^3.0.1", "jsdom": "^21.1.1", "kleur": "^4.1.5", - "locate-character": "^2.0.5", - "magic-string": "^0.30.0", "mocha": "^10.2.0", - "periscopic": "^3.1.0", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.0", "puppeteer": "^19.8.5", "rollup": "^3.20.2", - "source-map": "^0.7.4", "source-map-support": "^0.5.21", "tiny-glob": "^0.2.9", "tslib": "^2.5.0", - "typescript": "^5.0.4", - "util": "^0.12.5" + "typescript": "^5.0.4" }, "packageManager": "pnpm@8.4.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed6da5e72608..bb374f3d3474 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,12 +1,44 @@ lockfileVersion: '6.0' -devDependencies: +dependencies: '@ampproject/remapping': specifier: ^2.2.1 version: 2.2.1 '@jridgewell/sourcemap-codec': specifier: ^1.4.15 version: 1.4.15 + acorn: + specifier: ^8.8.2 + version: 8.8.2 + aria-query: + specifier: ^5.1.3 + version: 5.1.3 + axobject-query: + specifier: ^3.1.1 + version: 3.1.1 + code-red: + specifier: ^1.0.0 + version: 1.0.0 + css-tree: + specifier: ^2.3.1 + version: 2.3.1 + estree-walker: + specifier: ^3.0.3 + version: 3.0.3 + is-reference: + specifier: ^3.0.1 + version: 3.0.1 + locate-character: + specifier: ^2.0.5 + version: 2.0.5 + magic-string: + specifier: ^0.30.0 + version: 0.30.0 + periscopic: + specifier: ^3.1.0 + version: 3.1.0 + +devDependencies: '@rollup/plugin-commonjs': specifier: ^24.1.0 version: 24.1.0(rollup@3.20.2) @@ -49,24 +81,9 @@ devDependencies: '@typescript-eslint/parser': specifier: ^5.58.0 version: 5.58.0(eslint@8.35.0)(typescript@5.0.4) - acorn: - specifier: ^8.8.2 - version: 8.8.2 agadoo: specifier: ^3.0.0 version: 3.0.0 - aria-query: - specifier: ^5.1.3 - version: 5.1.3 - axobject-query: - specifier: ^3.1.1 - version: 3.1.1 - code-red: - specifier: ^1.0.0 - version: 1.0.0 - css-tree: - specifier: ^2.3.1 - version: 2.3.1 eslint: specifier: ^8.35.0 version: 8.35.0 @@ -78,46 +95,28 @@ devDependencies: version: 2.27.5(@typescript-eslint/parser@5.58.0)(eslint@8.35.0) eslint-plugin-svelte3: specifier: ^4.0.0 - version: 4.0.0(eslint@8.35.0)(svelte@3.58.0) - estree-walker: - specifier: ^3.0.3 - version: 3.0.3 - is-reference: - specifier: ^3.0.1 - version: 3.0.1 + version: 4.0.0(eslint@8.35.0)(svelte@3.59.1) jsdom: specifier: ^21.1.1 version: 21.1.1 kleur: specifier: ^4.1.5 version: 4.1.5 - locate-character: - specifier: ^2.0.5 - version: 2.0.5 - magic-string: - specifier: ^0.30.0 - version: 0.30.0 mocha: specifier: ^10.2.0 version: 10.2.0 - periscopic: - specifier: ^3.1.0 - version: 3.1.0 prettier: specifier: ^2.8.8 version: 2.8.8 prettier-plugin-svelte: specifier: ^2.10.0 - version: 2.10.0(prettier@2.8.8)(svelte@3.58.0) + version: 2.10.0(prettier@2.8.8)(svelte@3.59.1) puppeteer: specifier: ^19.8.5 version: 19.8.5(typescript@5.0.4) rollup: specifier: ^3.20.2 version: 3.20.2 - source-map: - specifier: ^0.7.4 - version: 0.7.4 source-map-support: specifier: ^0.5.21 version: 0.5.21 @@ -130,9 +129,6 @@ devDependencies: typescript: specifier: ^5.0.4 version: 5.0.4 - util: - specifier: ^0.12.5 - version: 0.12.5 packages: @@ -142,7 +138,7 @@ packages: dependencies: '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.18 - dev: true + dev: false /@babel/code-frame@7.21.4: resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==} @@ -172,21 +168,21 @@ packages: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: eslint: 8.35.0 - eslint-visitor-keys: 3.4.0 + eslint-visitor-keys: 3.4.1 dev: true - /@eslint-community/regexpp@4.5.0: - resolution: {integrity: sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==} + /@eslint-community/regexpp@4.5.1: + resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.0.2: - resolution: {integrity: sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==} + /@eslint/eslintrc@2.0.3: + resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4(supports-color@8.1.1) - espree: 9.5.1 + espree: 9.5.2 globals: 13.20.0 ignore: 5.2.4 import-fresh: 3.3.0 @@ -229,32 +225,26 @@ packages: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/trace-mapping': 0.3.18 - dev: true /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} - dev: true /@jridgewell/set-array@1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} - dev: true /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} - dev: true /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - dev: true /@jridgewell/trace-mapping@0.3.18: resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 - dev: true /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -435,7 +425,6 @@ packages: /@types/estree@1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} - dev: true /@types/json-schema@7.0.11: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} @@ -457,8 +446,8 @@ packages: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} dev: true - /@types/semver@7.3.13: - resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==} + /@types/semver@7.5.0: + resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} dev: true /@types/yauzl@2.10.0: @@ -480,7 +469,7 @@ packages: typescript: optional: true dependencies: - '@eslint-community/regexpp': 4.5.0 + '@eslint-community/regexpp': 4.5.1 '@typescript-eslint/parser': 5.58.0(eslint@8.35.0)(typescript@5.0.4) '@typescript-eslint/scope-manager': 5.58.0 '@typescript-eslint/type-utils': 5.58.0(eslint@8.35.0)(typescript@5.0.4) @@ -490,7 +479,7 @@ packages: grapheme-splitter: 1.0.4 ignore: 5.2.4 natural-compare-lite: 1.4.0 - semver: 7.4.0 + semver: 7.5.0 tsutils: 3.21.0(typescript@5.0.4) typescript: 5.0.4 transitivePeerDependencies: @@ -564,7 +553,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 - semver: 7.4.0 + semver: 7.5.0 tsutils: 3.21.0(typescript@5.0.4) typescript: 5.0.4 transitivePeerDependencies: @@ -579,13 +568,13 @@ packages: dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.35.0) '@types/json-schema': 7.0.11 - '@types/semver': 7.3.13 + '@types/semver': 7.5.0 '@typescript-eslint/scope-manager': 5.58.0 '@typescript-eslint/types': 5.58.0 '@typescript-eslint/typescript-estree': 5.58.0(typescript@5.0.4) eslint: 8.35.0 eslint-scope: 5.1.1 - semver: 7.4.0 + semver: 7.5.0 transitivePeerDependencies: - supports-color - typescript @@ -596,7 +585,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: '@typescript-eslint/types': 5.58.0 - eslint-visitor-keys: 3.4.0 + eslint-visitor-keys: 3.4.1 dev: true /abab@2.0.6: @@ -627,7 +616,6 @@ packages: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true - dev: true /agadoo@3.0.0: resolution: {integrity: sha512-gq+fjT3Ilrhb88Jf+vYMjdO/+3znYfa7vJ4IMLPFsBPUxglnr40Ed3yCLrW6IABdJAedB94b2BkqR6I04lh3dg==} @@ -699,15 +687,14 @@ packages: /aria-query@5.1.3: resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==} dependencies: - deep-equal: 2.2.0 - dev: true + deep-equal: 2.2.1 + dev: false /array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} dependencies: call-bind: 1.0.2 is-array-buffer: 3.0.2 - dev: true /array-includes@3.1.6: resolution: {integrity: sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==} @@ -752,13 +739,12 @@ packages: /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} - dev: true /axobject-query@3.1.1: resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==} dependencies: - deep-equal: 2.2.0 - dev: true + deep-equal: 2.2.1 + dev: false /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -830,7 +816,6 @@ packages: dependencies: function-bind: 1.1.1 get-intrinsic: 1.2.0 - dev: true /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -912,7 +897,7 @@ packages: acorn: 8.8.2 estree-walker: 3.0.3 periscopic: 3.1.0 - dev: true + dev: false /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -988,7 +973,7 @@ packages: dependencies: mdn-data: 2.0.30 source-map-js: 1.0.2 - dev: true + dev: false /cssstyle@3.0.0: resolution: {integrity: sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==} @@ -1039,9 +1024,10 @@ packages: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} dev: true - /deep-equal@2.2.0: - resolution: {integrity: sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==} + /deep-equal@2.2.1: + resolution: {integrity: sha512-lKdkdV6EOGoVn65XaOsPdH4rMxTZOnmFyuIkMjM1i5HHCbfjC97dawgTAy0deYNfuqUqW+Q5VrVaQYtUpSd6yQ==} dependencies: + array-buffer-byte-length: 1.0.0 call-bind: 1.0.2 es-get-iterator: 1.1.3 get-intrinsic: 1.2.0 @@ -1054,12 +1040,12 @@ packages: object-is: 1.1.5 object-keys: 1.1.1 object.assign: 4.1.4 - regexp.prototype.flags: 1.4.3 + regexp.prototype.flags: 1.5.0 side-channel: 1.0.4 which-boxed-primitive: 1.0.2 which-collection: 1.0.1 which-typed-array: 1.1.9 - dev: true + dev: false /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -1076,7 +1062,6 @@ packages: dependencies: has-property-descriptors: 1.0.0 object-keys: 1.1.1 - dev: true /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} @@ -1130,8 +1115,8 @@ packages: once: 1.4.0 dev: true - /entities@4.4.0: - resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} + /entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} dev: true @@ -1171,7 +1156,7 @@ packages: object-inspect: 1.12.3 object-keys: 1.1.1 object.assign: 4.1.4 - regexp.prototype.flags: 1.4.3 + regexp.prototype.flags: 1.5.0 safe-regex-test: 1.0.0 string.prototype.trim: 1.2.7 string.prototype.trimend: 1.0.6 @@ -1193,7 +1178,7 @@ packages: is-string: 1.0.7 isarray: 2.0.5 stop-iteration-iterator: 1.0.0 - dev: true + dev: false /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} @@ -1266,8 +1251,8 @@ packages: - supports-color dev: true - /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.58.0)(eslint-import-resolver-node@0.3.7)(eslint@8.35.0): - resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.58.0)(eslint-import-resolver-node@0.3.7)(eslint@8.35.0): + resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -1324,7 +1309,7 @@ packages: doctrine: 2.1.0 eslint: 8.35.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.58.0)(eslint-import-resolver-node@0.3.7)(eslint@8.35.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.58.0)(eslint-import-resolver-node@0.3.7)(eslint@8.35.0) has: 1.0.3 is-core-module: 2.12.0 is-glob: 4.0.3 @@ -1354,14 +1339,14 @@ packages: semver: 6.3.0 dev: true - /eslint-plugin-svelte3@4.0.0(eslint@8.35.0)(svelte@3.58.0): + /eslint-plugin-svelte3@4.0.0(eslint@8.35.0)(svelte@3.59.1): resolution: {integrity: sha512-OIx9lgaNzD02+MDFNLw0GEUbuovNcglg+wnd/UY0fbZmlQSz7GlQiQ1f+yX0XvC07XPcDOnFcichqI3xCwp71g==} peerDependencies: eslint: '>=8.0.0' svelte: ^3.2.0 dependencies: eslint: 8.35.0 - svelte: 3.58.0 + svelte: 3.59.1 dev: true /eslint-scope@5.1.1: @@ -1372,8 +1357,8 @@ packages: estraverse: 4.3.0 dev: true - /eslint-scope@7.1.1: - resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==} + /eslint-scope@7.2.0: + resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: esrecurse: 4.3.0 @@ -1407,8 +1392,8 @@ packages: engines: {node: '>=10'} dev: true - /eslint-visitor-keys@3.4.0: - resolution: {integrity: sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==} + /eslint-visitor-keys@3.4.1: + resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -1417,7 +1402,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 2.0.2 + '@eslint/eslintrc': 2.0.3 '@eslint/js': 8.35.0 '@humanwhocodes/config-array': 0.11.8 '@humanwhocodes/module-importer': 1.0.1 @@ -1428,10 +1413,10 @@ packages: debug: 4.3.4(supports-color@8.1.1) doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.1.1 + eslint-scope: 7.2.0 eslint-utils: 3.0.0(eslint@8.35.0) - eslint-visitor-keys: 3.4.0 - espree: 9.5.1 + eslint-visitor-keys: 3.4.1 + espree: 9.5.2 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -1461,13 +1446,13 @@ packages: - supports-color dev: true - /espree@9.5.1: - resolution: {integrity: sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==} + /espree@9.5.2: + resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: acorn: 8.8.2 acorn-jsx: 5.3.2(acorn@8.8.2) - eslint-visitor-keys: 3.4.0 + eslint-visitor-keys: 3.4.1 dev: true /esprima@4.0.1: @@ -1508,7 +1493,7 @@ packages: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} dependencies: '@types/estree': 1.0.0 - dev: true + dev: false /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} @@ -1607,7 +1592,6 @@ packages: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: is-callable: 1.2.7 - dev: true /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} @@ -1636,7 +1620,6 @@ packages: /function-bind@1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true /function.prototype.name@1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} @@ -1650,7 +1633,6 @@ packages: /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: true /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} @@ -1663,7 +1645,6 @@ packages: function-bind: 1.1.1 has: 1.0.3 has-symbols: 1.0.3 - dev: true /get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} @@ -1776,7 +1757,6 @@ packages: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: get-intrinsic: 1.2.0 - dev: true /grapheme-splitter@1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} @@ -1784,7 +1764,6 @@ packages: /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - dev: true /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} @@ -1800,7 +1779,6 @@ packages: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} dependencies: get-intrinsic: 1.2.0 - dev: true /has-proto@1.0.1: resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} @@ -1810,21 +1788,18 @@ packages: /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} - dev: true /has-tostringtag@1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 - dev: true /has@1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true /he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} @@ -1906,7 +1881,6 @@ packages: get-intrinsic: 1.2.0 has: 1.0.3 side-channel: 1.0.4 - dev: true /is-arguments@1.1.1: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} @@ -1914,7 +1888,7 @@ packages: dependencies: call-bind: 1.0.2 has-tostringtag: 1.0.0 - dev: true + dev: false /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} @@ -1922,7 +1896,6 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.2.0 is-typed-array: 1.1.10 - dev: true /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} @@ -1932,7 +1905,6 @@ packages: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: has-bigints: 1.0.2 - dev: true /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} @@ -1947,7 +1919,6 @@ packages: dependencies: call-bind: 1.0.2 has-tostringtag: 1.0.0 - dev: true /is-builtin-module@3.2.1: resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} @@ -1959,7 +1930,6 @@ packages: /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - dev: true /is-core-module@2.12.0: resolution: {integrity: sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ==} @@ -1972,7 +1942,6 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: true /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} @@ -1984,13 +1953,6 @@ packages: engines: {node: '>=8'} dev: true - /is-generator-function@1.0.10: - resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} - engines: {node: '>= 0.4'} - dependencies: - has-tostringtag: 1.0.0 - dev: true - /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -2000,7 +1962,7 @@ packages: /is-map@2.0.2: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} - dev: true + dev: false /is-module@1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} @@ -2016,7 +1978,6 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: true /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} @@ -2047,7 +2008,7 @@ packages: resolution: {integrity: sha512-baJJdQLiYaJdvFbJqXrcGv3WU3QCzBlUcI5QhbesIm6/xPsvmO+2CDoi/GMOFBQEQm+PXkwOPrp9KK5ozZsp2w==} dependencies: '@types/estree': 1.0.0 - dev: true + dev: false /is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} @@ -2055,31 +2016,27 @@ packages: dependencies: call-bind: 1.0.2 has-tostringtag: 1.0.0 - dev: true /is-set@2.0.2: resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} - dev: true + dev: false /is-shared-array-buffer@1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: call-bind: 1.0.2 - dev: true /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: true /is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 - dev: true /is-typed-array@1.1.10: resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} @@ -2090,7 +2047,6 @@ packages: for-each: 0.3.3 gopd: 1.0.1 has-tostringtag: 1.0.0 - dev: true /is-unicode-supported@0.1.0: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} @@ -2099,7 +2055,7 @@ packages: /is-weakmap@2.0.1: resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} - dev: true + dev: false /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} @@ -2112,11 +2068,11 @@ packages: dependencies: call-bind: 1.0.2 get-intrinsic: 1.2.0 - dev: true + dev: false /isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} - dev: true + dev: false /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -2159,7 +2115,7 @@ packages: http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.3 + nwsapi: 2.2.4 parse5: 7.1.2 rrweb-cssom: 0.6.0 saxes: 6.0.0 @@ -2224,7 +2180,7 @@ packages: /locate-character@2.0.5: resolution: {integrity: sha512-n2GmejDXtOPBAZdIiEFy5dJ5N38xBCXLNOtw2WpB9kGh6pnrEuKlwYI+Tkpofc4wDtVXHtoAOJaMRlYG/oYaxg==} - dev: true + dev: false /locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} @@ -2264,11 +2220,11 @@ packages: engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 - dev: true + dev: false /mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} - dev: true + dev: false /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} @@ -2402,8 +2358,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /nwsapi@2.2.3: - resolution: {integrity: sha512-jscxIO4/VKScHlbmFBdV1Z6LXnLO+ZR4VMtypudUdfwtKxUN3TQcNFIHLwKtrUbDyHN4/GycY9+oRGZ2XMXYPw==} + /nwsapi@2.2.4: + resolution: {integrity: sha512-NHj4rzRo0tQdijE9ZqAx6kYDcoRwYwSYzCA8MY3JzfxlrvEU0jhnhJT9BhqhJs7I/dKcrDm6TyulaRqZPIhN5g==} dev: true /object-assign@4.1.1: @@ -2413,7 +2369,6 @@ packages: /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} - dev: true /object-is@1.1.5: resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} @@ -2421,12 +2376,11 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - dev: true + dev: false /object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} - dev: true /object.assign@4.1.4: resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} @@ -2436,7 +2390,6 @@ packages: define-properties: 1.2.0 has-symbols: 1.0.3 object-keys: 1.1.1 - dev: true /object.values@1.1.6: resolution: {integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==} @@ -2511,7 +2464,7 @@ packages: /parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} dependencies: - entities: 4.4.0 + entities: 4.5.0 dev: true /path-exists@4.0.0: @@ -2548,7 +2501,7 @@ packages: '@types/estree': 1.0.0 estree-walker: 3.0.3 is-reference: 3.0.1 - dev: true + dev: false /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -2570,14 +2523,14 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier-plugin-svelte@2.10.0(prettier@2.8.8)(svelte@3.58.0): + /prettier-plugin-svelte@2.10.0(prettier@2.8.8)(svelte@3.59.1): resolution: {integrity: sha512-GXMY6t86thctyCvQq+jqElO+MKdB09BkL3hexyGP3Oi8XLKRFaJP1ud/xlWCZ9ZIa2BxHka32zhHfcuU+XsRQg==} peerDependencies: prettier: ^1.16.4 || ^2.0.0 svelte: ^3.2.0 dependencies: prettier: 2.8.8 - svelte: 3.58.0 + svelte: 3.59.1 dev: true /prettier@2.8.8: @@ -2687,14 +2640,13 @@ packages: picomatch: 2.3.1 dev: true - /regexp.prototype.flags@1.4.3: - resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + /regexp.prototype.flags@1.5.0: + resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 functions-have-names: 1.2.3 - dev: true /regexpp@3.2.0: resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} @@ -2782,8 +2734,8 @@ packages: hasBin: true dev: true - /semver@7.4.0: - resolution: {integrity: sha512-RgOxM8Mw+7Zus0+zcLEUn8+JfoLpj/huFTItQy2hsM4khuC1HYRDp0cU482Ewn/Fcy6bCjufD8vAj7voC66KQw==} + /semver@7.5.0: + resolution: {integrity: sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==} engines: {node: '>=10'} hasBin: true dependencies: @@ -2814,7 +2766,6 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.2.0 object-inspect: 1.12.3 - dev: true /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} @@ -2824,7 +2775,7 @@ packages: /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} - dev: true + dev: false /source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -2838,17 +2789,12 @@ packages: engines: {node: '>=0.10.0'} dev: true - /source-map@0.7.4: - resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} - engines: {node: '>= 8'} - dev: true - /stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} dependencies: internal-slot: 1.0.5 - dev: true + dev: false /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -2947,8 +2893,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /svelte@3.58.0: - resolution: {integrity: sha512-brIBNNB76mXFmU/Kerm4wFnkskBbluBDCjx/8TcpYRb298Yh2dztS2kQ6bhtjMcvUhd5ynClfwpz5h2gnzdQ1A==} + /svelte@3.59.1: + resolution: {integrity: sha512-pKj8fEBmqf6mq3/NfrB9SLtcJcUvjYSWyePlfCqN9gujLB25RitWK8PvFzlwim6hD/We35KbPlRteuA6rnPGcQ==} engines: {node: '>= 8'} dev: true @@ -3134,16 +3080,6 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true - /util@0.12.5: - resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} - dependencies: - inherits: 2.0.4 - is-arguments: 1.1.1 - is-generator-function: 1.0.10 - is-typed-array: 1.1.10 - which-typed-array: 1.1.9 - dev: true - /w3c-xmlserializer@4.0.0: resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} engines: {node: '>=14'} @@ -3195,7 +3131,6 @@ packages: is-number-object: 1.0.7 is-string: 1.0.7 is-symbol: 1.0.4 - dev: true /which-collection@1.0.1: resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==} @@ -3204,7 +3139,7 @@ packages: is-set: 2.0.2 is-weakmap: 2.0.1 is-weakset: 2.0.2 - dev: true + dev: false /which-typed-array@1.1.9: resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} @@ -3216,7 +3151,6 @@ packages: gopd: 1.0.1 has-tostringtag: 1.0.0 is-typed-array: 1.1.10 - dev: true /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} @@ -3356,6 +3290,6 @@ packages: eslint: 8.35.0 eslint-plugin-import: 2.27.5(@typescript-eslint/parser@5.58.0)(eslint@8.35.0) eslint-plugin-node: 11.1.0(eslint@8.35.0) - eslint-plugin-svelte3: 4.0.0(eslint@8.35.0)(svelte@3.58.0) + eslint-plugin-svelte3: 4.0.0(eslint@8.35.0)(svelte@3.59.1) typescript: 5.0.4 dev: true diff --git a/rollup.config.mjs b/rollup.config.mjs index 54b988b51b38..3134aecafbe1 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -101,26 +101,42 @@ export default [ } ] }, - /* compiler.js */ + // compiler.js - ESM version { input: 'src/compiler/index.ts', plugins: [ replace({ preventAssignment: true, values: { - __VERSION__: pkg.version, - 'process.env.NODE_DEBUG': false // appears inside the util package + __VERSION__: pkg.version }, }), + resolve(), + commonjs({ + include: ['node_modules/**'] + }), + json(), + ts_plugin + ], + output: [ { - resolveId(id) { - // util is a built-in module in Node.js, but we want a self-contained compiler bundle - // that also works in the browser, so we load its polyfill instead - if (id === 'util') { - return require.resolve('./node_modules/util'); // just 'utils' would resolve this to the built-in module - } + file: 'compiler.mjs', + format: 'esm', + name: 'svelte', + sourcemap: true, + } + ] + }, + // compiler.js - UMD version for REPL + { + input: 'src/compiler/index.ts', + plugins: [ + replace({ + preventAssignment: true, + values: { + __VERSION__: pkg.version }, - }, + }), resolve(), commonjs({ include: ['node_modules/**'] @@ -134,12 +150,6 @@ export default [ format: is_publish ? 'umd' : 'cjs', name: 'svelte', sourcemap: true, - }, - { - file: 'compiler.mjs', - format: 'esm', - name: 'svelte', - sourcemap: true, } ], external: is_publish From 391795f4e249bba067da2b565c3b26c8c07008e5 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Mon, 22 May 2023 15:24:28 +0200 Subject: [PATCH 02/12] chore: use unbundled code for esm version - removes esm bundle step - introduces generated version.js because we can no longer use replace because we don't bundle esm --- .gitignore | 1 + .prettierignore | 2 + package.json | 36 ++++++------ rollup.config.mjs => rollup.config.js | 82 +++++++++++---------------- src/compiler/compile/Component.js | 3 +- src/compiler/index.js | 4 +- src/runtime/internal/dev.js | 5 +- test/js/js-output.test.js | 5 +- 8 files changed, 62 insertions(+), 76 deletions(-) rename rollup.config.mjs => rollup.config.js (68%) diff --git a/.gitignore b/.gitignore index 2231de90652f..f3eaca3c6409 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ node_modules *.map /src/compiler/compile/internal_exports.js +/src/shared/version.js /compiler.d.ts /compiler.*js /index.*js diff --git a/.prettierignore b/.prettierignore index 15f58330d5c1..8caec41e087b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -5,6 +5,7 @@ /site !/src src/compiler/compile/internal_exports.js +src/shared/version.js !/test /test/**/*.svelte /test/**/_expected* @@ -12,3 +13,4 @@ src/compiler/compile/internal_exports.js /test/**/expected* /test/**/_output /types +!rollup.config.js diff --git a/package.json b/package.json index b66101ed2d1c..ca1efe54837f 100644 --- a/package.json +++ b/package.json @@ -26,52 +26,52 @@ ".": { "types": "./types/runtime/index.d.ts", "browser": { - "import": "./index.mjs", - "require": "./index.js" + "import": "./index.cjs", + "require": "./index.cjs" }, - "import": "./ssr.mjs", - "require": "./ssr.js" + "import": "./src/runtime/ssr.js", + "require": "./ssr.cjs" }, "./compiler": { "types": "./types/compiler/index.d.ts", - "import": "./compiler.mjs", - "require": "./compiler.js" + "import": "./src/compiler/index.js", + "require": "./compiler.cjs" }, "./action": { "types": "./types/runtime/action/index.d.ts" }, "./animate": { "types": "./types/runtime/animate/index.d.ts", - "import": "./animate/index.mjs", - "require": "./animate/index.js" + "import": "./src/runtime/animate/index.js", + "require": "./animate/index.cjs" }, "./easing": { "types": "./types/runtime/easing/index.d.ts", - "import": "./easing/index.mjs", - "require": "./easing/index.js" + "import": "./src/runtime/easing/index.js", + "require": "./easing/index.cjs" }, "./internal": { "types": "./types/runtime/internal/index.d.ts", - "import": "./internal/index.mjs", - "require": "./internal/index.js" + "import": "./src/runtime/internal/index.js", + "require": "./internal/index.cjs" }, "./motion": { "types": "./types/runtime/motion/index.d.ts", - "import": "./motion/index.mjs", - "require": "./motion/index.js" + "import": "./src/runtime/motion/index.js", + "require": "./motion/index.cjs" }, "./register": { "require": "./register.js" }, "./store": { "types": "./types/runtime/store/index.d.ts", - "import": "./store/index.mjs", - "require": "./store/index.js" + "import": "./src/runtime/store/index.js", + "require": "./store/index.cjs" }, "./transition": { "types": "./types/runtime/transition/index.d.ts", - "import": "./transition/index.mjs", - "require": "./transition/index.js" + "import": "./src/runtime/transition/index.js", + "require": "./transition/index.cjs" }, "./elements": { "types": "./elements/index.d.ts" diff --git a/rollup.config.mjs b/rollup.config.js similarity index 68% rename from rollup.config.mjs rename to rollup.config.js index d7f59264dc0a..d5d4156eec39 100644 --- a/rollup.config.mjs +++ b/rollup.config.js @@ -24,10 +24,15 @@ const ts_plugin = is_publish }); fs.writeFileSync( - `./compiler.d.ts`, + './compiler.d.ts', `export { compile, parse, preprocess, walk, VERSION } from './types/compiler/index.js';` ); +fs.writeFileSync( + './src/shared/version.js', + `/** @type {string} */\nexport const VERSION = '${pkg.version}';` +); + const runtime_entrypoints = Object.fromEntries( fs .readdirSync('src/runtime', { withFileTypes: true }) @@ -39,50 +44,37 @@ const runtime_entrypoints = Object.fromEntries( * @type {import("rollup").RollupOptions[]} */ export default [ + // Runtime: Generates CJS builds and type definition entry points for svelte/* and generated internal_exports.js { input: { ...runtime_entrypoints, index: 'src/runtime/index.js', ssr: 'src/runtime/ssr.js' }, - output: ['es', 'cjs'].map( - /** @returns {import('rollup').OutputOptions} */ - (format) => { - const ext = format === 'es' ? 'mjs' : 'js'; - return { - entryFileNames: (entry) => { - if (entry.isEntry) { - if (entry.name === 'index') return `index.${ext}`; - else if (entry.name === 'ssr') return `ssr.${ext}`; + output: { + entryFileNames: (entry) => { + if (entry.isEntry) { + if (entry.name === 'index') return `index.cjs`; + else if (entry.name === 'ssr') return `ssr.cjs`; - return `${entry.name}/index.${ext}`; - } - }, - chunkFileNames: `internal/[name]-[hash].${ext}`, - format, - minifyInternalExports: false, - dir: '.', - }; - } - ), + return `${entry.name}/index.cjs`; + } + }, + chunkFileNames: `internal/[name]-[hash].cjs`, + format: 'cjs', + minifyInternalExports: false, + dir: '.' + }, plugins: [ - replace({ - preventAssignment: true, - values: { - __VERSION__: pkg.version, - }, - }), ts_plugin, { - writeBundle(options, bundle) { - if (options.format !== 'es') return; - + writeBundle(_options, bundle) { for (const entry of Object.values(bundle)) { const dir = entry.name; if (!entry.isEntry || !runtime_entrypoints[dir]) continue; if (dir === 'internal') { - const mod = bundle[`internal/index.mjs`]; + const mod = bundle[`internal/index.cjs`]; if (mod) { fs.writeFileSync( 'src/compiler/compile/internal_exports.js', @@ -101,16 +93,15 @@ export default [ } ] }, - /* compiler.js */ + // Compiler: Generated CJS/UMD build for the compiler { input: 'src/compiler/index.js', plugins: [ replace({ preventAssignment: true, values: { - __VERSION__: pkg.version, 'process.env.NODE_DEBUG': false // appears inside the util package - }, + } }), { resolveId(id) { @@ -119,7 +110,7 @@ export default [ if (id === 'util') { return require.resolve('./node_modules/util'); // just 'utils' would resolve this to the built-in module } - }, + } }, resolve(), commonjs({ @@ -128,23 +119,14 @@ export default [ json(), ts_plugin ], - output: [ - { - file: 'compiler.js', - format: is_publish ? 'umd' : 'cjs', - name: 'svelte', - sourcemap: true, - }, - { - file: 'compiler.mjs', - format: 'esm', - name: 'svelte', - sourcemap: true, - } - ], + output: { + file: 'compiler.cjs', + format: is_publish ? 'umd' : 'cjs', + name: 'svelte', + sourcemap: false + }, external: is_publish ? [] - : (id) => - id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree') + : (id) => id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree') } ]; diff --git a/src/compiler/compile/Component.js b/src/compiler/compile/Component.js index 5a4b063651d8..ab6a9972cb42 100644 --- a/src/compiler/compile/Component.js +++ b/src/compiler/compile/Component.js @@ -28,6 +28,7 @@ import { extract_svelte_ignore_from_comments } from '../utils/extract_svelte_ignore.js'; import check_enable_sourcemap from './utils/check_enable_sourcemap.js'; +import { VERSION } from '../../shared/version.js'; const regex_leading_directory_separator = /^[/\\]/; const regex_starts_with_term_export = /^Export/; @@ -320,7 +321,7 @@ export default class Component { if (result) { const { compile_options, name } = this; const { format = 'esm' } = compile_options; - const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${'__VERSION__'}`; + const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${VERSION}`; /** @type {any} */ const program = { type: 'Program', body: result.js }; diff --git a/src/compiler/index.js b/src/compiler/index.js index 8222b4ad26d1..f21315aaa642 100644 --- a/src/compiler/index.js +++ b/src/compiler/index.js @@ -2,6 +2,4 @@ export { default as compile } from './compile/index.js'; export { default as parse } from './parse/index.js'; export { default as preprocess } from './preprocess/index.js'; export { walk } from 'estree-walker'; - -/** @type {string} */ -export const VERSION = '__VERSION__'; +export { VERSION } from '../shared/version.js'; diff --git a/src/runtime/internal/dev.js b/src/runtime/internal/dev.js index 11d081ae74ab..0a7d1eeb2b45 100644 --- a/src/runtime/internal/dev.js +++ b/src/runtime/internal/dev.js @@ -10,6 +10,7 @@ import { } from './dom.js'; import { SvelteComponent } from './Component.js'; import { is_void } from '../../shared/utils/names.js'; +import { VERSION } from '../../shared/version.js'; import { contenteditable_truthy_values } from './utils.js'; /** @@ -19,9 +20,7 @@ import { contenteditable_truthy_values } from './utils.js'; * @returns {void} */ export function dispatch_dev(type, detail) { - document.dispatchEvent( - custom_event(type, { version: '__VERSION__', ...detail }, { bubbles: true }) - ); + document.dispatchEvent(custom_event(type, { version: VERSION, ...detail }, { bubbles: true })); } /** diff --git a/test/js/js-output.test.js b/test/js/js-output.test.js index 3fd2b106cb34..4ec8521ff827 100644 --- a/test/js/js-output.test.js +++ b/test/js/js-output.test.js @@ -37,7 +37,10 @@ describe('js-output', () => { actual = svelte .compile(input, options) - .js.code.replace(/generated by Svelte v__VERSION__/, 'generated by Svelte vX.Y.Z'); + .js.code.replace( + /generated by Svelte v\d+\.\d+\.\d+(-\w+\.\d+)?/, + 'generated by Svelte vX.Y.Z' + ); } catch (err) { console.log(err.frame); throw err; From bec6ee11494441b41433ce59bfa44766d151c1fd Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Mon, 22 May 2023 17:45:14 +0200 Subject: [PATCH 03/12] remove cjs runtime output, fix bundling, remove publish distinction --- .gitignore | 14 +-- package.json | 24 ++-- rollup.config.js | 108 +++++------------- .../parse/read/css-tree-cq/css_tree_parse.js | 3 - src/runtime/internal/transitions.js | 10 +- 5 files changed, 48 insertions(+), 111 deletions(-) diff --git a/.gitignore b/.gitignore index e55888f18a4b..6b181e5f7ac2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,13 +9,13 @@ node_modules /compiler.*js /index.*js /ssr.*js -/action -/internal -/store -/easing -/motion -/transition -/animate +/action.d.ts +/internal.d.ts +/store.d.ts +/easing.d.ts +/motion.d.ts +/transition.d.ts +/animate.d.ts /scratch/ /test/*/samples/_ /test/runtime/shards diff --git a/package.json b/package.json index c5407080260c..76e45adf32aa 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,9 @@ ".": { "types": "./types/runtime/index.d.ts", "browser": { - "import": "./index.cjs", - "require": "./index.cjs" + "import": "./src/runtime/index.js" }, - "import": "./src/runtime/ssr.js", - "require": "./ssr.cjs" + "import": "./src/runtime/ssr.js" }, "./compiler": { "types": "./types/compiler/index.d.ts", @@ -42,36 +40,30 @@ }, "./animate": { "types": "./types/runtime/animate/index.d.ts", - "import": "./src/runtime/animate/index.js", - "require": "./animate/index.cjs" + "import": "./src/runtime/animate/index.js" }, "./easing": { "types": "./types/runtime/easing/index.d.ts", - "import": "./src/runtime/easing/index.js", - "require": "./easing/index.cjs" + "import": "./src/runtime/easing/index.js" }, "./internal": { "types": "./types/runtime/internal/index.d.ts", - "import": "./src/runtime/internal/index.js", - "require": "./internal/index.cjs" + "import": "./src/runtime/internal/index.js" }, "./motion": { "types": "./types/runtime/motion/index.d.ts", - "import": "./src/runtime/motion/index.js", - "require": "./motion/index.cjs" + "import": "./src/runtime/motion/index.js" }, "./register": { "require": "./register.js" }, "./store": { "types": "./types/runtime/store/index.d.ts", - "import": "./src/runtime/store/index.js", - "require": "./store/index.cjs" + "import": "./src/runtime/store/index.js" }, "./transition": { "types": "./types/runtime/transition/index.d.ts", - "import": "./src/runtime/transition/index.js", - "require": "./transition/index.cjs" + "import": "./src/runtime/transition/index.js" }, "./elements": { "types": "./elements/index.d.ts" diff --git a/rollup.config.js b/rollup.config.js index d5d4156eec39..3005572d2718 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,96 +4,43 @@ import replace from '@rollup/plugin-replace'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; -import sucrase from '@rollup/plugin-sucrase'; -import typescript from '@rollup/plugin-typescript'; const require = createRequire(import.meta.url); const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8')); -const is_publish = !!process.env.PUBLISH; - -const ts_plugin = is_publish - ? typescript({ - typescript: require('typescript'), - paths: { - 'svelte/*': ['./src/runtime/*'] - } - }) - : sucrase({ - transforms: ['typescript'] - }); - +// Create auto-generated .js files fs.writeFileSync( - './compiler.d.ts', - `export { compile, parse, preprocess, walk, VERSION } from './types/compiler/index.js';` + './src/shared/version.js', + `/** @type {string} */\nexport const VERSION = '${pkg.version}';` ); +const internal = await import('./src/runtime/internal/index.js'); fs.writeFileSync( - './src/shared/version.js', - `/** @type {string} */\nexport const VERSION = '${pkg.version}';` + 'src/compiler/compile/internal_exports.js', + `// This file is automatically generated\n` + + `export default new Set(${JSON.stringify(Object.keys(internal))});` ); -const runtime_entrypoints = Object.fromEntries( - fs - .readdirSync('src/runtime', { withFileTypes: true }) - .filter((dirent) => dirent.isDirectory()) - .map((dirent) => [dirent.name, `src/runtime/${dirent.name}/index.js`]) +// Generate d.ts files for runtime entrypoints so that TS can find it also without `"moduleResolution": "bundler"` +fs.readdirSync('src/runtime', { withFileTypes: true }) + .filter((dirent) => dirent.isDirectory()) + .forEach((dirent) => + fs.writeFileSync( + `${dirent.name}.d.ts`, + `export * from './types/runtime/${dirent.name}/index.js';` + ) + ); + +fs.writeFileSync( + './compiler.d.ts', + `export { compile, parse, preprocess, walk, VERSION } from './types/compiler/index.js';` ); /** * @type {import("rollup").RollupOptions[]} */ export default [ - // Runtime: Generates CJS builds and type definition entry points for svelte/* and generated internal_exports.js - { - input: { - ...runtime_entrypoints, - index: 'src/runtime/index.js', - ssr: 'src/runtime/ssr.js' - }, - output: { - entryFileNames: (entry) => { - if (entry.isEntry) { - if (entry.name === 'index') return `index.cjs`; - else if (entry.name === 'ssr') return `ssr.cjs`; - - return `${entry.name}/index.cjs`; - } - }, - chunkFileNames: `internal/[name]-[hash].cjs`, - format: 'cjs', - minifyInternalExports: false, - dir: '.' - }, - plugins: [ - ts_plugin, - { - writeBundle(_options, bundle) { - for (const entry of Object.values(bundle)) { - const dir = entry.name; - if (!entry.isEntry || !runtime_entrypoints[dir]) continue; - - if (dir === 'internal') { - const mod = bundle[`internal/index.cjs`]; - if (mod) { - fs.writeFileSync( - 'src/compiler/compile/internal_exports.js', - `// This file is automatically generated\n` + - `export default new Set(${JSON.stringify(mod.exports)});` - ); - } - } - - fs.writeFileSync( - `${dir}/index.d.ts`, - `export * from '../types/runtime/${dir}/index.js';` - ); - } - } - } - ] - }, - // Compiler: Generated CJS/UMD build for the compiler + // Generate UMD build of the compiler so that Eslint/Pretter (which need CJS) and REPL (which needs UMD because browser) can use it { input: 'src/compiler/index.js', plugins: [ @@ -110,23 +57,24 @@ export default [ if (id === 'util') { return require.resolve('./node_modules/util'); // just 'utils' would resolve this to the built-in module } + // Must import from the `css-tree` browser bundled distribution due to `createRequire` usage if importing from css-tree directly + if (id === 'css-tree') { + return require.resolve('./node_modules/css-tree/dist/csstree.esm.js'); + } } }, resolve(), commonjs({ include: ['node_modules/**'] }), - json(), - ts_plugin + json() ], output: { file: 'compiler.cjs', - format: is_publish ? 'umd' : 'cjs', + format: 'umd', name: 'svelte', sourcemap: false }, - external: is_publish - ? [] - : (id) => id === 'acorn' || id === 'magic-string' || id.startsWith('css-tree') + external: [] } ]; diff --git a/src/compiler/parse/read/css-tree-cq/css_tree_parse.js b/src/compiler/parse/read/css-tree-cq/css_tree_parse.js index 8f22fabe8d46..bacb4cc33433 100644 --- a/src/compiler/parse/read/css-tree-cq/css_tree_parse.js +++ b/src/compiler/parse/read/css-tree-cq/css_tree_parse.js @@ -1,7 +1,4 @@ // @ts-nocheck -// Note: Must import from the `css-tree` browser bundled distribution due to `createRequire` usage if importing from -// `css-tree` Node module directly. This allows the production build of Svelte to work correctly. -// import { fork } from '../../../../../node_modules/css-tree/dist/csstree.esm.js'; import { fork } from 'css-tree'; import * as node from './node/index.js'; diff --git a/src/runtime/internal/transitions.js b/src/runtime/internal/transitions.js index 9da6270be2c8..1c0711fc502e 100644 --- a/src/runtime/internal/transitions.js +++ b/src/runtime/internal/transitions.js @@ -1,9 +1,9 @@ import { identity as linear, is_function, noop, run_all } from './utils.js'; -import { now } from './environment'; -import { loop } from './loop'; -import { create_rule, delete_rule } from './style_manager'; -import { custom_event } from './dom'; -import { add_render_callback } from './scheduler'; +import { now } from './environment.js'; +import { loop } from './loop.js'; +import { create_rule, delete_rule } from './style_manager.js'; +import { custom_event } from './dom.js'; +import { add_render_callback } from './scheduler.js'; /** * @type {Promise | null} From c1b5aca1865572730353a58fb2b990f8d9fe96ee Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Mon, 22 May 2023 18:27:10 +0200 Subject: [PATCH 04/12] create index.d.ts, fix files field in package.json, move elements.d.ts to top --- .gitignore | 5 ++--- elements/index.d.ts => elements.d.ts | 0 elements/package.json | 3 --- package.json | 22 +++++++++++----------- rollup.config.js | 2 ++ 5 files changed, 15 insertions(+), 17 deletions(-) rename elements/index.d.ts => elements.d.ts (100%) delete mode 100644 elements/package.json diff --git a/.gitignore b/.gitignore index 6b181e5f7ac2..c2cac230a30b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,9 +6,8 @@ node_modules /src/compiler/compile/internal_exports.js /src/shared/version.js /compiler.d.ts -/compiler.*js -/index.*js -/ssr.*js +/compiler.cjs +/index.d.ts /action.d.ts /internal.d.ts /store.d.ts diff --git a/elements/index.d.ts b/elements.d.ts similarity index 100% rename from elements/index.d.ts rename to elements.d.ts diff --git a/elements/package.json b/elements/package.json deleted file mode 100644 index aab9cdce27a4..000000000000 --- a/elements/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "types": "./index.d.ts" -} diff --git a/package.json b/package.json index 76e45adf32aa..14e20aef7c0f 100644 --- a/package.json +++ b/package.json @@ -6,19 +6,19 @@ "module": "index.mjs", "main": "index", "files": [ + "src", "types", "compiler.*", "register.js", - "index.*", - "ssr.*", - "internal", - "store", - "animate", - "transition", - "easing", - "motion", - "action", - "elements", + "index.d.ts", + "internal.d.ts", + "store.d.ts", + "animate.d.ts", + "transition.d.ts", + "easing.d.ts", + "motion.d.ts", + "action.d.ts", + "elements.d.ts", "README.md" ], "exports": { @@ -66,7 +66,7 @@ "import": "./src/runtime/transition/index.js" }, "./elements": { - "types": "./elements/index.d.ts" + "types": "./elements.d.ts" } }, "engines": { diff --git a/rollup.config.js b/rollup.config.js index 3005572d2718..963eacfa3f04 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -31,6 +31,8 @@ fs.readdirSync('src/runtime', { withFileTypes: true }) ) ); +fs.writeFileSync('./index.d.ts', `export * from './types/runtime/index.js';`); + fs.writeFileSync( './compiler.d.ts', `export { compile, parse, preprocess, walk, VERSION } from './types/compiler/index.js';` From e1b67bde5f7d98d9de0ebd65afc6f8830bfcd8f0 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Tue, 23 May 2023 10:21:44 +0200 Subject: [PATCH 05/12] Update rollup.config.js Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> --- rollup.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 963eacfa3f04..05bd887298fd 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -42,7 +42,7 @@ fs.writeFileSync( * @type {import("rollup").RollupOptions[]} */ export default [ - // Generate UMD build of the compiler so that Eslint/Pretter (which need CJS) and REPL (which needs UMD because browser) can use it + // Generate UMD build of the compiler so that Eslint/Prettier (which need CJS) and REPL (which needs UMD because browser) can use it { input: 'src/compiler/index.js', plugins: [ From c8f98b59b06172d65a34d4c29d95559797e6ca38 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 23 May 2023 13:22:22 -0700 Subject: [PATCH 06/12] fix merge and address comment --- package.json | 11 +---------- pnpm-lock.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index ae3e5d9393d8..f8792d30b705 100644 --- a/package.json +++ b/package.json @@ -138,30 +138,21 @@ "@types/mocha": "^10.0.1", "@types/node": "^14.14.31", "@typescript-eslint/eslint-plugin": "^5.58.0", - "acorn": "^8.8.2", "agadoo": "^3.0.0", - "aria-query": "^5.1.3", - "axobject-query": "^3.1.1", - "code-red": "^1.0.0", - "css-tree": "^2.3.1", "esbuild": "^0.17.19", "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-svelte": "^2.28.0", "eslint-plugin-unicorn": "^47.0.0", - "estree-walker": "^3.0.3", "happy-dom": "^9.18.3", - "is-reference": "^3.0.1", "jsdom": "^21.1.1", "kleur": "^4.1.5", - "locate-character": "^2.0.5", - "magic-string": "^0.30.0", - "periscopic": "^3.1.0", "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.0", "rollup": "^3.20.2", "rollup-plugin-dts": "^5.3.0", + "source-map": "^0.7.4", "tiny-glob": "^0.2.9", "tslib": "^2.5.0", "typescript": "^5.0.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbac17253787..b2258d05edc0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -125,6 +125,9 @@ importers: rollup-plugin-dts: specifier: ^5.3.0 version: 5.3.0(rollup@3.20.2)(typescript@5.0.4) + source-map: + specifier: ^0.7.4 + version: 0.7.4 tiny-glob: specifier: ^0.2.9 version: 0.2.9 @@ -5254,6 +5257,11 @@ packages: dev: true optional: true + /source-map@0.7.4: + resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} + engines: {node: '>= 8'} + dev: true + /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: From dbf29ebad7e80fcea4acff9aa1a6364a110ba2fd Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 23 May 2023 13:25:52 -0700 Subject: [PATCH 07/12] fix merge --- rollup.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index bde62fbfeb65..564467139d8b 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -129,7 +129,7 @@ export default [ }, // compiler.js - UMD version for REPL { - input: 'src/compiler/index.ts', + input: 'src/compiler/index.js', plugins: [ replace({ preventAssignment: true, From e1f6676830262f41449d79c648f763af29893306 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 23 May 2023 13:38:45 -0700 Subject: [PATCH 08/12] fix --- rollup.config.mjs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rollup.config.mjs b/rollup.config.mjs index 564467139d8b..4dcfa86b325d 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -111,6 +111,16 @@ export default [ __VERSION__: pkg.version }, }), + { + resolveId(id) { + // util is a built-in module in Node.js, but we want a self-contained compiler bundle + // that also works in the browser, so we load its polyfill instead + // we don't use util directly, but some packages include it transitively + if (id === 'util') { + return require.resolve('./node_modules/util'); // just 'utils' would resolve this to the built-in module + } + }, + }, resolve(), commonjs({ include: ['node_modules/**'] @@ -137,6 +147,16 @@ export default [ __VERSION__: pkg.version }, }), + { + resolveId(id) { + // util is a built-in module in Node.js, but we want a self-contained compiler bundle + // that also works in the browser, so we load its polyfill instead + // we don't use util directly, but some packages include it transitively + if (id === 'util') { + return require.resolve('./node_modules/util'); // just 'utils' would resolve this to the built-in module + } + }, + }, resolve(), commonjs({ include: ['node_modules/**'] From 2c738b084784e2787144e96311befa750f38f70f Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 23 May 2023 13:41:18 -0700 Subject: [PATCH 09/12] fix --- rollup.config.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 4dcfa86b325d..43cd5e42cf5d 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -108,7 +108,8 @@ export default [ replace({ preventAssignment: true, values: { - __VERSION__: pkg.version + __VERSION__: pkg.version, + 'process.env.NODE_DEBUG': false // appears inside the util package }, }), { @@ -144,7 +145,8 @@ export default [ replace({ preventAssignment: true, values: { - __VERSION__: pkg.version + __VERSION__: pkg.version, + 'process.env.NODE_DEBUG': false // appears inside the util package }, }), { From 35ea95bb725cf5b756d6e67360ecef0f7e7b4073 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 24 May 2023 14:51:25 +0200 Subject: [PATCH 10/12] remove cjs and register hook --- CHANGELOG.md | 1 + package.json | 7 +- register.js | 56 -------- site/content/docs/04-run-time.md | 2 + site/content/docs/05-compile-time.md | 2 - src/compiler/compile/Component.js | 2 - src/compiler/compile/create_module.js | 131 +------------------ src/compiler/interfaces.d.ts | 3 - src/compiler/public.d.ts | 2 +- test/compiler-errors/compiler-errors.test.js | 1 - test/js/samples/export-from-cjs/_config.js | 6 - test/js/samples/export-from-cjs/expected.js | 36 ----- test/js/samples/export-from-cjs/input.svelte | 11 -- 13 files changed, 9 insertions(+), 251 deletions(-) delete mode 100644 register.js delete mode 100644 test/js/samples/export-from-cjs/_config.js delete mode 100644 test/js/samples/export-from-cjs/expected.js delete mode 100644 test/js/samples/export-from-cjs/input.svelte diff --git a/CHANGELOG.md b/CHANGELOG.md index 3607060b43df..cbafadc80703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * **breaking** Bundlers must specify the `browser` condition when building a frontend bundle for the browser ([#8516](https://github.com/sveltejs/svelte/pull/8516)) * **breaking** Minimum supported vite-plugin-svelte version is now 2.1.1. SvelteKit users can upgrade to 1.15.9 or newer to ensure a compatible version ([#8516](https://github.com/sveltejs/svelte/pull/8516)) * **breaking** Minimum supported TypeScript version is now TypeScript 5 (it will likely work with lower versions, but we make no guarantees about that) ([#8488](https://github.com/sveltejs/svelte/pull/8488)) +* **breaking** Remove `svelte/register` hook, CJS runtime version and CJS compiler output ([#8613](https://github.com/sveltejs/svelte/pull/8613)) * **breaking** Stricter types for `createEventDispatcher` (see PR for migration instructions) ([#7224](https://github.com/sveltejs/svelte/pull/7224)) * **breaking** Stricter types for `Action` and `ActionReturn` (see PR for migration instructions) ([#7224](https://github.com/sveltejs/svelte/pull/7224)) * **breaking** Stricter types for `onMount` - now throws a type error when returning a function asynchronously to catch potential mistakes around callback functions (see PR for migration instructions) ([#8136](https://github.com/sveltejs/svelte/pull/8136)) diff --git a/package.json b/package.json index c0e8b2cb545c..f5f335c87df9 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "4.0.0-next.0", "description": "Cybernetically enhanced web apps", "type": "module", - "module": "index.mjs", - "main": "index", + "module": "src/runtime/index.js", + "main": "src/runtime/index.js", "files": [ "src", "types", @@ -54,9 +54,6 @@ "types": "./types/runtime/motion/index.d.ts", "import": "./src/runtime/motion/index.js" }, - "./register": { - "require": "./register.js" - }, "./store": { "types": "./types/runtime/store/index.d.ts", "import": "./src/runtime/store/index.js" diff --git a/register.js b/register.js deleted file mode 100644 index 25f8aa430974..000000000000 --- a/register.js +++ /dev/null @@ -1,56 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const { compile } = require('./compiler.js'); - -const extensions = ['.svelte', '.html']; -let compileOptions = {}; - -function capitalise(name) { - return name[0].toUpperCase() + name.slice(1); -} - -function register(options = {}) { - if (options.extensions) { - extensions.forEach(deregisterExtension); - options.extensions.forEach(registerExtension); - } - - compileOptions = Object.assign({}, options); - delete compileOptions.extensions; -} - -function deregisterExtension(extension) { - delete require.extensions[extension]; -} - -function registerExtension(extension) { - require.extensions[extension] = function(module, filename) { - const name = path.parse(filename).name - .replace(/^\d/, '_$&') - .replace(/[^a-zA-Z0-9_$]/g, ''); - - const options = Object.assign({}, compileOptions, { - filename, - name: capitalise(name), - generate: 'ssr', - format: 'cjs' - }); - - const { js, warnings } = compile(fs.readFileSync(filename, 'utf-8'), options); - - if (options.dev) { - warnings.forEach(warning => { - console.warn(`\nSvelte Warning in ${warning.filename}:`); - console.warn(warning.message); - console.warn(warning.frame); - }) - } - - return module._compile(js.code, filename); - }; -} - -registerExtension('.svelte'); -registerExtension('.html'); - -module.exports = register; diff --git a/site/content/docs/04-run-time.md b/site/content/docs/04-run-time.md index 863d842853a1..3b9097ae7464 100644 --- a/site/content/docs/04-run-time.md +++ b/site/content/docs/04-run-time.md @@ -985,6 +985,8 @@ You can explore the various eases using the [ease visualiser](/examples/easing) ### `svelte/register` +> This API is removed in Svelte 4. `require` hooks are deprecated and current Node versions understand ESM. Use a bundler like Vite or our full-stack framework [SvelteKit](https://kit.svelte.dev) instead to create JavaScript modules from Svelte components. + To render Svelte components in Node.js without bundling, use `require('svelte/register')`. After that, you can use `require` to include any `.svelte` file. ```js diff --git a/site/content/docs/05-compile-time.md b/site/content/docs/05-compile-time.md index bdd1de243e10..92702b0e64c1 100644 --- a/site/content/docs/05-compile-time.md +++ b/site/content/docs/05-compile-time.md @@ -39,7 +39,6 @@ The following options can be passed to the compiler. None are required: | --- | --- | --- | | `filename` | string | `null` | `name` | string | `"Component"` -| `format` | `"esm"` or `"cjs"` | `"esm"` | `generate` | `"dom"` or `"ssr"` or `false` | `"dom"` | `errorMode` | `"throw"` or `"warn"` | `"throw"` | `varsReport` | `"strict"` or `"full"` or `false` | `"strict"` @@ -62,7 +61,6 @@ The following options can be passed to the compiler. None are required: | --- | --- | --- | | `filename` | `null` | `string` used for debugging hints and sourcemaps. Your bundler plugin will set it automatically. | `name` | `"Component"` | `string` that sets the name of the resulting JavaScript class (though the compiler will rename it if it would otherwise conflict with other variables in scope). It will normally be inferred from `filename`. -| `format` | `"esm"` | If `"esm"`, creates a JavaScript module (with `import` and `export`). If `"cjs"`, creates a CommonJS module (with `require` and `module.exports`), which is useful in some server-side rendering situations or for testing. | `generate` | `"dom"` | If `"dom"`, Svelte emits a JavaScript class for mounting to the DOM. If `"ssr"`, Svelte emits an object with a `render` method suitable for server-side rendering. If `false`, no JavaScript or CSS is returned; just metadata. | `errorMode` | `"throw"` | If `"throw"`, Svelte throws when a compilation error occurred. If `"warn"`, Svelte will treat errors as warnings and add them to the warning report. | `varsReport` | `"strict"` | If `"strict"`, Svelte returns a variables report with only variables that are not globals nor internals. If `"full"`, Svelte returns a variables report with all detected variables. If `false`, no variables report is returned. diff --git a/src/compiler/compile/Component.js b/src/compiler/compile/Component.js index ab6a9972cb42..7d3615bb8294 100644 --- a/src/compiler/compile/Component.js +++ b/src/compiler/compile/Component.js @@ -320,7 +320,6 @@ export default class Component { let css = null; if (result) { const { compile_options, name } = this; - const { format = 'esm' } = compile_options; const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${VERSION}`; /** @type {any} */ @@ -388,7 +387,6 @@ export default class Component { ); create_module( program, - format, name, banner, compile_options.sveltePath, diff --git a/src/compiler/compile/create_module.js b/src/compiler/compile/create_module.js index 6cb8a8005be8..2fcad4778fd3 100644 --- a/src/compiler/compile/create_module.js +++ b/src/compiler/compile/create_module.js @@ -1,10 +1,7 @@ -import list from '../utils/list.js'; -import { b, x } from 'code-red'; -const wrappers = { esm, cjs }; +import { b } from 'code-red'; /** * @param {any} program - * @param {import('../interfaces.js').ModuleFormat} format * @param {import('estree').Identifier} name * @param {string} banner * @param {any} sveltePath @@ -16,7 +13,6 @@ const wrappers = { esm, cjs }; */ export default function create_module( program, - format, name, banner, sveltePath = 'svelte', @@ -39,11 +35,7 @@ export default function create_module( * @param {any} b */ (a, b) => (a.name < b.name ? -1 : 1) ); - const formatter = wrappers[format]; - if (!formatter) { - throw new Error(`options.format is invalid (must be ${list(Object.keys(wrappers))})`); - } - return formatter( + return esm( program, name, banner, @@ -174,124 +166,7 @@ function esm( } /** - * @param {any} program - * @param {import('estree').Identifier} name - * @param {string} banner - * @param {string} sveltePath - * @param {string} internal_path - * @param {Array<{ name: string; alias: import('estree').Identifier }>} helpers - * @param {Array<{ name: string; alias: import('estree').Identifier }>} globals - * @param {import('estree').ImportDeclaration[]} imports - * @param {Export[]} module_exports - * @param {import('estree').ExportNamedDeclaration[]} exports_from - */ -function cjs( - program, - name, - banner, - sveltePath, - internal_path, - helpers, - globals, - imports, - module_exports, - exports_from -) { - const internal_requires = { - type: 'VariableDeclaration', - kind: 'const', - declarations: [ - { - type: 'VariableDeclarator', - id: { - type: 'ObjectPattern', - properties: helpers.map( - /** @param {any} h */ (h) => ({ - type: 'Property', - method: false, - shorthand: false, - computed: false, - key: { type: 'Identifier', name: h.name }, - value: h.alias, - kind: 'init' - }) - ) - }, - init: x`require("${internal_path}")` - } - ] - }; - const internal_globals = get_internal_globals(globals, helpers); - const user_requires = imports.map( - /** @param {any} node */ (node) => { - const init = x`require("${edit_source(node.source.value, sveltePath)}")`; - if (node.specifiers.length === 0) { - return b`${init};`; - } - return { - type: 'VariableDeclaration', - kind: 'const', - declarations: [ - { - type: 'VariableDeclarator', - id: - node.specifiers[0].type === 'ImportNamespaceSpecifier' - ? { type: 'Identifier', name: node.specifiers[0].local.name } - : { - type: 'ObjectPattern', - properties: node.specifiers.map( - /** @param {any} s */ (s) => ({ - type: 'Property', - method: false, - shorthand: false, - computed: false, - key: - s.type === 'ImportSpecifier' - ? s.imported - : { type: 'Identifier', name: 'default' }, - value: s.local, - kind: 'init' - }) - ) - }, - init - } - ] - }; - } - ); - const exports = module_exports.map( - /** @param {any} x */ - (x) => - b`exports.${{ type: 'Identifier', name: x.as }} = ${{ type: 'Identifier', name: x.name }};` - ); - const user_exports_from = exports_from.map( - /** @param {any} node */ (node) => { - const init = x`require("${edit_source(node.source.value, sveltePath)}")`; - return node.specifiers.map( - /** @param {any} specifier */ (specifier) => { - return b`exports.${specifier.exported} = ${init}.${specifier.local};`; - } - ); - } - ); - program.body = b` - /* ${banner} */ - - "use strict"; - ${internal_requires} - ${internal_globals} - ${user_requires} - ${user_exports_from} - - ${program.body} - - exports.default = ${name}; - ${exports} - `; -} - -/** @typedef {Object} Export + * @typedef {Object} Export * @property {string} name * @property {string} as */ diff --git a/src/compiler/interfaces.d.ts b/src/compiler/interfaces.d.ts index 92638472896c..52fd7231701e 100644 --- a/src/compiler/interfaces.d.ts +++ b/src/compiler/interfaces.d.ts @@ -159,8 +159,6 @@ export interface Warning { toString: () => string; } -export type ModuleFormat = 'esm' | 'cjs'; - export type EnableSourcemap = boolean | { js: boolean; css: boolean }; export type CssHashGetter = (args: { @@ -171,7 +169,6 @@ export type CssHashGetter = (args: { }) => string; export interface CompileOptions { - format?: ModuleFormat; name?: string; filename?: string; generate?: 'dom' | 'ssr' | false; diff --git a/src/compiler/public.d.ts b/src/compiler/public.d.ts index 9462daddae51..f566a06e6171 100644 --- a/src/compiler/public.d.ts +++ b/src/compiler/public.d.ts @@ -1,2 +1,2 @@ -export type { CompileOptions, ModuleFormat, EnableSourcemap, CssHashGetter } from './interfaces'; +export type { CompileOptions, EnableSourcemap, CssHashGetter } from './interfaces'; export type * from './preprocess/public.js'; diff --git a/test/compiler-errors/compiler-errors.test.js b/test/compiler-errors/compiler-errors.test.js index 4833ebf92a1d..065e9cc01dee 100644 --- a/test/compiler-errors/compiler-errors.test.js +++ b/test/compiler-errors/compiler-errors.test.js @@ -21,7 +21,6 @@ describe('compiler-errors', () => { const cwd = path.resolve(`${__dirname}/samples/${dir}`); const compileOptions = Object.assign({}, config.compileOptions || {}, { - format: 'cjs', immutable: config.immutable, accessors: 'accessors' in config ? config.accessors : true, generate: 'dom' diff --git a/test/js/samples/export-from-cjs/_config.js b/test/js/samples/export-from-cjs/_config.js deleted file mode 100644 index 2506f1d5fc15..000000000000 --- a/test/js/samples/export-from-cjs/_config.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - options: { - accessors: true, - format: 'cjs' - } -}; diff --git a/test/js/samples/export-from-cjs/expected.js b/test/js/samples/export-from-cjs/expected.js deleted file mode 100644 index d40f986635bc..000000000000 --- a/test/js/samples/export-from-cjs/expected.js +++ /dev/null @@ -1,36 +0,0 @@ -/* generated by Svelte vX.Y.Z */ -"use strict"; - -const { SvelteComponent, init, safe_not_equal } = require("svelte/internal"); -const { f: f_1, g: g_1 } = require("./d"); -const { h: h_1 } = require("./e"); -const { i: j } = require("./f"); -exports.e = require("./c").d; -exports.c = require("./b").c; -exports.a = require("./a").a; -exports.b = require("./a").b; - -class Component extends SvelteComponent { - constructor(options) { - super(); - init(this, options, null, null, safe_not_equal, {}); - } - - get f() { - return f_1; - } - - get g() { - return g_1; - } - - get h() { - return h_1; - } - - get j() { - return j; - } -} - -exports.default = Component; \ No newline at end of file diff --git a/test/js/samples/export-from-cjs/input.svelte b/test/js/samples/export-from-cjs/input.svelte deleted file mode 100644 index 66957806a285..000000000000 --- a/test/js/samples/export-from-cjs/input.svelte +++ /dev/null @@ -1,11 +0,0 @@ - - - From 6aa3e4657f16d576451d63d65bff530ad8f156db Mon Sep 17 00:00:00 2001 From: gtmnayan <50981692+gtm-nayan@users.noreply.github.com> Date: Wed, 24 May 2023 18:38:45 +0545 Subject: [PATCH 11/12] chore: prune some more dependencies (#8627) --- package.json | 7 --- pnpm-lock.yaml | 143 +------------------------------------------------ 2 files changed, 2 insertions(+), 148 deletions(-) diff --git a/package.json b/package.json index f5f335c87df9..0d32d7d3a43a 100644 --- a/package.json +++ b/package.json @@ -118,19 +118,14 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.2", "@rollup/plugin-replace": "^5.0.2", - "@rollup/plugin-sucrase": "^5.0.1", - "@rollup/plugin-typescript": "^11.1.0", - "@rollup/plugin-virtual": "^3.0.1", "@sveltejs/eslint-config": "^6.0.1", "@types/aria-query": "^5.0.1", "@types/estree": "^1.0.0", - "@types/mocha": "^10.0.1", "@types/node": "^14.14.31", "@typescript-eslint/eslint-plugin": "^5.58.0", "agadoo": "^3.0.0", "esbuild": "^0.17.19", "eslint": "^8.40.0", - "eslint-config-prettier": "^8.8.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-svelte": "^2.28.0", "eslint-plugin-unicorn": "^47.0.0", @@ -140,10 +135,8 @@ "prettier": "^2.8.8", "prettier-plugin-svelte": "^2.10.0", "rollup": "^3.20.2", - "rollup-plugin-dts": "^5.3.0", "source-map": "^0.7.4", "tiny-glob": "^0.2.9", - "tslib": "^2.5.0", "typescript": "^5.0.4", "util": "^0.12.5", "vitest": "^0.31.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b2258d05edc0..36df0e515c09 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,15 +56,6 @@ importers: '@rollup/plugin-replace': specifier: ^5.0.2 version: 5.0.2(rollup@3.20.2) - '@rollup/plugin-sucrase': - specifier: ^5.0.1 - version: 5.0.1(rollup@3.20.2) - '@rollup/plugin-typescript': - specifier: ^11.1.0 - version: 11.1.0(rollup@3.20.2)(tslib@2.5.0)(typescript@5.0.4) - '@rollup/plugin-virtual': - specifier: ^3.0.1 - version: 3.0.1(rollup@3.20.2) '@sveltejs/eslint-config': specifier: ^6.0.1 version: 6.0.1(@typescript-eslint/eslint-plugin@5.58.0)(@typescript-eslint/parser@5.58.0)(eslint-config-prettier@8.8.0)(eslint-plugin-import@2.27.5)(eslint-plugin-node@11.1.0)(eslint-plugin-svelte@2.28.0)(eslint-plugin-unicorn@47.0.0)(eslint@8.40.0)(typescript@5.0.4) @@ -74,9 +65,6 @@ importers: '@types/estree': specifier: ^1.0.0 version: 1.0.0 - '@types/mocha': - specifier: ^10.0.1 - version: 10.0.1 '@types/node': specifier: ^14.14.31 version: 14.14.31 @@ -92,9 +80,6 @@ importers: eslint: specifier: ^8.40.0 version: 8.40.0 - eslint-config-prettier: - specifier: ^8.8.0 - version: 8.8.0(eslint@8.40.0) eslint-plugin-import: specifier: ^2.27.5 version: 2.27.5(@typescript-eslint/parser@5.58.0)(eslint@8.40.0) @@ -122,18 +107,12 @@ importers: rollup: specifier: ^3.20.2 version: 3.20.2 - rollup-plugin-dts: - specifier: ^5.3.0 - version: 5.3.0(rollup@3.20.2)(typescript@5.0.4) source-map: specifier: ^0.7.4 version: 0.7.4 tiny-glob: specifier: ^0.2.9 version: 0.2.9 - tslib: - specifier: ^2.5.0 - version: 2.5.0 typescript: specifier: ^5.0.4 version: 5.0.4 @@ -993,6 +972,7 @@ packages: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/trace-mapping': 0.3.18 + dev: false /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} @@ -1001,6 +981,7 @@ packages: /@jridgewell/set-array@1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} + dev: false /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} @@ -1368,40 +1349,6 @@ packages: rollup: 3.20.2 dev: true - /@rollup/plugin-sucrase@5.0.1(rollup@3.20.2): - resolution: {integrity: sha512-3mYe28rR/sUTkV8v10yPCP55TQ/oJkvcxKZBj6NGx9ZfCn9BdBtBL1v1S0TQrcOV4WD3FTHJaI7TbbukALx9wA==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.53.1||^3.0.0 - peerDependenciesMeta: - rollup: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - rollup: 3.20.2 - sucrase: 3.32.0 - dev: true - - /@rollup/plugin-typescript@11.1.0(rollup@3.20.2)(tslib@2.5.0)(typescript@5.0.4): - resolution: {integrity: sha512-86flrfE+bSHB69znnTV6kVjkncs2LBMhcTCyxWgRxLyfXfQrxg4UwlAqENnjrrxnSNS/XKCDJCl8EkdFJVHOxw==} - engines: {node: '>=14.0.0'} - peerDependencies: - rollup: ^2.14.0||^3.0.0 - tslib: '*' - typescript: '>=3.7.0' - peerDependenciesMeta: - rollup: - optional: true - tslib: - optional: true - dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.2) - resolve: 1.22.2 - rollup: 3.20.2 - tslib: 2.5.0 - typescript: 5.0.4 - dev: true - /@rollup/plugin-virtual@3.0.1(rollup@3.20.2): resolution: {integrity: sha512-fK8O0IL5+q+GrsMLuACVNk2x21g3yaw+sG2qn16SnUd3IlBsQyvWxLMGHmCmXRMecPjGRSZ/1LmZB4rjQm68og==} engines: {node: '>=14.0.0'} @@ -1715,10 +1662,6 @@ packages: resolution: {integrity: sha512-zK4gSFMjgslsv5Lyvr3O1yCjgmnE4pr8jbG8qVn4QglMwtpvPCf4YT2Wma7Nk95OxUUJI8Z+kzdXohbM7mVpGw==} dev: true - /@types/mocha@10.0.1: - resolution: {integrity: sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==} - dev: true - /@types/node@14.14.31: resolution: {integrity: sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==} dev: true @@ -2064,10 +2007,6 @@ packages: resolution: {integrity: sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==} dev: true - /any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - dev: true - /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} @@ -2420,11 +2359,6 @@ packages: delayed-stream: 1.0.0 dev: true - /commander@4.1.1: - resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} - engines: {node: '>= 6'} - dev: true - /commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} dev: true @@ -3441,17 +3375,6 @@ packages: is-glob: 4.0.3 dev: true - /glob@7.1.6: - resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: @@ -4299,14 +4222,6 @@ packages: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: true - /mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - dev: true - /nanoid@3.3.6: resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -4648,11 +4563,6 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - /pirates@4.0.5: - resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} - engines: {node: '>= 6'} - dev: true - /pixelmatch@4.0.2: resolution: {integrity: sha512-J8B6xqiO37sU/gkcMglv6h5Jbd9xNER7aHzpfRdNmV4IbQBzBpe4l9XmbG+xPF/znacgu2jfEw+wHffaq/YkXA==} hasBin: true @@ -4958,20 +4868,6 @@ packages: glob: 7.2.3 dev: true - /rollup-plugin-dts@5.3.0(rollup@3.20.2)(typescript@5.0.4): - resolution: {integrity: sha512-8FXp0ZkyZj1iU5klkIJYLjIq/YZSwBoERu33QBDxm/1yw5UU4txrEtcmMkrq+ZiKu3Q4qvPCNqc3ovX6rjqzbQ==} - engines: {node: '>=v14'} - peerDependencies: - rollup: ^3.0.0 - typescript: ^4.1 || ^5.0 - dependencies: - magic-string: 0.30.0 - rollup: 3.20.2 - typescript: 5.0.4 - optionalDependencies: - '@babel/code-frame': 7.21.4 - dev: true - /rollup-plugin-dts@5.3.0(rollup@3.23.0)(typescript@5.0.4): resolution: {integrity: sha512-8FXp0ZkyZj1iU5klkIJYLjIq/YZSwBoERu33QBDxm/1yw5UU4txrEtcmMkrq+ZiKu3Q4qvPCNqc3ovX6rjqzbQ==} engines: {node: '>=v14'} @@ -5394,20 +5290,6 @@ packages: resolution: {integrity: sha512-78Jv8kYJdjbvRwwijtCevYADfsI0lGzYJe4mMFdceO8l75DFFDoqBhR1jVDicDRRaX4//g1u9wKeo+ztc2h1Rw==} dev: false - /sucrase@3.32.0: - resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} - engines: {node: '>=8'} - hasBin: true - dependencies: - '@jridgewell/gen-mapping': 0.3.3 - commander: 4.1.1 - glob: 7.1.6 - lines-and-columns: 1.2.4 - mz: 2.7.0 - pirates: 4.0.5 - ts-interface-checker: 0.1.13 - dev: true - /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -5583,19 +5465,6 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} - dependencies: - thenify: 3.3.1 - dev: true - - /thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - dependencies: - any-promise: 1.3.0 - dev: true - /time-zone@1.0.0: resolution: {integrity: sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==} engines: {node: '>=4'} @@ -5671,10 +5540,6 @@ packages: punycode: 2.3.0 dev: true - /ts-interface-checker@0.1.13: - resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - dev: true - /ts-morph@18.0.0: resolution: {integrity: sha512-Kg5u0mk19PIIe4islUI/HWRvm9bC1lHejK4S0oh1zaZ77TMZAEmQC0sHQYiu2RgCQFZKXz1fMVi/7nOOeirznA==} dependencies: @@ -5695,10 +5560,6 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true - /tslib@2.5.0: - resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} - dev: true - /tsutils@3.21.0(typescript@5.0.4): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} From eaef8f170454dc60004cf211ea280c4c8809c6dd Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 24 May 2023 15:16:41 +0200 Subject: [PATCH 12/12] cleanup --- check_publish_env.js | 4 ---- generate-types.mjs => generate-types.js | 0 package.json | 6 +++--- scripts/{globals-extractor.mjs => globals-extractor.js} | 4 ++-- src/compiler/utils/globals.js | 4 ++-- 5 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 check_publish_env.js rename generate-types.mjs => generate-types.js (100%) rename scripts/{globals-extractor.mjs => globals-extractor.js} (97%) diff --git a/check_publish_env.js b/check_publish_env.js deleted file mode 100644 index ce6f066cff34..000000000000 --- a/check_publish_env.js +++ /dev/null @@ -1,4 +0,0 @@ -if (!process.env.PUBLISH) { - console.error('npm publish must be run with the PUBLISH environment variable set'); - process.exit(1); -} diff --git a/generate-types.mjs b/generate-types.js similarity index 100% rename from generate-types.mjs rename to generate-types.js diff --git a/package.json b/package.json index f5f335c87df9..f97360642bfc 100644 --- a/package.json +++ b/package.json @@ -77,9 +77,9 @@ "build": "rollup -c && npm run tsd", "prepare": "npm run build", "dev": "rollup -cw", - "posttest": "agadoo internal/index.mjs", - "prepublishOnly": "node check_publish_env.js && npm run lint && npm run build && npm test", - "tsd": "node ./generate-types.mjs", + "posttest": "agadoo src/internal/index.js", + "prepublishOnly": "npm run lint && npm run build && npm test", + "tsd": "node ./generate-types.js", "lint": "eslint \"{src,test}/**/*.{ts,js}\" --cache" }, "repository": { diff --git a/scripts/globals-extractor.mjs b/scripts/globals-extractor.js similarity index 97% rename from scripts/globals-extractor.mjs rename to scripts/globals-extractor.js index b9706dfb92bd..13f1c87f9aaa 100644 --- a/scripts/globals-extractor.mjs +++ b/scripts/globals-extractor.js @@ -1,7 +1,7 @@ /** ---------------------------------------------------------------------- This script gets a list of global objects/functions of browser. This process is simple for now, so it is handled without AST parser. -Please run `node scripts/globals-extractor.mjs` at the project root. +Please run `node scripts/globals-extractor.js` at the project root. see: https://github.com/microsoft/TypeScript/tree/main/lib ---------------------------------------------------------------------- */ @@ -68,7 +68,7 @@ const build_output = (functions) => { const sorted = Array.from(new Set(functions.sort())); return `\ /** ---------------------------------------------------------------------- -This file is automatically generated by \`scripts/globals-extractor.mjs\`. +This file is automatically generated by \`scripts/globals-extractor.js\`. Generated At: ${new Date().toISOString()} ---------------------------------------------------------------------- */ diff --git a/src/compiler/utils/globals.js b/src/compiler/utils/globals.js index 020a0738e129..0d6d0642f94a 100644 --- a/src/compiler/utils/globals.js +++ b/src/compiler/utils/globals.js @@ -1,6 +1,6 @@ /** ---------------------------------------------------------------------- -This file is automatically generated by `scripts/globals-extractor.mjs`. -Generated At: 2023-05-11T15:31:28.406Z +This file is automatically generated by `scripts/globals-extractor.js`. +Generated At: 2023-05-24T13:16:20.777Z ---------------------------------------------------------------------- */ export default new Set([