Skip to content

Commit

Permalink
chore: remove acorn plugins (#6275)
Browse files Browse the repository at this point in the history
  • Loading branch information
Niputi committed Dec 28, 2021
1 parent 64b1595 commit eb08ec5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 143 deletions.
81 changes: 0 additions & 81 deletions packages/vite/LICENSE.md
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions packages/vite/package.json
Expand Up @@ -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",
Expand Down
13 changes: 2 additions & 11 deletions packages/vite/src/node/server/pluginContainer.ts
Expand Up @@ -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'
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 0 additions & 10 deletions packages/vite/types/shims.d.ts
Expand Up @@ -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
Expand Down
55 changes: 17 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb08ec5

Please sign in to comment.