diff --git a/packages/vite/LICENSE.md b/packages/vite/LICENSE.md index 0b855362539b74..331d46b8c462f5 100644 --- a/packages/vite/LICENSE.md +++ b/packages/vite/LICENSE.md @@ -547,87 +547,6 @@ Repository: https://github.com/acornjs/acorn.git --------------------------------------- -## acorn-class-fields -License: MIT -By: Adrian Heine -Repository: https://github.com/acornjs/acorn-class-fields - -> Copyright (C) 2017-2018 by Adrian Heine -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - -## acorn-private-class-elements -License: MIT -By: Adrian Heine -Repository: https://github.com/acornjs/acorn-private-class-elements - -> Copyright (C) 2017-2018 by Adrian Heine -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - -## acorn-static-class-features -License: MIT -By: Adrian Heine -Repository: https://github.com/acornjs/acorn-static-class-features - -> Copyright (C) 2017-2018 by Adrian Heine -> -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. - ---------------------------------------- - ## ansi-regex License: MIT By: Sindre Sorhus diff --git a/packages/vite/package.json b/packages/vite/package.json index 1862ea73d0b61d..f0e843cdf18d62 100644 --- a/packages/vite/package.json +++ b/packages/vite/package.json @@ -76,9 +76,7 @@ "@types/stylus": "^0.48.36", "@types/ws": "^8.2.2", "@vue/compiler-dom": "^3.2.26", - "acorn": "^8.6.0", - "acorn-class-fields": "^1.0.0", - "acorn-static-class-features": "^1.0.0", + "acorn": "^8.7.0", "cac": "6.7.9", "chalk": "^4.1.2", "chokidar": "^3.5.2", diff --git a/packages/vite/src/node/server/pluginContainer.ts b/packages/vite/src/node/server/pluginContainer.ts index a0a3cc18d7dabe..37990f3996d67b 100644 --- a/packages/vite/src/node/server/pluginContainer.ts +++ b/packages/vite/src/node/server/pluginContainer.ts @@ -49,8 +49,6 @@ import type { TransformResult } from 'rollup' import * as acorn from 'acorn' -import acornClassFields from 'acorn-class-fields' -import acornStaticClassFeatures from 'acorn-static-class-features' import type { RawSourceMap } from '@ampproject/remapping/dist/types/types' import { combineSourcemaps } from '../utils' import MagicString from 'magic-string' @@ -124,10 +122,7 @@ type PluginContext = Omit< | 'load' > -export let parser = acorn.Parser.extend( - acornClassFields, - acornStaticClassFeatures -) +export let parser = acorn.Parser export async function createPluginContainer( { plugins, logger, root, build: { rollupOptions } }: ResolvedConfig, @@ -439,11 +434,7 @@ export async function createPluginContainer( (await plugin.options.call(minimalContext, options)) || options } if (options.acornInjectPlugins) { - parser = acorn.Parser.extend( - ...[acornClassFields, acornStaticClassFeatures].concat( - options.acornInjectPlugins - ) - ) + parser = acorn.Parser.extend(options.acornInjectPlugins as any) } return { acorn, diff --git a/packages/vite/types/shims.d.ts b/packages/vite/types/shims.d.ts index 7bff6f2263e623..9c2905cfb76dec 100644 --- a/packages/vite/types/shims.d.ts +++ b/packages/vite/types/shims.d.ts @@ -17,16 +17,6 @@ declare module 'http-proxy' { export = proxy } -declare module 'acorn-class-fields' { - const plugin: any - export = plugin -} - -declare module 'acorn-static-class-features' { - const plugin: any - export default plugin -} - declare module 'connect-history-api-fallback' { const plugin: any export = plugin diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3c6e8512af67fe..4195ca36384bad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -713,6 +713,12 @@ importers: '@vue/babel-plugin-jsx': 1.1.1_@babel+core@7.16.5 hash-sum: 2.0.0 + packages/temp: + specifiers: + css-color-names: ^1.0.1 + devDependencies: + css-color-names: 1.0.1 + packages/vite: specifiers: '@ampproject/remapping': ^1.0.2 @@ -738,9 +744,7 @@ importers: '@types/stylus': ^0.48.36 '@types/ws': ^8.2.2 '@vue/compiler-dom': ^3.2.26 - acorn: ^8.6.0 - acorn-class-fields: ^1.0.0 - acorn-static-class-features: ^1.0.0 + acorn: ^8.7.0 cac: 6.7.9 chalk: ^4.1.2 chokidar: ^3.5.2 @@ -816,9 +820,7 @@ importers: '@types/stylus': 0.48.36 '@types/ws': 8.2.2 '@vue/compiler-dom': 3.2.26 - acorn: 8.6.0 - acorn-class-fields: 1.0.0_acorn@8.6.0 - acorn-static-class-features: 1.0.0_acorn@8.6.0 + acorn: 8.7.0 cac: 6.7.9 chalk: 4.1.2 chokidar: 3.5.2 @@ -853,7 +855,7 @@ importers: source-map: 0.6.1 source-map-support: 0.5.21 strip-ansi: 6.0.1 - terser: 5.10.0_acorn@8.6.0 + terser: 5.10.0_acorn@8.7.0 tsconfck: 1.1.1_typescript@4.4.4 tslib: 2.3.1 types: link:types @@ -2673,16 +2675,6 @@ packages: negotiator: 0.6.2 dev: true - /acorn-class-fields/1.0.0_acorn@8.6.0: - resolution: {integrity: sha512-l+1FokF34AeCXGBHkrXFmml9nOIRI+2yBnBpO5MaVAaTIJ96irWLtcCxX+7hAp6USHFCe+iyyBB4ZhxV807wmA==} - engines: {node: '>=4.8.2'} - peerDependencies: - acorn: ^6 || ^7 || ^8 - dependencies: - acorn: 8.6.0 - acorn-private-class-elements: 1.0.0_acorn@8.6.0 - dev: true - /acorn-globals/6.0.0: resolution: {integrity: sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==} dependencies: @@ -2706,25 +2698,6 @@ packages: xtend: 4.0.2 dev: false - /acorn-private-class-elements/1.0.0_acorn@8.6.0: - resolution: {integrity: sha512-zYNcZtxKgVCg1brS39BEou86mIao1EV7eeREG+6WMwKbuYTeivRRs6S2XdWnboRde6G9wKh2w+WBydEyJsJ6mg==} - engines: {node: '>=4.8.2'} - peerDependencies: - acorn: ^6.1.0 || ^7 || ^8 - dependencies: - acorn: 8.6.0 - dev: true - - /acorn-static-class-features/1.0.0_acorn@8.6.0: - resolution: {integrity: sha512-XZJECjbmMOKvMHiNzbiPXuXpLAJfN3dAKtfIYbk1eHiWdsutlek+gS7ND4B8yJ3oqvHo1NxfafnezVmq7NXK0A==} - engines: {node: '>=4.8.2'} - peerDependencies: - acorn: ^6.1.0 || ^7 || ^8 - dependencies: - acorn: 8.6.0 - acorn-private-class-elements: 1.0.0_acorn@8.6.0 - dev: true - /acorn-walk/7.2.0: resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==} engines: {node: '>=0.4.0'} @@ -2751,6 +2724,12 @@ packages: hasBin: true dev: true + /acorn/8.7.0: + resolution: {integrity: sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /add-stream/1.0.0: resolution: {integrity: sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=} dev: true @@ -8607,7 +8586,7 @@ packages: supports-hyperlinks: 2.2.0 dev: true - /terser/5.10.0_acorn@8.6.0: + /terser/5.10.0_acorn@8.7.0: resolution: {integrity: sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==} engines: {node: '>=10'} hasBin: true @@ -8617,7 +8596,7 @@ packages: acorn: optional: true dependencies: - acorn: 8.6.0 + acorn: 8.7.0 commander: 2.20.3 source-map: 0.7.3 source-map-support: 0.5.21