@opentf/web 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -28
- package/components/Link.jsx +43 -0
- package/core/errors.js +48 -0
- package/core/reactive.js +190 -0
- package/core/signals.js +207 -0
- package/index.js +13 -0
- package/package.json +27 -18
- package/runtime/clipboard.js +47 -0
- package/runtime/code-block.js +47 -0
- package/runtime/context.js +99 -0
- package/runtime/dom.js +368 -0
- package/runtime/error-boundary.js +109 -0
- package/runtime/events.js +17 -0
- package/runtime/hydrate.js +121 -0
- package/runtime/index.js +22 -0
- package/runtime/lifecycle.js +9 -0
- package/runtime/mount.js +49 -0
- package/runtime/portal.js +59 -0
- package/runtime/raw-html.js +33 -0
- package/runtime/router.js +392 -0
- package/server/builtins.js +16 -0
- package/server/head.js +191 -0
- package/server/index.js +8 -0
- package/server/render.js +98 -0
- package/server/ssg-runtime.js +112 -0
- package/dist/CHANGELOG.md +0 -49
- package/dist/README.md +0 -41
- package/dist/babel.config.cjs +0 -6
- package/dist/compiler/babel-plugin.cjs +0 -798
- package/dist/core/mount.js +0 -32
- package/dist/index.js +0 -7
- package/dist/node_modules/@babel/core/LICENSE +0 -22
- package/dist/node_modules/@babel/core/README.md +0 -19
- package/dist/node_modules/@babel/core/lib/config/cache-contexts.js +0 -5
- package/dist/node_modules/@babel/core/lib/config/cache-contexts.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/caching.js +0 -261
- package/dist/node_modules/@babel/core/lib/config/caching.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/config-chain.js +0 -469
- package/dist/node_modules/@babel/core/lib/config/config-chain.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/config-descriptors.js +0 -190
- package/dist/node_modules/@babel/core/lib/config/config-descriptors.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/configuration.js +0 -290
- package/dist/node_modules/@babel/core/lib/config/files/configuration.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/import.cjs +0 -6
- package/dist/node_modules/@babel/core/lib/config/files/import.cjs.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/index-browser.js +0 -58
- package/dist/node_modules/@babel/core/lib/config/files/index-browser.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/index.js +0 -78
- package/dist/node_modules/@babel/core/lib/config/files/index.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/module-types.js +0 -203
- package/dist/node_modules/@babel/core/lib/config/files/module-types.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/package.js +0 -61
- package/dist/node_modules/@babel/core/lib/config/files/package.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/plugins.js +0 -220
- package/dist/node_modules/@babel/core/lib/config/files/plugins.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/types.js +0 -5
- package/dist/node_modules/@babel/core/lib/config/files/types.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/files/utils.js +0 -36
- package/dist/node_modules/@babel/core/lib/config/files/utils.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/full.js +0 -312
- package/dist/node_modules/@babel/core/lib/config/full.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/helpers/config-api.js +0 -85
- package/dist/node_modules/@babel/core/lib/config/helpers/config-api.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/helpers/deep-array.js +0 -23
- package/dist/node_modules/@babel/core/lib/config/helpers/deep-array.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/helpers/environment.js +0 -12
- package/dist/node_modules/@babel/core/lib/config/helpers/environment.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/index.js +0 -87
- package/dist/node_modules/@babel/core/lib/config/index.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/item.js +0 -67
- package/dist/node_modules/@babel/core/lib/config/item.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/partial.js +0 -158
- package/dist/node_modules/@babel/core/lib/config/partial.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/pattern-to-regex.js +0 -38
- package/dist/node_modules/@babel/core/lib/config/pattern-to-regex.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/plugin.js +0 -33
- package/dist/node_modules/@babel/core/lib/config/plugin.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/printer.js +0 -113
- package/dist/node_modules/@babel/core/lib/config/printer.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/resolve-targets-browser.js +0 -41
- package/dist/node_modules/@babel/core/lib/config/resolve-targets-browser.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/resolve-targets.js +0 -61
- package/dist/node_modules/@babel/core/lib/config/resolve-targets.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/util.js +0 -31
- package/dist/node_modules/@babel/core/lib/config/util.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/validation/option-assertions.js +0 -277
- package/dist/node_modules/@babel/core/lib/config/validation/option-assertions.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/validation/options.js +0 -187
- package/dist/node_modules/@babel/core/lib/config/validation/options.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/validation/plugins.js +0 -67
- package/dist/node_modules/@babel/core/lib/config/validation/plugins.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/config/validation/removed.js +0 -68
- package/dist/node_modules/@babel/core/lib/config/validation/removed.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/errors/config-error.js +0 -18
- package/dist/node_modules/@babel/core/lib/errors/config-error.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js +0 -98
- package/dist/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/gensync-utils/async.js +0 -90
- package/dist/node_modules/@babel/core/lib/gensync-utils/async.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/gensync-utils/fs.js +0 -31
- package/dist/node_modules/@babel/core/lib/gensync-utils/fs.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/gensync-utils/functional.js +0 -58
- package/dist/node_modules/@babel/core/lib/gensync-utils/functional.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/index.js +0 -230
- package/dist/node_modules/@babel/core/lib/index.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/parse.js +0 -45
- package/dist/node_modules/@babel/core/lib/parse.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/parser/index.js +0 -85
- package/dist/node_modules/@babel/core/lib/parser/index.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js +0 -337
- package/dist/node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/tools/build-external-helpers.js +0 -144
- package/dist/node_modules/@babel/core/lib/tools/build-external-helpers.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transform-ast.js +0 -48
- package/dist/node_modules/@babel/core/lib/transform-ast.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transform-file-browser.js +0 -23
- package/dist/node_modules/@babel/core/lib/transform-file-browser.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transform-file.js +0 -40
- package/dist/node_modules/@babel/core/lib/transform-file.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transform.js +0 -47
- package/dist/node_modules/@babel/core/lib/transform.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js +0 -84
- package/dist/node_modules/@babel/core/lib/transformation/block-hoist-plugin.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs +0 -4
- package/dist/node_modules/@babel/core/lib/transformation/file/babel-7-helpers.cjs.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/file/file.js +0 -204
- package/dist/node_modules/@babel/core/lib/transformation/file/file.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/file/generate.js +0 -84
- package/dist/node_modules/@babel/core/lib/transformation/file/generate.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/file/merge-map.js +0 -37
- package/dist/node_modules/@babel/core/lib/transformation/file/merge-map.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/index.js +0 -90
- package/dist/node_modules/@babel/core/lib/transformation/index.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/normalize-file.js +0 -127
- package/dist/node_modules/@babel/core/lib/transformation/normalize-file.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/normalize-opts.js +0 -59
- package/dist/node_modules/@babel/core/lib/transformation/normalize-opts.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/plugin-pass.js +0 -48
- package/dist/node_modules/@babel/core/lib/transformation/plugin-pass.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/transformation/util/clone-deep.js +0 -54
- package/dist/node_modules/@babel/core/lib/transformation/util/clone-deep.js.map +0 -1
- package/dist/node_modules/@babel/core/lib/vendor/import-meta-resolve.js +0 -1042
- package/dist/node_modules/@babel/core/lib/vendor/import-meta-resolve.js.map +0 -1
- package/dist/node_modules/@babel/core/package.json +0 -82
- package/dist/node_modules/@babel/core/src/config/files/index-browser.ts +0 -115
- package/dist/node_modules/@babel/core/src/config/files/index.ts +0 -30
- package/dist/node_modules/@babel/core/src/config/resolve-targets-browser.ts +0 -42
- package/dist/node_modules/@babel/core/src/config/resolve-targets.ts +0 -54
- package/dist/node_modules/@babel/core/src/transform-file-browser.ts +0 -33
- package/dist/node_modules/@babel/core/src/transform-file.ts +0 -56
- package/dist/node_modules/@babel/helper-module-imports/LICENSE +0 -22
- package/dist/node_modules/@babel/helper-module-imports/README.md +0 -19
- package/dist/node_modules/@babel/helper-module-imports/lib/import-builder.js +0 -122
- package/dist/node_modules/@babel/helper-module-imports/lib/import-builder.js.map +0 -1
- package/dist/node_modules/@babel/helper-module-imports/lib/import-injector.js +0 -304
- package/dist/node_modules/@babel/helper-module-imports/lib/import-injector.js.map +0 -1
- package/dist/node_modules/@babel/helper-module-imports/lib/index.js +0 -37
- package/dist/node_modules/@babel/helper-module-imports/lib/index.js.map +0 -1
- package/dist/node_modules/@babel/helper-module-imports/lib/is-module.js +0 -11
- package/dist/node_modules/@babel/helper-module-imports/lib/is-module.js.map +0 -1
- package/dist/node_modules/@babel/helper-module-imports/package.json +0 -28
- package/dist/node_modules/@babel/plugin-syntax-jsx/LICENSE +0 -22
- package/dist/node_modules/@babel/plugin-syntax-jsx/README.md +0 -19
- package/dist/node_modules/@babel/plugin-syntax-jsx/lib/index.js +0 -21
- package/dist/node_modules/@babel/plugin-syntax-jsx/lib/index.js.map +0 -1
- package/dist/node_modules/@babel/plugin-syntax-jsx/package.json +0 -33
- package/dist/node_modules/@preact/signals-core/CHANGELOG.md +0 -331
- package/dist/node_modules/@preact/signals-core/LICENSE +0 -21
- package/dist/node_modules/@preact/signals-core/README.md +0 -258
- package/dist/node_modules/@preact/signals-core/dist/signals-core.d.ts +0 -149
- package/dist/node_modules/@preact/signals-core/dist/signals-core.js +0 -1
- package/dist/node_modules/@preact/signals-core/dist/signals-core.js.map +0 -1
- package/dist/node_modules/@preact/signals-core/dist/signals-core.min.js +0 -1
- package/dist/node_modules/@preact/signals-core/dist/signals-core.min.js.map +0 -1
- package/dist/node_modules/@preact/signals-core/dist/signals-core.mjs +0 -1
- package/dist/node_modules/@preact/signals-core/dist/signals-core.mjs.map +0 -1
- package/dist/node_modules/@preact/signals-core/dist/signals-core.module.js +0 -1
- package/dist/node_modules/@preact/signals-core/dist/signals-core.module.js.map +0 -1
- package/dist/node_modules/@preact/signals-core/package.json +0 -48
- package/dist/node_modules/@preact/signals-core/src/index.ts +0 -1121
- package/dist/package.json +0 -30
- package/dist/router/Link.js +0 -73
- package/dist/router/index.js +0 -216
- package/dist/runtime/For.js +0 -16
- package/dist/runtime/dom.js +0 -73
- package/dist/runtime/lifecycle.js +0 -25
- package/dist/runtime/props.js +0 -103
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = generateMissingPluginMessage;
|
|
7
|
-
const pluginNameMap = {
|
|
8
|
-
asyncDoExpressions: {
|
|
9
|
-
syntax: {
|
|
10
|
-
name: "@babel/plugin-syntax-async-do-expressions",
|
|
11
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
decimal: {
|
|
15
|
-
syntax: {
|
|
16
|
-
name: "@babel/plugin-syntax-decimal",
|
|
17
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
decorators: {
|
|
21
|
-
syntax: {
|
|
22
|
-
name: "@babel/plugin-syntax-decorators",
|
|
23
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators"
|
|
24
|
-
},
|
|
25
|
-
transform: {
|
|
26
|
-
name: "@babel/plugin-proposal-decorators",
|
|
27
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
doExpressions: {
|
|
31
|
-
syntax: {
|
|
32
|
-
name: "@babel/plugin-syntax-do-expressions",
|
|
33
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions"
|
|
34
|
-
},
|
|
35
|
-
transform: {
|
|
36
|
-
name: "@babel/plugin-proposal-do-expressions",
|
|
37
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
exportDefaultFrom: {
|
|
41
|
-
syntax: {
|
|
42
|
-
name: "@babel/plugin-syntax-export-default-from",
|
|
43
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from"
|
|
44
|
-
},
|
|
45
|
-
transform: {
|
|
46
|
-
name: "@babel/plugin-proposal-export-default-from",
|
|
47
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
flow: {
|
|
51
|
-
syntax: {
|
|
52
|
-
name: "@babel/plugin-syntax-flow",
|
|
53
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow"
|
|
54
|
-
},
|
|
55
|
-
transform: {
|
|
56
|
-
name: "@babel/preset-flow",
|
|
57
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-flow"
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
functionBind: {
|
|
61
|
-
syntax: {
|
|
62
|
-
name: "@babel/plugin-syntax-function-bind",
|
|
63
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind"
|
|
64
|
-
},
|
|
65
|
-
transform: {
|
|
66
|
-
name: "@babel/plugin-proposal-function-bind",
|
|
67
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
functionSent: {
|
|
71
|
-
syntax: {
|
|
72
|
-
name: "@babel/plugin-syntax-function-sent",
|
|
73
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent"
|
|
74
|
-
},
|
|
75
|
-
transform: {
|
|
76
|
-
name: "@babel/plugin-proposal-function-sent",
|
|
77
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
jsx: {
|
|
81
|
-
syntax: {
|
|
82
|
-
name: "@babel/plugin-syntax-jsx",
|
|
83
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx"
|
|
84
|
-
},
|
|
85
|
-
transform: {
|
|
86
|
-
name: "@babel/preset-react",
|
|
87
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-react"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
pipelineOperator: {
|
|
91
|
-
syntax: {
|
|
92
|
-
name: "@babel/plugin-syntax-pipeline-operator",
|
|
93
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator"
|
|
94
|
-
},
|
|
95
|
-
transform: {
|
|
96
|
-
name: "@babel/plugin-proposal-pipeline-operator",
|
|
97
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
recordAndTuple: {
|
|
101
|
-
syntax: {
|
|
102
|
-
name: "@babel/plugin-syntax-record-and-tuple",
|
|
103
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple"
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
throwExpressions: {
|
|
107
|
-
syntax: {
|
|
108
|
-
name: "@babel/plugin-syntax-throw-expressions",
|
|
109
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions"
|
|
110
|
-
},
|
|
111
|
-
transform: {
|
|
112
|
-
name: "@babel/plugin-proposal-throw-expressions",
|
|
113
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions"
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
typescript: {
|
|
117
|
-
syntax: {
|
|
118
|
-
name: "@babel/plugin-syntax-typescript",
|
|
119
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript"
|
|
120
|
-
},
|
|
121
|
-
transform: {
|
|
122
|
-
name: "@babel/preset-typescript",
|
|
123
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-preset-typescript"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
Object.assign(pluginNameMap, {
|
|
128
|
-
asyncGenerators: {
|
|
129
|
-
syntax: {
|
|
130
|
-
name: "@babel/plugin-syntax-async-generators",
|
|
131
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators"
|
|
132
|
-
},
|
|
133
|
-
transform: {
|
|
134
|
-
name: "@babel/plugin-transform-async-generator-functions",
|
|
135
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions"
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
classProperties: {
|
|
139
|
-
syntax: {
|
|
140
|
-
name: "@babel/plugin-syntax-class-properties",
|
|
141
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
|
142
|
-
},
|
|
143
|
-
transform: {
|
|
144
|
-
name: "@babel/plugin-transform-class-properties",
|
|
145
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
classPrivateProperties: {
|
|
149
|
-
syntax: {
|
|
150
|
-
name: "@babel/plugin-syntax-class-properties",
|
|
151
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
|
152
|
-
},
|
|
153
|
-
transform: {
|
|
154
|
-
name: "@babel/plugin-transform-class-properties",
|
|
155
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties"
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
classPrivateMethods: {
|
|
159
|
-
syntax: {
|
|
160
|
-
name: "@babel/plugin-syntax-class-properties",
|
|
161
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties"
|
|
162
|
-
},
|
|
163
|
-
transform: {
|
|
164
|
-
name: "@babel/plugin-transform-private-methods",
|
|
165
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods"
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
classStaticBlock: {
|
|
169
|
-
syntax: {
|
|
170
|
-
name: "@babel/plugin-syntax-class-static-block",
|
|
171
|
-
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block"
|
|
172
|
-
},
|
|
173
|
-
transform: {
|
|
174
|
-
name: "@babel/plugin-transform-class-static-block",
|
|
175
|
-
url: "https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block"
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
dynamicImport: {
|
|
179
|
-
syntax: {
|
|
180
|
-
name: "@babel/plugin-syntax-dynamic-import",
|
|
181
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import"
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
exportNamespaceFrom: {
|
|
185
|
-
syntax: {
|
|
186
|
-
name: "@babel/plugin-syntax-export-namespace-from",
|
|
187
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from"
|
|
188
|
-
},
|
|
189
|
-
transform: {
|
|
190
|
-
name: "@babel/plugin-transform-export-namespace-from",
|
|
191
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from"
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
importAssertions: {
|
|
195
|
-
syntax: {
|
|
196
|
-
name: "@babel/plugin-syntax-import-assertions",
|
|
197
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions"
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
importAttributes: {
|
|
201
|
-
syntax: {
|
|
202
|
-
name: "@babel/plugin-syntax-import-attributes",
|
|
203
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes"
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
importMeta: {
|
|
207
|
-
syntax: {
|
|
208
|
-
name: "@babel/plugin-syntax-import-meta",
|
|
209
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta"
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
logicalAssignment: {
|
|
213
|
-
syntax: {
|
|
214
|
-
name: "@babel/plugin-syntax-logical-assignment-operators",
|
|
215
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators"
|
|
216
|
-
},
|
|
217
|
-
transform: {
|
|
218
|
-
name: "@babel/plugin-transform-logical-assignment-operators",
|
|
219
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators"
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
moduleStringNames: {
|
|
223
|
-
syntax: {
|
|
224
|
-
name: "@babel/plugin-syntax-module-string-names",
|
|
225
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names"
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
numericSeparator: {
|
|
229
|
-
syntax: {
|
|
230
|
-
name: "@babel/plugin-syntax-numeric-separator",
|
|
231
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator"
|
|
232
|
-
},
|
|
233
|
-
transform: {
|
|
234
|
-
name: "@babel/plugin-transform-numeric-separator",
|
|
235
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator"
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
nullishCoalescingOperator: {
|
|
239
|
-
syntax: {
|
|
240
|
-
name: "@babel/plugin-syntax-nullish-coalescing-operator",
|
|
241
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator"
|
|
242
|
-
},
|
|
243
|
-
transform: {
|
|
244
|
-
name: "@babel/plugin-transform-nullish-coalescing-operator",
|
|
245
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator"
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
objectRestSpread: {
|
|
249
|
-
syntax: {
|
|
250
|
-
name: "@babel/plugin-syntax-object-rest-spread",
|
|
251
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread"
|
|
252
|
-
},
|
|
253
|
-
transform: {
|
|
254
|
-
name: "@babel/plugin-transform-object-rest-spread",
|
|
255
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread"
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
optionalCatchBinding: {
|
|
259
|
-
syntax: {
|
|
260
|
-
name: "@babel/plugin-syntax-optional-catch-binding",
|
|
261
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding"
|
|
262
|
-
},
|
|
263
|
-
transform: {
|
|
264
|
-
name: "@babel/plugin-transform-optional-catch-binding",
|
|
265
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding"
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
optionalChaining: {
|
|
269
|
-
syntax: {
|
|
270
|
-
name: "@babel/plugin-syntax-optional-chaining",
|
|
271
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining"
|
|
272
|
-
},
|
|
273
|
-
transform: {
|
|
274
|
-
name: "@babel/plugin-transform-optional-chaining",
|
|
275
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining"
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
privateIn: {
|
|
279
|
-
syntax: {
|
|
280
|
-
name: "@babel/plugin-syntax-private-property-in-object",
|
|
281
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object"
|
|
282
|
-
},
|
|
283
|
-
transform: {
|
|
284
|
-
name: "@babel/plugin-transform-private-property-in-object",
|
|
285
|
-
url: "https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object"
|
|
286
|
-
}
|
|
287
|
-
},
|
|
288
|
-
regexpUnicodeSets: {
|
|
289
|
-
syntax: {
|
|
290
|
-
name: "@babel/plugin-syntax-unicode-sets-regex",
|
|
291
|
-
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md"
|
|
292
|
-
},
|
|
293
|
-
transform: {
|
|
294
|
-
name: "@babel/plugin-transform-unicode-sets-regex",
|
|
295
|
-
url: "https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md"
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
const getNameURLCombination = ({
|
|
300
|
-
name,
|
|
301
|
-
url
|
|
302
|
-
}) => `${name} (${url})`;
|
|
303
|
-
function generateMissingPluginMessage(missingPluginName, loc, codeFrame, filename) {
|
|
304
|
-
let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` + `(${loc.line}:${loc.column + 1}):\n\n` + codeFrame;
|
|
305
|
-
const pluginInfo = pluginNameMap[missingPluginName];
|
|
306
|
-
if (pluginInfo) {
|
|
307
|
-
const {
|
|
308
|
-
syntax: syntaxPlugin,
|
|
309
|
-
transform: transformPlugin
|
|
310
|
-
} = pluginInfo;
|
|
311
|
-
if (syntaxPlugin) {
|
|
312
|
-
const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);
|
|
313
|
-
if (transformPlugin) {
|
|
314
|
-
const transformPluginInfo = getNameURLCombination(transformPlugin);
|
|
315
|
-
const sectionType = transformPlugin.name.startsWith("@babel/plugin") ? "plugins" : "presets";
|
|
316
|
-
helpMessage += `\n\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation.
|
|
317
|
-
If you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`;
|
|
318
|
-
} else {
|
|
319
|
-
helpMessage += `\n\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` + `to enable parsing.`;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
const msgFilename = filename === "unknown" ? "<name of the input file>" : filename;
|
|
324
|
-
helpMessage += `
|
|
325
|
-
|
|
326
|
-
If you already added the plugin for this syntax to your config, it's possible that your config \
|
|
327
|
-
isn't being loaded.
|
|
328
|
-
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \
|
|
329
|
-
configuration:
|
|
330
|
-
\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} <your build command>
|
|
331
|
-
See https://babeljs.io/docs/configuration#print-effective-configs for more info.
|
|
332
|
-
`;
|
|
333
|
-
return helpMessage;
|
|
334
|
-
}
|
|
335
|
-
0 && 0;
|
|
336
|
-
|
|
337
|
-
//# sourceMappingURL=missing-plugin-helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["pluginNameMap","asyncDoExpressions","syntax","name","url","decimal","decorators","transform","doExpressions","exportDefaultFrom","flow","functionBind","functionSent","jsx","pipelineOperator","recordAndTuple","throwExpressions","typescript","Object","assign","asyncGenerators","classProperties","classPrivateProperties","classPrivateMethods","classStaticBlock","dynamicImport","exportNamespaceFrom","importAssertions","importAttributes","importMeta","logicalAssignment","moduleStringNames","numericSeparator","nullishCoalescingOperator","objectRestSpread","optionalCatchBinding","optionalChaining","privateIn","regexpUnicodeSets","getNameURLCombination","generateMissingPluginMessage","missingPluginName","loc","codeFrame","filename","helpMessage","line","column","pluginInfo","syntaxPlugin","transformPlugin","syntaxPluginInfo","transformPluginInfo","sectionType","startsWith","msgFilename"],"sources":["../../../src/parser/util/missing-plugin-helper.ts"],"sourcesContent":["const pluginNameMap: Record<\n string,\n Partial<Record<\"syntax\" | \"transform\", Record<\"name\" | \"url\", string>>>\n> = {\n asyncDoExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-async-do-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-do-expressions\",\n },\n },\n decimal: {\n syntax: {\n name: \"@babel/plugin-syntax-decimal\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decimal\",\n },\n },\n decorators: {\n syntax: {\n name: \"@babel/plugin-syntax-decorators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-decorators\",\n },\n transform: {\n name: \"@babel/plugin-proposal-decorators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-decorators\",\n },\n },\n doExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-do-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-do-expressions\",\n },\n transform: {\n name: \"@babel/plugin-proposal-do-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-do-expressions\",\n },\n },\n exportDefaultFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-default-from\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-default-from\",\n },\n transform: {\n name: \"@babel/plugin-proposal-export-default-from\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-export-default-from\",\n },\n },\n flow: {\n syntax: {\n name: \"@babel/plugin-syntax-flow\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-flow\",\n },\n transform: {\n name: \"@babel/preset-flow\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-preset-flow\",\n },\n },\n functionBind: {\n syntax: {\n name: \"@babel/plugin-syntax-function-bind\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-bind\",\n },\n transform: {\n name: \"@babel/plugin-proposal-function-bind\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-bind\",\n },\n },\n functionSent: {\n syntax: {\n name: \"@babel/plugin-syntax-function-sent\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-function-sent\",\n },\n transform: {\n name: \"@babel/plugin-proposal-function-sent\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-function-sent\",\n },\n },\n jsx: {\n syntax: {\n name: \"@babel/plugin-syntax-jsx\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx\",\n },\n transform: {\n name: \"@babel/preset-react\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-preset-react\",\n },\n },\n pipelineOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-pipeline-operator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-pipeline-operator\",\n },\n transform: {\n name: \"@babel/plugin-proposal-pipeline-operator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-pipeline-operator\",\n },\n },\n recordAndTuple: {\n syntax: {\n name: \"@babel/plugin-syntax-record-and-tuple\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-record-and-tuple\",\n },\n },\n throwExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-throw-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-throw-expressions\",\n },\n transform: {\n name: \"@babel/plugin-proposal-throw-expressions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-proposal-throw-expressions\",\n },\n },\n typescript: {\n syntax: {\n name: \"@babel/plugin-syntax-typescript\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-typescript\",\n },\n transform: {\n name: \"@babel/preset-typescript\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-preset-typescript\",\n },\n },\n};\n\nif (!process.env.BABEL_8_BREAKING) {\n // TODO: This plugins are now supported by default by @babel/parser.\n Object.assign(pluginNameMap, {\n asyncGenerators: {\n syntax: {\n name: \"@babel/plugin-syntax-async-generators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-async-generators\",\n },\n transform: {\n name: \"@babel/plugin-transform-async-generator-functions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-async-generator-functions\",\n },\n },\n classProperties: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties\",\n },\n transform: {\n name: \"@babel/plugin-transform-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties\",\n },\n },\n classPrivateProperties: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties\",\n },\n transform: {\n name: \"@babel/plugin-transform-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-class-properties\",\n },\n },\n classPrivateMethods: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-class-properties\",\n },\n transform: {\n name: \"@babel/plugin-transform-private-methods\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-methods\",\n },\n },\n classStaticBlock: {\n syntax: {\n name: \"@babel/plugin-syntax-class-static-block\",\n url: \"https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-syntax-class-static-block\",\n },\n transform: {\n name: \"@babel/plugin-transform-class-static-block\",\n url: \"https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-class-static-block\",\n },\n },\n dynamicImport: {\n syntax: {\n name: \"@babel/plugin-syntax-dynamic-import\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-dynamic-import\",\n },\n },\n exportNamespaceFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-namespace-from\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-export-namespace-from\",\n },\n transform: {\n name: \"@babel/plugin-transform-export-namespace-from\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-export-namespace-from\",\n },\n },\n // Will be removed\n importAssertions: {\n syntax: {\n name: \"@babel/plugin-syntax-import-assertions\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-assertions\",\n },\n },\n importAttributes: {\n syntax: {\n name: \"@babel/plugin-syntax-import-attributes\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes\",\n },\n },\n importMeta: {\n syntax: {\n name: \"@babel/plugin-syntax-import-meta\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-meta\",\n },\n },\n logicalAssignment: {\n syntax: {\n name: \"@babel/plugin-syntax-logical-assignment-operators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-logical-assignment-operators\",\n },\n transform: {\n name: \"@babel/plugin-transform-logical-assignment-operators\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-logical-assignment-operators\",\n },\n },\n moduleStringNames: {\n syntax: {\n name: \"@babel/plugin-syntax-module-string-names\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-module-string-names\",\n },\n },\n numericSeparator: {\n syntax: {\n name: \"@babel/plugin-syntax-numeric-separator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-numeric-separator\",\n },\n transform: {\n name: \"@babel/plugin-transform-numeric-separator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-numeric-separator\",\n },\n },\n nullishCoalescingOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-nullish-coalescing-operator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-nullish-coalescing-operator\",\n },\n transform: {\n name: \"@babel/plugin-transform-nullish-coalescing-operator\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-nullish-coalescing-opearator\",\n },\n },\n objectRestSpread: {\n syntax: {\n name: \"@babel/plugin-syntax-object-rest-spread\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-object-rest-spread\",\n },\n transform: {\n name: \"@babel/plugin-transform-object-rest-spread\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-object-rest-spread\",\n },\n },\n optionalCatchBinding: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-catch-binding\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-catch-binding\",\n },\n transform: {\n name: \"@babel/plugin-transform-optional-catch-binding\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-catch-binding\",\n },\n },\n optionalChaining: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-chaining\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-optional-chaining\",\n },\n transform: {\n name: \"@babel/plugin-transform-optional-chaining\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-optional-chaining\",\n },\n },\n privateIn: {\n syntax: {\n name: \"@babel/plugin-syntax-private-property-in-object\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-private-property-in-object\",\n },\n transform: {\n name: \"@babel/plugin-transform-private-property-in-object\",\n url: \"https://github.com/babel/babel/tree/main/packages/babel-plugin-transform-private-property-in-object\",\n },\n },\n regexpUnicodeSets: {\n syntax: {\n name: \"@babel/plugin-syntax-unicode-sets-regex\",\n url: \"https://github.com/babel/babel/blob/main/packages/babel-plugin-syntax-unicode-sets-regex/README.md\",\n },\n transform: {\n name: \"@babel/plugin-transform-unicode-sets-regex\",\n url: \"https://github.com/babel/babel/blob/main/packages/babel-plugin-proposalunicode-sets-regex/README.md\",\n },\n },\n });\n}\n\nconst getNameURLCombination = ({ name, url }: { name: string; url: string }) =>\n `${name} (${url})`;\n\n/*\nReturns a string of the format:\nSupport for the experimental syntax [@babel/parser plugin name] isn't currently enabled ([loc]):\n\n[code frame]\n\nAdd [npm package name] ([url]) to the 'plugins' section of your Babel config\nto enable [parsing|transformation].\n*/\nexport default function generateMissingPluginMessage(\n missingPluginName: string,\n loc: {\n line: number;\n column: number;\n },\n codeFrame: string,\n filename: string,\n): string {\n let helpMessage =\n `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` +\n `(${loc.line}:${loc.column + 1}):\\n\\n` +\n codeFrame;\n const pluginInfo = pluginNameMap[missingPluginName];\n if (pluginInfo) {\n const { syntax: syntaxPlugin, transform: transformPlugin } = pluginInfo;\n if (syntaxPlugin) {\n const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);\n if (transformPlugin) {\n const transformPluginInfo = getNameURLCombination(transformPlugin);\n const sectionType = transformPlugin.name.startsWith(\"@babel/plugin\")\n ? \"plugins\"\n : \"presets\";\n helpMessage += `\\n\\nAdd ${transformPluginInfo} to the '${sectionType}' section of your Babel config to enable transformation.\nIf you want to leave it as-is, add ${syntaxPluginInfo} to the 'plugins' section to enable parsing.`;\n } else {\n helpMessage +=\n `\\n\\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` +\n `to enable parsing.`;\n }\n }\n }\n\n const msgFilename =\n filename === \"unknown\" ? \"<name of the input file>\" : filename;\n helpMessage += `\n\nIf you already added the plugin for this syntax to your config, it's possible that your config \\\nisn't being loaded.\nYou can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \\\nconfiguration:\n\\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${msgFilename} <your build command>\nSee https://babeljs.io/docs/configuration#print-effective-configs for more info.\n`;\n return helpMessage;\n}\n"],"mappings":";;;;;;AAAA,MAAMA,aAGL,GAAG;EACFC,kBAAkB,EAAE;IAClBC,MAAM,EAAE;MACNC,IAAI,EAAE,2CAA2C;MACjDC,GAAG,EAAE;IACP;EACF,CAAC;EACDC,OAAO,EAAE;IACPH,MAAM,EAAE;MACNC,IAAI,EAAE,8BAA8B;MACpCC,GAAG,EAAE;IACP;EACF,CAAC;EACDE,UAAU,EAAE;IACVJ,MAAM,EAAE;MACNC,IAAI,EAAE,iCAAiC;MACvCC,GAAG,EAAE;IACP,CAAC;IACDG,SAAS,EAAE;MACTJ,IAAI,EAAE,mCAAmC;MACzCC,GAAG,EAAE;IACP;EACF,CAAC;EACDI,aAAa,EAAE;IACbN,MAAM,EAAE;MACNC,IAAI,EAAE,qCAAqC;MAC3CC,GAAG,EAAE;IACP,CAAC;IACDG,SAAS,EAAE;MACTJ,IAAI,EAAE,uCAAuC;MAC7CC,GAAG,EAAE;IACP;EACF,CAAC;EACDK,iBAAiB,EAAE;IACj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GAAGhD,aAAa,CAACyC,iBAAiB,CAAC;EACnD,IAAIO,UAAU,EAAE;IACd,MAAM;MAAE9C,MAAM,EAAE+C,YAAY;MAAE1C,SAAS,EAAE2C;IAAgB,CAAC,GAAGF,UAAU;IACvE,IAAIC,YAAY,EAAE;MAChB,MAAME,gBAAgB,GAAGZ,qBAAqB,CAACU,YAAY,CAAC;MAC5D,IAAIC,eAAe,EAAE;QACnB,MAAME,mBAAmB,GAAGb,qBAAqB,CAACW,eAAe,CAAC;QAClE,MAAMG,WAAW,GAAGH,eAAe,CAAC/C,IAAI,CAACmD,UAAU,CAAC,eAAe,CAAC,GAChE,SAAS,GACT,SAAS;QACbT,WAAW,IAAI,WAAWO,mBAAmB,YAAYC,WAAW;AAC5E,qCAAqCF,gBAAgB,8CAA8C;MAC7F,CAAC,MAAM;QACLN,WAAW,IACT,WAAWM,gBAAgB,iDAAiD,GAC5E,oBAAoB;MACxB;IACF;EACF;EAEA,MAAMI,WAAW,GACfX,QAAQ,KAAK,SAAS,GAAG,0BAA0B,GAAGA,QAAQ;EAChEC,WAAW,IAAI;AACjB;AACA;AACA;AACA;AACA;AACA,wCAAwCU,WAAW;AACnD;AACA,CAAC;EACC,OAAOV,WAAW;AACpB;AAAC","ignoreList":[]}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = _default;
|
|
7
|
-
function helpers() {
|
|
8
|
-
const data = require("@babel/helpers");
|
|
9
|
-
helpers = function () {
|
|
10
|
-
return data;
|
|
11
|
-
};
|
|
12
|
-
return data;
|
|
13
|
-
}
|
|
14
|
-
function _generator() {
|
|
15
|
-
const data = require("@babel/generator");
|
|
16
|
-
_generator = function () {
|
|
17
|
-
return data;
|
|
18
|
-
};
|
|
19
|
-
return data;
|
|
20
|
-
}
|
|
21
|
-
function _template() {
|
|
22
|
-
const data = require("@babel/template");
|
|
23
|
-
_template = function () {
|
|
24
|
-
return data;
|
|
25
|
-
};
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
function _t() {
|
|
29
|
-
const data = require("@babel/types");
|
|
30
|
-
_t = function () {
|
|
31
|
-
return data;
|
|
32
|
-
};
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
const {
|
|
36
|
-
arrayExpression,
|
|
37
|
-
assignmentExpression,
|
|
38
|
-
binaryExpression,
|
|
39
|
-
blockStatement,
|
|
40
|
-
callExpression,
|
|
41
|
-
cloneNode,
|
|
42
|
-
conditionalExpression,
|
|
43
|
-
exportNamedDeclaration,
|
|
44
|
-
exportSpecifier,
|
|
45
|
-
expressionStatement,
|
|
46
|
-
functionExpression,
|
|
47
|
-
identifier,
|
|
48
|
-
memberExpression,
|
|
49
|
-
objectExpression,
|
|
50
|
-
program,
|
|
51
|
-
stringLiteral,
|
|
52
|
-
unaryExpression,
|
|
53
|
-
variableDeclaration,
|
|
54
|
-
variableDeclarator
|
|
55
|
-
} = _t();
|
|
56
|
-
const buildUmdWrapper = replacements => _template().default.statement`
|
|
57
|
-
(function (root, factory) {
|
|
58
|
-
if (typeof define === "function" && define.amd) {
|
|
59
|
-
define(AMD_ARGUMENTS, factory);
|
|
60
|
-
} else if (typeof exports === "object") {
|
|
61
|
-
factory(COMMON_ARGUMENTS);
|
|
62
|
-
} else {
|
|
63
|
-
factory(BROWSER_ARGUMENTS);
|
|
64
|
-
}
|
|
65
|
-
})(UMD_ROOT, function (FACTORY_PARAMETERS) {
|
|
66
|
-
FACTORY_BODY
|
|
67
|
-
});
|
|
68
|
-
`(replacements);
|
|
69
|
-
function buildGlobal(allowlist) {
|
|
70
|
-
const namespace = identifier("babelHelpers");
|
|
71
|
-
const body = [];
|
|
72
|
-
const container = functionExpression(null, [identifier("global")], blockStatement(body));
|
|
73
|
-
const tree = program([expressionStatement(callExpression(container, [conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]);
|
|
74
|
-
body.push(variableDeclaration("var", [variableDeclarator(namespace, assignmentExpression("=", memberExpression(identifier("global"), namespace), objectExpression([])))]));
|
|
75
|
-
buildHelpers(body, namespace, allowlist);
|
|
76
|
-
return tree;
|
|
77
|
-
}
|
|
78
|
-
function buildModule(allowlist) {
|
|
79
|
-
const body = [];
|
|
80
|
-
const refs = buildHelpers(body, null, allowlist);
|
|
81
|
-
body.unshift(exportNamedDeclaration(null, Object.keys(refs).map(name => {
|
|
82
|
-
return exportSpecifier(cloneNode(refs[name]), identifier(name));
|
|
83
|
-
})));
|
|
84
|
-
return program(body, [], "module");
|
|
85
|
-
}
|
|
86
|
-
function buildUmd(allowlist) {
|
|
87
|
-
const namespace = identifier("babelHelpers");
|
|
88
|
-
const body = [];
|
|
89
|
-
body.push(variableDeclaration("var", [variableDeclarator(namespace, identifier("global"))]));
|
|
90
|
-
buildHelpers(body, namespace, allowlist);
|
|
91
|
-
return program([buildUmdWrapper({
|
|
92
|
-
FACTORY_PARAMETERS: identifier("global"),
|
|
93
|
-
BROWSER_ARGUMENTS: assignmentExpression("=", memberExpression(identifier("root"), namespace), objectExpression([])),
|
|
94
|
-
COMMON_ARGUMENTS: identifier("exports"),
|
|
95
|
-
AMD_ARGUMENTS: arrayExpression([stringLiteral("exports")]),
|
|
96
|
-
FACTORY_BODY: body,
|
|
97
|
-
UMD_ROOT: identifier("this")
|
|
98
|
-
})]);
|
|
99
|
-
}
|
|
100
|
-
function buildVar(allowlist) {
|
|
101
|
-
const namespace = identifier("babelHelpers");
|
|
102
|
-
const body = [];
|
|
103
|
-
body.push(variableDeclaration("var", [variableDeclarator(namespace, objectExpression([]))]));
|
|
104
|
-
const tree = program(body);
|
|
105
|
-
buildHelpers(body, namespace, allowlist);
|
|
106
|
-
body.push(expressionStatement(namespace));
|
|
107
|
-
return tree;
|
|
108
|
-
}
|
|
109
|
-
function buildHelpers(body, namespace, allowlist) {
|
|
110
|
-
const getHelperReference = name => {
|
|
111
|
-
return namespace ? memberExpression(namespace, identifier(name)) : identifier(`_${name}`);
|
|
112
|
-
};
|
|
113
|
-
const refs = {};
|
|
114
|
-
helpers().list.forEach(function (name) {
|
|
115
|
-
if (allowlist && !allowlist.includes(name)) return;
|
|
116
|
-
const ref = refs[name] = getHelperReference(name);
|
|
117
|
-
const {
|
|
118
|
-
nodes
|
|
119
|
-
} = helpers().get(name, getHelperReference, namespace ? null : `_${name}`, [], namespace ? (ast, exportName, mapExportBindingAssignments) => {
|
|
120
|
-
mapExportBindingAssignments(node => assignmentExpression("=", ref, node));
|
|
121
|
-
ast.body.push(expressionStatement(assignmentExpression("=", ref, identifier(exportName))));
|
|
122
|
-
} : null);
|
|
123
|
-
body.push(...nodes);
|
|
124
|
-
});
|
|
125
|
-
return refs;
|
|
126
|
-
}
|
|
127
|
-
function _default(allowlist, outputType = "global") {
|
|
128
|
-
let tree;
|
|
129
|
-
const build = {
|
|
130
|
-
global: buildGlobal,
|
|
131
|
-
module: buildModule,
|
|
132
|
-
umd: buildUmd,
|
|
133
|
-
var: buildVar
|
|
134
|
-
}[outputType];
|
|
135
|
-
if (build) {
|
|
136
|
-
tree = build(allowlist);
|
|
137
|
-
} else {
|
|
138
|
-
throw new Error(`Unsupported output type ${outputType}`);
|
|
139
|
-
}
|
|
140
|
-
return (0, _generator().default)(tree).code;
|
|
141
|
-
}
|
|
142
|
-
0 && 0;
|
|
143
|
-
|
|
144
|
-
//# sourceMappingURL=build-external-helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["helpers","data","require","_generator","_template","_t","arrayExpression","assignmentExpression","binaryExpression","blockStatement","callExpression","cloneNode","conditionalExpression","exportNamedDeclaration","exportSpecifier","expressionStatement","functionExpression","identifier","memberExpression","objectExpression","program","stringLiteral","unaryExpression","variableDeclaration","variableDeclarator","buildUmdWrapper","replacements","template","statement","buildGlobal","allowlist","namespace","body","container","tree","push","buildHelpers","buildModule","refs","unshift","Object","keys","map","name","buildUmd","FACTORY_PARAMETERS","BROWSER_ARGUMENTS","COMMON_ARGUMENTS","AMD_ARGUMENTS","FACTORY_BODY","UMD_ROOT","buildVar","getHelperReference","list","forEach","includes","ref","nodes","get","ast","exportName","mapExportBindingAssignments","node","_default","outputType","build","global","module","umd","var","Error","generator","code"],"sources":["../../src/tools/build-external-helpers.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport generator from \"@babel/generator\";\nimport template from \"@babel/template\";\nimport {\n arrayExpression,\n assignmentExpression,\n binaryExpression,\n blockStatement,\n callExpression,\n cloneNode,\n conditionalExpression,\n exportNamedDeclaration,\n exportSpecifier,\n expressionStatement,\n functionExpression,\n identifier,\n memberExpression,\n objectExpression,\n program,\n stringLiteral,\n unaryExpression,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { Replacements } from \"@babel/template\";\n\n// Wrapped to avoid wasting time parsing this when almost no-one uses\n// build-external-helpers.\nconst buildUmdWrapper = (replacements: Replacements) =>\n template.statement`\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n `(replacements);\n\nfunction buildGlobal(allowlist?: string[]) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n const container = functionExpression(\n null,\n [identifier(\"global\")],\n blockStatement(body),\n );\n const tree = program([\n expressionStatement(\n callExpression(container, [\n // typeof global === \"undefined\" ? self : global\n conditionalExpression(\n binaryExpression(\n \"===\",\n unaryExpression(\"typeof\", identifier(\"global\")),\n stringLiteral(\"undefined\"),\n ),\n identifier(\"self\"),\n identifier(\"global\"),\n ),\n ]),\n ),\n ]);\n\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(\n namespace,\n assignmentExpression(\n \"=\",\n memberExpression(identifier(\"global\"), namespace),\n objectExpression([]),\n ),\n ),\n ]),\n );\n\n buildHelpers(body, namespace, allowlist);\n\n return tree;\n}\n\nfunction buildModule(allowlist?: string[]) {\n const body: t.Statement[] = [];\n const refs = buildHelpers(body, null, allowlist);\n\n body.unshift(\n exportNamedDeclaration(\n null,\n Object.keys(refs).map(name => {\n return exportSpecifier(cloneNode(refs[name]), identifier(name));\n }),\n ),\n );\n\n return program(body, [], \"module\");\n}\n\nfunction buildUmd(allowlist?: string[]) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(namespace, identifier(\"global\")),\n ]),\n );\n\n buildHelpers(body, namespace, allowlist);\n\n return program([\n buildUmdWrapper({\n FACTORY_PARAMETERS: identifier(\"global\"),\n BROWSER_ARGUMENTS: assignmentExpression(\n \"=\",\n memberExpression(identifier(\"root\"), namespace),\n objectExpression([]),\n ),\n COMMON_ARGUMENTS: identifier(\"exports\"),\n AMD_ARGUMENTS: arrayExpression([stringLiteral(\"exports\")]),\n FACTORY_BODY: body,\n UMD_ROOT: identifier(\"this\"),\n }),\n ]);\n}\n\nfunction buildVar(allowlist?: string[]) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(namespace, objectExpression([])),\n ]),\n );\n const tree = program(body);\n buildHelpers(body, namespace, allowlist);\n body.push(expressionStatement(namespace));\n return tree;\n}\n\nfunction buildHelpers(\n body: t.Statement[],\n namespace: t.Expression,\n allowlist?: string[],\n): Record<string, t.MemberExpression>;\nfunction buildHelpers(\n body: t.Statement[],\n namespace: null,\n allowlist?: string[],\n): Record<string, t.Identifier>;\n\nfunction buildHelpers(\n body: t.Statement[],\n namespace: t.Expression | null,\n allowlist?: string[],\n) {\n const getHelperReference = (name: string) => {\n return namespace\n ? memberExpression(namespace, identifier(name))\n : identifier(`_${name}`);\n };\n\n const refs: Record<string, t.Identifier | t.MemberExpression> = {};\n helpers.list.forEach(function (name) {\n if (allowlist && !allowlist.includes(name)) return;\n\n const ref = (refs[name] = getHelperReference(name));\n\n const { nodes } = helpers.get(\n name,\n getHelperReference,\n namespace ? null : `_${name}`,\n [],\n namespace\n ? (ast, exportName, mapExportBindingAssignments) => {\n mapExportBindingAssignments(node =>\n assignmentExpression(\"=\", ref, node),\n );\n ast.body.push(\n expressionStatement(\n assignmentExpression(\"=\", ref, identifier(exportName)),\n ),\n );\n }\n : null,\n );\n\n body.push(...nodes);\n });\n return refs;\n}\nexport default function (\n allowlist?: string[],\n outputType: \"global\" | \"module\" | \"umd\" | \"var\" = \"global\",\n) {\n let tree: t.Program;\n\n const build = {\n global: buildGlobal,\n module: buildModule,\n umd: buildUmd,\n var: buildVar,\n }[outputType];\n\n if (build) {\n tree = build(allowlist);\n } else {\n throw new Error(`Unsupported output type ${outputType}`);\n }\n\n return generator(tree).code;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,GAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,EAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAoBsB;EAnBpBK,eAAe;EACfC,oBAAoB;EACpBC,gBAAgB;EAChBC,cAAc;EACdC,cAAc;EACdC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AAI,EAAE,EAC7B,EAAE,EACFZ,SAAS,GACL,CAAC4B,GAAG,EAAEC,UAAU,EAAEC,2BAA2B,KAAK;MAChDA,2BAA2B,CAACC,IAAI,IAC9BvD,oBAAoB,CAAC,GAAG,EAAEiD,GAAG,EAAEM,IAAI,CACrC,CAAC;MACDH,GAAG,CAAC3B,IAAI,CAACG,IAAI,CACXpB,mBAAmB,CACjBR,oBAAoB,CAAC,GAAG,EAAEiD,GAAG,EAAEvC,UAAU,CAAC2C,UAAU,CAAC,CACvD,CACF,CAAC;IACH,CAAC,GACD,IACN,CAAC;IAED5B,IAAI,CAACG,IAAI,CAAC,GAAGsB,KAAK,CAAC;EACrB,CAAC,CAAC;EACF,OAAOnB,IAAI;AACb;AACe,SAAAyB,SACbjC,SAAoB,EACpBkC,UAA+C,GAAG,QAAQ,EAC1D;EACA,IAAI9B,IAAe;EAEnB,MAAM+B,KAAK,GAAG;IACZC,MAAM,EAAErC,WAAW;IACnBsC,MAAM,EAAE9B,WAAW;IACnB+B,GAAG,EAAExB,QAAQ;IACbyB,GAAG,EAAElB;EACP,CAAC,CAACa,UAAU,CAAC;EAEb,IAAIC,KAAK,EAAE;IACT/B,IAAI,GAAG+B,KAAK,CAACnC,SAAS,CAAC;EACzB,CAAC,MAAM;IACL,MAAM,IAAIwC,KAAK,CAAC,2BAA2BN,UAAU,EAAE,CAAC;EAC1D;EAEA,OAAO,IAAAO,oBAAS,EAACrC,IAAI,CAAC,CAACsC,IAAI;AAC7B;AAAC","ignoreList":[]}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.transformFromAst = void 0;
|
|
7
|
-
exports.transformFromAstAsync = transformFromAstAsync;
|
|
8
|
-
exports.transformFromAstSync = transformFromAstSync;
|
|
9
|
-
function _gensync() {
|
|
10
|
-
const data = require("gensync");
|
|
11
|
-
_gensync = function () {
|
|
12
|
-
return data;
|
|
13
|
-
};
|
|
14
|
-
return data;
|
|
15
|
-
}
|
|
16
|
-
var _index = require("./config/index.js");
|
|
17
|
-
var _index2 = require("./transformation/index.js");
|
|
18
|
-
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
|
|
19
|
-
const transformFromAstRunner = _gensync()(function* (ast, code, opts) {
|
|
20
|
-
const config = yield* (0, _index.default)(opts);
|
|
21
|
-
if (config === null) return null;
|
|
22
|
-
if (!ast) throw new Error("No AST given");
|
|
23
|
-
return yield* (0, _index2.run)(config, code, ast);
|
|
24
|
-
});
|
|
25
|
-
const transformFromAst = exports.transformFromAst = function transformFromAst(ast, code, optsOrCallback, maybeCallback) {
|
|
26
|
-
let opts;
|
|
27
|
-
let callback;
|
|
28
|
-
if (typeof optsOrCallback === "function") {
|
|
29
|
-
callback = optsOrCallback;
|
|
30
|
-
opts = undefined;
|
|
31
|
-
} else {
|
|
32
|
-
opts = optsOrCallback;
|
|
33
|
-
callback = maybeCallback;
|
|
34
|
-
}
|
|
35
|
-
if (callback === undefined) {
|
|
36
|
-
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast, code, opts);
|
|
37
|
-
}
|
|
38
|
-
(0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast, code, opts, callback);
|
|
39
|
-
};
|
|
40
|
-
function transformFromAstSync(...args) {
|
|
41
|
-
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args);
|
|
42
|
-
}
|
|
43
|
-
function transformFromAstAsync(...args) {
|
|
44
|
-
return (0, _rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.async)(...args);
|
|
45
|
-
}
|
|
46
|
-
0 && 0;
|
|
47
|
-
|
|
48
|
-
//# sourceMappingURL=transform-ast.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_gensync","data","require","_index","_index2","_rewriteStackTrace","transformFromAstRunner","gensync","ast","code","opts","config","loadConfig","Error","run","transformFromAst","exports","optsOrCallback","maybeCallback","callback","undefined","beginHiddenCallStack","sync","errback","transformFromAstSync","args","transformFromAstAsync","async"],"sources":["../src/transform-ast.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig from \"./config/index.ts\";\nimport type { InputOptions, ResolvedConfig } from \"./config/index.ts\";\nimport { run } from \"./transformation/index.ts\";\nimport type * as t from \"@babel/types\";\n\nimport { beginHiddenCallStack } from \"./errors/rewrite-stack-trace.ts\";\n\nimport type { FileResult, FileResultCallback } from \"./transformation/index.ts\";\ntype AstRoot = t.File | t.Program;\n\ntype TransformFromAst = {\n (ast: AstRoot, code: string, callback: FileResultCallback): void;\n (\n ast: AstRoot,\n code: string,\n opts: InputOptions | undefined | null,\n callback: FileResultCallback,\n ): void;\n (ast: AstRoot, code: string, opts?: InputOptions | null): FileResult | null;\n};\n\nconst transformFromAstRunner = gensync(function* (\n ast: AstRoot,\n code: string,\n opts: InputOptions | undefined | null,\n): Handler<FileResult | null> {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n if (!ast) throw new Error(\"No AST given\");\n\n return yield* run(config, code, ast);\n});\n\nexport const transformFromAst: TransformFromAst = function transformFromAst(\n ast,\n code,\n optsOrCallback?: InputOptions | null | undefined | FileResultCallback,\n maybeCallback?: FileResultCallback,\n) {\n let opts: InputOptions | undefined | null;\n let callback: FileResultCallback | undefined;\n if (typeof optsOrCallback === \"function\") {\n callback = optsOrCallback;\n opts = undefined;\n } else {\n opts = optsOrCallback;\n callback = maybeCallback;\n }\n\n if (callback === undefined) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'transformFromAst' function expects a callback. If you need to call it synchronously, please use 'transformFromAstSync'.\",\n );\n } else {\n // console.warn(\n // \"Starting from Babel 8.0.0, the 'transformFromAst' function will expect a callback. If you need to call it synchronously, please use 'transformFromAstSync'.\",\n // );\n return beginHiddenCallStack(transformFromAstRunner.sync)(ast, code, opts);\n }\n }\n\n beginHiddenCallStack(transformFromAstRunner.errback)(\n ast,\n code,\n opts,\n callback,\n );\n};\n\nexport function transformFromAstSync(\n ...args: Parameters<typeof transformFromAstRunner.sync>\n) {\n return beginHiddenCallStack(transformFromAstRunner.sync)(...args);\n}\n\nexport function transformFromAstAsync(\n ...args: Parameters<typeof transformFromAstRunner.async>\n) {\n return beginHiddenCallStack(transformFromAstRunner.async)(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAGA,IAAAG,kBAAA,GAAAH,OAAA;AAgBA,MAAMI,sBAAsB,GAAGC,SAAMA,CAAC,CAAC,WACrCC,GAAY,EACZC,IAAY,EACZC,IAAqC,EACT;EAC5B,MAAMC,MAA6B,GAAG,OAAO,IAAAC,cAAU,EAACF,IAAI,CAAC;EAC7D,IAAIC,MAAM,KAAK,IAAI,EAAE,OAAO,IAAI;EAEhC,IAAI,CAACH,GAAG,EAAE,MAAM,IAAIK,KAAK,CAAC,cAAc,CAAC;EAEzC,OAAO,OAAO,IAAAC,WAAG,EAACH,MAAM,EAAEF,IAAI,EAAED,GAAG,CAAC;AACtC,CAAC,CAAC;AAEK,MAAMO,gBAAkC,GAAAC,OAAA,CAAAD,gBAAA,GAAG,SAASA,gBAAgBA,CACzEP,GAAG,EACHC,IAAI,EACJQ,cAAqE,EACrEC,aAAkC,EAClC;EACA,IAAIR,IAAqC;EACzC,IAAIS,QAAwC;EAC5C,IAAI,OAAOF,cAAc,KAAK,UAAU,EAAE;IACxCE,QAAQ,GAAGF,cAAc;IACzBP,IAAI,GAAGU,SAAS;EAClB,CAAC,MAAM;IACLV,IAAI,GAAGO,cAAc;IACrBE,QAAQ,GAAGD,aAAa;EAC1B;EAEA,IAAIC,QAAQ,KAAKC,SAAS,EAAE;IASxB,OAAO,IAAAC,uCAAoB,EAACf,sBAAsB,CAACgB,IAAI,CAAC,CAACd,GAAG,EAAEC,IAAI,EAAEC,IAAI,CAAC;EAE7E;EAEA,IAAAW,uCAAoB,EAACf,sBAAsB,CAACiB,OAAO,CAAC,CAClDf,GAAG,EACHC,IAAI,EACJC,IAAI,EACJS,QACF,CAAC;AACH,CAAC;AAEM,SAASK,oBAAoBA,CAClC,GAAGC,IAAoD,EACvD;EACA,OAAO,IAAAJ,uCAAoB,EAACf,sBAAsB,CAACgB,IAAI,CAAC,CAAC,GAAGG,IAAI,CAAC;AACnE;AAEO,SAASC,qBAAqBA,CACnC,GAAGD,IAAqD,EACxD;EACA,OAAO,IAAAJ,uCAAoB,EAACf,sBAAsB,CAACqB,KAAK,CAAC,CAAC,GAAGF,IAAI,CAAC;AACpE;AAAC","ignoreList":[]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.transformFile = void 0;
|
|
7
|
-
exports.transformFileAsync = transformFileAsync;
|
|
8
|
-
exports.transformFileSync = transformFileSync;
|
|
9
|
-
const transformFile = exports.transformFile = function transformFile(filename, opts, callback) {
|
|
10
|
-
if (typeof opts === "function") {
|
|
11
|
-
callback = opts;
|
|
12
|
-
}
|
|
13
|
-
callback(new Error("Transforming files is not supported in browsers"), null);
|
|
14
|
-
};
|
|
15
|
-
function transformFileSync() {
|
|
16
|
-
throw new Error("Transforming files is not supported in browsers");
|
|
17
|
-
}
|
|
18
|
-
function transformFileAsync() {
|
|
19
|
-
return Promise.reject(new Error("Transforming files is not supported in browsers"));
|
|
20
|
-
}
|
|
21
|
-
0 && 0;
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=transform-file-browser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["transformFile","exports","filename","opts","callback","Error","transformFileSync","transformFileAsync","Promise","reject"],"sources":["../src/transform-file-browser.ts"],"sourcesContent":["/* c8 ignore start */\n\n// duplicated from transform-file so we do not have to import anything here\ntype TransformFile = {\n (filename: string, callback: (error: Error, file: null) => void): void;\n (\n filename: string,\n opts: any,\n callback: (error: Error, file: null) => void,\n ): void;\n};\n\nexport const transformFile: TransformFile = function transformFile(\n filename,\n opts,\n callback?: (error: Error, file: null) => void,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n }\n\n callback(new Error(\"Transforming files is not supported in browsers\"), null);\n};\n\nexport function transformFileSync(): never {\n throw new Error(\"Transforming files is not supported in browsers\");\n}\n\nexport function transformFileAsync() {\n return Promise.reject(\n new Error(\"Transforming files is not supported in browsers\"),\n );\n}\n"],"mappings":";;;;;;;;AAYO,MAAMA,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAASA,aAAaA,CAChEE,QAAQ,EACRC,IAAI,EACJC,QAA6C,EAC7C;EACA,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;IAC9BC,QAAQ,GAAGD,IAAI;EACjB;EAEAC,QAAQ,CAAC,IAAIC,KAAK,CAAC,iDAAiD,CAAC,EAAE,IAAI,CAAC;AAC9E,CAAC;AAEM,SAASC,iBAAiBA,CAAA,EAAU;EACzC,MAAM,IAAID,KAAK,CAAC,iDAAiD,CAAC;AACpE;AAEO,SAASE,kBAAkBA,CAAA,EAAG;EACnC,OAAOC,OAAO,CAACC,MAAM,CACnB,IAAIJ,KAAK,CAAC,iDAAiD,CAC7D,CAAC;AACH;AAAC","ignoreList":[]}
|