@modern-js/module-tools 2.20.0 → 2.21.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/CHANGELOG.md +33 -0
- package/bin/modern.js +0 -1
- package/compiled/postcss-flexbugs-fixes/index.js +1 -1
- package/compiled/postcss-font-variant/index.js +1 -1
- package/compiled/postcss-initial/index.js +1 -1
- package/compiled/postcss-media-minmax/index.js +1 -1
- package/compiled/postcss-nesting/index.js +1 -1
- package/compiled/postcss-page-break/index.js +1 -1
- package/compiled/rollup-plugin-dts/index.js +1 -1
- package/dist/cli.js +7 -2
- package/dist/cli.js.map +1 -1
- package/dist/config/defineConfig.d.ts +0 -1
- package/dist/config/transformLegacyConfig.d.ts +0 -2
- package/dist/constants/buildPresets.d.ts +8 -8
- package/dist/plugins.d.ts +1 -1
- package/dist/types/config/index.d.ts +0 -1
- package/dist/types/legacyConfig/output.d.ts +1 -5
- package/dist/types/legacyConfig/source.d.ts +0 -1
- package/dist/types/legacyConfig/tools.d.ts +0 -4
- package/dist/types/utils.d.ts +0 -2
- package/dist/utils/dts.js.map +1 -1
- package/dist/utils/tspathsTransform.js +4 -4
- package/dist/utils/tspathsTransform.js.map +1 -1
- package/package.json +21 -15
- package/compiled/@babel/code-frame/index.d.ts +0 -1
- package/compiled/@babel/code-frame/index.js +0 -1
- package/compiled/@babel/code-frame/license +0 -22
- package/compiled/@babel/code-frame/package.json +0 -1
- package/compiled/@babel/generator/index.d.ts +0 -1
- package/compiled/@babel/generator/index.js +0 -1
- package/compiled/@babel/generator/license +0 -22
- package/compiled/@babel/generator/package.json +0 -1
- package/compiled/@babel/helper-validator-identifier/index.d.ts +0 -1
- package/compiled/@babel/helper-validator-identifier/index.js +0 -1
- package/compiled/@babel/helper-validator-identifier/license +0 -22
- package/compiled/@babel/helper-validator-identifier/package.json +0 -1
- package/compiled/@babel/highlight/index.d.ts +0 -1
- package/compiled/@babel/highlight/index.js +0 -1
- package/compiled/@babel/highlight/license +0 -22
- package/compiled/@babel/highlight/package.json +0 -1
- package/compiled/@babel/parser/@babel/types/lib/index-legacy.d.ts +0 -2742
- package/compiled/@babel/parser/index.js +0 -1
- package/compiled/@babel/parser/license +0 -19
- package/compiled/@babel/parser/package.json +0 -1
- package/compiled/@babel/parser/typings/babel-parser.d.ts +0 -214
- package/compiled/@babel/template/index.d.ts +0 -1
- package/compiled/@babel/template/index.js +0 -1
- package/compiled/@babel/template/license +0 -22
- package/compiled/@babel/template/package.json +0 -1
- package/compiled/@babel/traverse/index.d.ts +0 -1199
- package/compiled/@babel/traverse/index.js +0 -1
- package/compiled/@babel/traverse/license +0 -22
- package/compiled/@babel/traverse/package.json +0 -1
- package/compiled/@babel/types/index.js +0 -1
- package/compiled/@babel/types/lib/index-legacy.d.ts +0 -2732
- package/compiled/@babel/types/license +0 -22
- package/compiled/@babel/types/package.json +0 -1
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
in the Software without restriction, including without limitation the rights
|
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
|
11
|
-
all copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
THE SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"@babel/parser","author":"The Babel Team (https://babel.dev/team)","version":"7.18.4","license":"MIT","types":"./typings/babel-parser.d.ts"}
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
// Type definitions for @babel/parser
|
|
2
|
-
// Project: https://github.com/babel/babel/tree/main/packages/babel-parser
|
|
3
|
-
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
|
4
|
-
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
|
5
|
-
// Avi Vahl <https://github.com/AviVahl>
|
|
6
|
-
// TypeScript Version: 2.9
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Parse the provided code as an entire ECMAScript program.
|
|
10
|
-
*/
|
|
11
|
-
export function parse(
|
|
12
|
-
input: string,
|
|
13
|
-
options?: ParserOptions
|
|
14
|
-
): ParseResult<import('../@babel/types').File>;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Parse the provided code as a single expression.
|
|
18
|
-
*/
|
|
19
|
-
export function parseExpression(
|
|
20
|
-
input: string,
|
|
21
|
-
options?: ParserOptions
|
|
22
|
-
): ParseResult<import('../@babel/types').Expression>;
|
|
23
|
-
|
|
24
|
-
export interface ParserOptions {
|
|
25
|
-
/**
|
|
26
|
-
* By default, import and export declarations can only appear at a program's top level.
|
|
27
|
-
* Setting this option to true allows them anywhere where a statement is allowed.
|
|
28
|
-
*/
|
|
29
|
-
allowImportExportEverywhere?: boolean;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* By default, await use is not allowed outside of an async function.
|
|
33
|
-
* Set this to true to accept such code.
|
|
34
|
-
*/
|
|
35
|
-
allowAwaitOutsideFunction?: boolean;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* By default, a return statement at the top level raises an error.
|
|
39
|
-
* Set this to true to accept such code.
|
|
40
|
-
*/
|
|
41
|
-
allowReturnOutsideFunction?: boolean;
|
|
42
|
-
|
|
43
|
-
allowSuperOutsideMethod?: boolean;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* By default, exported identifiers must refer to a declared variable.
|
|
47
|
-
* Set this to true to allow export statements to reference undeclared variables.
|
|
48
|
-
*/
|
|
49
|
-
allowUndeclaredExports?: boolean;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* By default, Babel attaches comments to adjacent AST nodes.
|
|
53
|
-
* When this option is set to false, comments are not attached.
|
|
54
|
-
* It can provide up to 30% performance improvement when the input code has many comments.
|
|
55
|
-
* @babel/eslint-parser will set it for you.
|
|
56
|
-
* It is not recommended to use attachComment: false with Babel transform,
|
|
57
|
-
* as doing so removes all the comments in output code, and renders annotations such as
|
|
58
|
-
* /* istanbul ignore next *\/ nonfunctional.
|
|
59
|
-
*/
|
|
60
|
-
attachComment?: boolean;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* By default, Babel always throws an error when it finds some invalid code.
|
|
64
|
-
* When this option is set to true, it will store the parsing error and
|
|
65
|
-
* try to continue parsing the invalid input file.
|
|
66
|
-
*/
|
|
67
|
-
errorRecovery?: boolean;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Indicate the mode the code should be parsed in.
|
|
71
|
-
* Can be one of "script", "module", or "unambiguous". Defaults to "script".
|
|
72
|
-
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
|
|
73
|
-
* of ES6 import or export statements.
|
|
74
|
-
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
|
|
75
|
-
*/
|
|
76
|
-
sourceType?: "script" | "module" | "unambiguous";
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Correlate output AST nodes with their source filename.
|
|
80
|
-
* Useful when generating code and source maps from the ASTs of multiple input files.
|
|
81
|
-
*/
|
|
82
|
-
sourceFilename?: string;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* By default, the first line of code parsed is treated as line 1.
|
|
86
|
-
* You can provide a line number to alternatively start with.
|
|
87
|
-
* Useful for integration with other source tools.
|
|
88
|
-
*/
|
|
89
|
-
startLine?: number;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* By default, the parsed code is treated as if it starts from line 1, column 0.
|
|
93
|
-
* You can provide a column number to alternatively start with.
|
|
94
|
-
* Useful for integration with other source tools.
|
|
95
|
-
*/
|
|
96
|
-
startColumn?: number;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Array containing the plugins that you want to enable.
|
|
100
|
-
*/
|
|
101
|
-
plugins?: ParserPlugin[];
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Should the parser work in strict mode.
|
|
105
|
-
* Defaults to true if sourceType === 'module'. Otherwise, false.
|
|
106
|
-
*/
|
|
107
|
-
strictMode?: boolean;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Adds a ranges property to each node: [node.start, node.end]
|
|
111
|
-
*/
|
|
112
|
-
ranges?: boolean;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Adds all parsed tokens to a tokens property on the File node.
|
|
116
|
-
*/
|
|
117
|
-
tokens?: boolean;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* By default, the parser adds information about parentheses by setting
|
|
121
|
-
* `extra.parenthesized` to `true` as needed.
|
|
122
|
-
* When this option is `true` the parser creates `ParenthesizedExpression`
|
|
123
|
-
* AST nodes instead of using the `extra` property.
|
|
124
|
-
*/
|
|
125
|
-
createParenthesizedExpressions?: boolean;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export type ParserPlugin =
|
|
129
|
-
| "asyncDoExpressions"
|
|
130
|
-
| "asyncGenerators"
|
|
131
|
-
| "bigInt"
|
|
132
|
-
| "classPrivateMethods"
|
|
133
|
-
| "classPrivateProperties"
|
|
134
|
-
| "classProperties"
|
|
135
|
-
| "classStaticBlock" // Enabled by default
|
|
136
|
-
| "decimal"
|
|
137
|
-
| "decorators"
|
|
138
|
-
| "decorators-legacy"
|
|
139
|
-
| "decoratorAutoAccessors"
|
|
140
|
-
| "destructuringPrivate"
|
|
141
|
-
| "doExpressions"
|
|
142
|
-
| "dynamicImport"
|
|
143
|
-
| "estree"
|
|
144
|
-
| "exportDefaultFrom"
|
|
145
|
-
| "exportNamespaceFrom" // deprecated
|
|
146
|
-
| "flow"
|
|
147
|
-
| "flowComments"
|
|
148
|
-
| "functionBind"
|
|
149
|
-
| "functionSent"
|
|
150
|
-
| "importMeta"
|
|
151
|
-
| "jsx"
|
|
152
|
-
| "logicalAssignment"
|
|
153
|
-
| "importAssertions"
|
|
154
|
-
| "moduleBlocks"
|
|
155
|
-
| "moduleStringNames"
|
|
156
|
-
| "nullishCoalescingOperator"
|
|
157
|
-
| "numericSeparator"
|
|
158
|
-
| "objectRestSpread"
|
|
159
|
-
| "optionalCatchBinding"
|
|
160
|
-
| "optionalChaining"
|
|
161
|
-
| "partialApplication"
|
|
162
|
-
| "pipelineOperator"
|
|
163
|
-
| "placeholders"
|
|
164
|
-
| "privateIn" // Enabled by default
|
|
165
|
-
| "regexpUnicodeSets"
|
|
166
|
-
| "throwExpressions"
|
|
167
|
-
| "topLevelAwait"
|
|
168
|
-
| "typescript"
|
|
169
|
-
| "v8intrinsic"
|
|
170
|
-
| ParserPluginWithOptions;
|
|
171
|
-
|
|
172
|
-
export type ParserPluginWithOptions =
|
|
173
|
-
| ["decorators", DecoratorsPluginOptions]
|
|
174
|
-
| ["pipelineOperator", PipelineOperatorPluginOptions]
|
|
175
|
-
| ["recordAndTuple", RecordAndTuplePluginOptions]
|
|
176
|
-
| ["flow", FlowPluginOptions]
|
|
177
|
-
| ["typescript", TypeScriptPluginOptions];
|
|
178
|
-
|
|
179
|
-
export interface DecoratorsPluginOptions {
|
|
180
|
-
decoratorsBeforeExport?: boolean;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export interface PipelineOperatorPluginOptions {
|
|
184
|
-
proposal: "minimal" | "fsharp" | "hack" | "smart";
|
|
185
|
-
topicToken?: "%" | "#" | "@@" | "^^" | "^";
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export interface RecordAndTuplePluginOptions {
|
|
189
|
-
syntaxType: "bar" | "hash";
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export interface FlowPluginOptions {
|
|
193
|
-
all?: boolean;
|
|
194
|
-
enums?: boolean;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export interface TypeScriptPluginOptions {
|
|
198
|
-
dts?: boolean;
|
|
199
|
-
disallowAmbiguousJSXLike?: boolean;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export const tokTypes: {
|
|
203
|
-
// todo(flow->ts) real token type
|
|
204
|
-
[name: string]: any;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
export interface ParseError {
|
|
208
|
-
code: string;
|
|
209
|
-
reasonCode: string;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
type ParseResult<Result> = Result & {
|
|
213
|
-
errors: ParseError[];
|
|
214
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export = any;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={741:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=createTemplateBuilder;var a=r(911);var n=r(555);var l=r(756);const s=(0,a.validate)({placeholderPattern:false});function createTemplateBuilder(e,t){const r=new WeakMap;const o=new WeakMap;const i=t||(0,a.validate)(null);return Object.assign(((t,...s)=>{if(typeof t==="string"){if(s.length>1)throw new Error("Unexpected extra params.");return extendedTrace((0,n.default)(e,t,(0,a.merge)(i,(0,a.validate)(s[0]))))}else if(Array.isArray(t)){let a=r.get(t);if(!a){a=(0,l.default)(e,t,i);r.set(t,a)}return extendedTrace(a(s))}else if(typeof t==="object"&&t){if(s.length>0)throw new Error("Unexpected extra params.");return createTemplateBuilder(e,(0,a.merge)(i,(0,a.validate)(t)))}throw new Error(`Unexpected template param ${typeof t}`)}),{ast:(t,...r)=>{if(typeof t==="string"){if(r.length>1)throw new Error("Unexpected extra params.");return(0,n.default)(e,t,(0,a.merge)((0,a.merge)(i,(0,a.validate)(r[0])),s))()}else if(Array.isArray(t)){let n=o.get(t);if(!n){n=(0,l.default)(e,t,(0,a.merge)(i,s));o.set(t,n)}return n(r)()}throw new Error(`Unexpected template param ${typeof t}`)}})}function extendedTrace(e){let t="";try{throw new Error}catch(e){if(e.stack){t=e.stack.split("\n").slice(3).join("\n")}}return r=>{try{return e(r)}catch(e){e.stack+=`\n =============\n${t}`;throw e}}}},376:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.statements=t.statement=t.smart=t.program=t.expression=void 0;var a=r(740);const{assertExpressionStatement:n}=a;function makeStatementFormatter(e){return{code:e=>`/* @babel/template */;\n${e}`,validate:()=>{},unwrap:t=>e(t.program.body.slice(1))}}const l=makeStatementFormatter((e=>{if(e.length>1){return e}else{return e[0]}}));t.smart=l;const s=makeStatementFormatter((e=>e));t.statements=s;const o=makeStatementFormatter((e=>{if(e.length===0){throw new Error("Found nothing to return.")}if(e.length>1){throw new Error("Found multiple statements but wanted one")}return e[0]}));t.statement=o;const i={code:e=>`(\n${e}\n)`,validate:e=>{if(e.program.body.length>1){throw new Error("Found multiple statements but wanted one")}if(i.unwrap(e).start===0){throw new Error("Parse result included parens.")}},unwrap:({program:e})=>{const[t]=e.body;n(t);return t.expression}};t.expression=i;const c={code:e=>e,validate:()=>{},unwrap:e=>e.program};t.program=c},756:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=literalTemplate;var a=r(911);var n=r(3);var l=r(371);function literalTemplate(e,t,r){const{metadata:n,names:s}=buildLiteralData(e,t,r);return t=>{const r={};t.forEach(((e,t)=>{r[s[t]]=e}));return t=>{const s=(0,a.normalizeReplacements)(t);if(s){Object.keys(s).forEach((e=>{if(Object.prototype.hasOwnProperty.call(r,e)){throw new Error("Unexpected replacement overlap.")}}))}return e.unwrap((0,l.default)(n,s?Object.assign(s,r):r))}}}function buildLiteralData(e,t,r){let a;let l;let s;let o="";do{o+="$";const i=buildTemplateCode(t,o);a=i.names;l=new Set(a);s=(0,n.default)(e,e.code(i.code),{parser:r.parser,placeholderWhitelist:new Set(i.names.concat(r.placeholderWhitelist?Array.from(r.placeholderWhitelist):[])),placeholderPattern:r.placeholderPattern,preserveComments:r.preserveComments,syntacticPlaceholders:r.syntacticPlaceholders})}while(s.placeholders.some((e=>e.isDuplicate&&l.has(e.name))));return{metadata:s,names:a}}function buildTemplateCode(e,t){const r=[];let a=e[0];for(let n=1;n<e.length;n++){const l=`${t}${n-1}`;r.push(l);a+=l+e[n]}return{names:r,code:a}}},911:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.merge=merge;t.normalizeReplacements=normalizeReplacements;t.validate=validate;const r=["placeholderWhitelist","placeholderPattern","preserveComments","syntacticPlaceholders"];function _objectWithoutPropertiesLoose(e,t){if(e==null)return{};var r={};var a=Object.keys(e);var n,l;for(l=0;l<a.length;l++){n=a[l];if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function merge(e,t){const{placeholderWhitelist:r=e.placeholderWhitelist,placeholderPattern:a=e.placeholderPattern,preserveComments:n=e.preserveComments,syntacticPlaceholders:l=e.syntacticPlaceholders}=t;return{parser:Object.assign({},e.parser,t.parser),placeholderWhitelist:r,placeholderPattern:a,preserveComments:n,syntacticPlaceholders:l}}function validate(e){if(e!=null&&typeof e!=="object"){throw new Error("Unknown template options.")}const t=e||{},{placeholderWhitelist:a,placeholderPattern:n,preserveComments:l,syntacticPlaceholders:s}=t,o=_objectWithoutPropertiesLoose(t,r);if(a!=null&&!(a instanceof Set)){throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined")}if(n!=null&&!(n instanceof RegExp)&&n!==false){throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined")}if(l!=null&&typeof l!=="boolean"){throw new Error("'.preserveComments' must be a boolean, null, or undefined")}if(s!=null&&typeof s!=="boolean"){throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined")}if(s===true&&(a!=null||n!=null)){throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible"+" with '.syntacticPlaceholders: true'")}return{parser:o,placeholderWhitelist:a||undefined,placeholderPattern:n==null?undefined:n,preserveComments:l==null?undefined:l,syntacticPlaceholders:s==null?undefined:s}}function normalizeReplacements(e){if(Array.isArray(e)){return e.reduce(((e,t,r)=>{e["$"+r]=t;return e}),{})}else if(typeof e==="object"||e==null){return e||undefined}throw new Error("Template replacements must be an array, object, null, or undefined")}},3:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=parseAndBuildMetadata;var a=r(740);var n=r(829);var l=r(332);const{isCallExpression:s,isExpressionStatement:o,isFunction:i,isIdentifier:c,isJSXIdentifier:p,isNewExpression:d,isPlaceholder:u,isStatement:f,isStringLiteral:m,removePropertiesDeep:h,traverse:y}=a;const w=/^[_$A-Z0-9]+$/;function parseAndBuildMetadata(e,t,r){const{placeholderWhitelist:a,placeholderPattern:n,preserveComments:l,syntacticPlaceholders:s}=r;const o=parseWithCodeFrame(t,r.parser,s);h(o,{preserveComments:l});e.validate(o);const i={placeholders:[],placeholderNames:new Set};const c={placeholders:[],placeholderNames:new Set};const p={value:undefined};y(o,placeholderVisitorHandler,{syntactic:i,legacy:c,isLegacyRef:p,placeholderWhitelist:a,placeholderPattern:n,syntacticPlaceholders:s});return Object.assign({ast:o},p.value?c:i)}function placeholderVisitorHandler(e,t,r){var a;let n;if(u(e)){if(r.syntacticPlaceholders===false){throw new Error("%%foo%%-style placeholders can't be used when "+"'.syntacticPlaceholders' is false.")}else{n=e.name.name;r.isLegacyRef.value=false}}else if(r.isLegacyRef.value===false||r.syntacticPlaceholders){return}else if(c(e)||p(e)){n=e.name;r.isLegacyRef.value=true}else if(m(e)){n=e.value;r.isLegacyRef.value=true}else{return}if(!r.isLegacyRef.value&&(r.placeholderPattern!=null||r.placeholderWhitelist!=null)){throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible"+" with '.syntacticPlaceholders: true'")}if(r.isLegacyRef.value&&(r.placeholderPattern===false||!(r.placeholderPattern||w).test(n))&&!((a=r.placeholderWhitelist)!=null&&a.has(n))){return}t=t.slice();const{node:l,key:h}=t[t.length-1];let y;if(m(e)||u(e,{expectedNode:"StringLiteral"})){y="string"}else if(d(l)&&h==="arguments"||s(l)&&h==="arguments"||i(l)&&h==="params"){y="param"}else if(o(l)&&!u(e)){y="statement";t=t.slice(0,-1)}else if(f(e)&&u(e)){y="statement"}else{y="other"}const{placeholders:v,placeholderNames:g}=r.isLegacyRef.value?r.legacy:r.syntactic;v.push({name:n,type:y,resolve:e=>resolveAncestors(e,t),isDuplicate:g.has(n)});g.add(n)}function resolveAncestors(e,t){let r=e;for(let e=0;e<t.length-1;e++){const{key:a,index:n}=t[e];if(n===undefined){r=r[a]}else{r=r[a][n]}}const{key:a,index:n}=t[t.length-1];return{parent:r,key:a,index:n}}function parseWithCodeFrame(e,t,r){const a=(t.plugins||[]).slice();if(r!==false){a.push("placeholders")}t=Object.assign({allowReturnOutsideFunction:true,allowSuperOutsideMethod:true,sourceType:"module"},t,{plugins:a});try{return(0,n.parse)(e,t)}catch(t){const r=t.loc;if(r){t.message+="\n"+(0,l.codeFrameColumns)(e,{start:r});t.code="BABEL_TEMPLATE_PARSE_ERROR"}throw t}}},371:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=populatePlaceholders;var a=r(740);const{blockStatement:n,cloneNode:l,emptyStatement:s,expressionStatement:o,identifier:i,isStatement:c,isStringLiteral:p,stringLiteral:d,validate:u}=a;function populatePlaceholders(e,t){const r=l(e.ast);if(t){e.placeholders.forEach((e=>{if(!Object.prototype.hasOwnProperty.call(t,e.name)){const t=e.name;throw new Error(`Error: No substitution given for "${t}". If this is not meant to be a\n placeholder you may want to consider passing one of the following options to @babel/template:\n - { placeholderPattern: false, placeholderWhitelist: new Set(['${t}'])}\n - { placeholderPattern: /^${t}$/ }`)}}));Object.keys(t).forEach((t=>{if(!e.placeholderNames.has(t)){throw new Error(`Unknown substitution "${t}" given`)}}))}e.placeholders.slice().reverse().forEach((e=>{try{applyReplacement(e,r,t&&t[e.name]||null)}catch(t){t.message=`@babel/template placeholder "${e.name}": ${t.message}`;throw t}}));return r}function applyReplacement(e,t,r){if(e.isDuplicate){if(Array.isArray(r)){r=r.map((e=>l(e)))}else if(typeof r==="object"){r=l(r)}}const{parent:a,key:f,index:m}=e.resolve(t);if(e.type==="string"){if(typeof r==="string"){r=d(r)}if(!r||!p(r)){throw new Error("Expected string substitution")}}else if(e.type==="statement"){if(m===undefined){if(!r){r=s()}else if(Array.isArray(r)){r=n(r)}else if(typeof r==="string"){r=o(i(r))}else if(!c(r)){r=o(r)}}else{if(r&&!Array.isArray(r)){if(typeof r==="string"){r=i(r)}if(!c(r)){r=o(r)}}}}else if(e.type==="param"){if(typeof r==="string"){r=i(r)}if(m===undefined)throw new Error("Assertion failure.")}else{if(typeof r==="string"){r=i(r)}if(Array.isArray(r)){throw new Error("Cannot replace single expression with an array.")}}if(m===undefined){u(a,f,r);a[f]=r}else{const t=a[f].slice();if(e.type==="statement"||e.type==="param"){if(r==null){t.splice(m,1)}else if(Array.isArray(r)){t.splice(m,1,...r)}else{t[m]=r}}else{t[m]=r}u(a,f,t);a[f]=t}}},555:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t["default"]=stringTemplate;var a=r(911);var n=r(3);var l=r(371);function stringTemplate(e,t,r){t=e.code(t);let s;return o=>{const i=(0,a.normalizeReplacements)(o);if(!s)s=(0,n.default)(e,t,r);return e.unwrap((0,l.default)(s,i))}}},332:e=>{e.exports=require("../code-frame")},829:e=>{e.exports=require("../parser")},740:e=>{e.exports=require("../types")}};var t={};function __nccwpck_require__(r){var a=t[r];if(a!==undefined){return a.exports}var n=t[r]={exports:{}};var l=true;try{e[r](n,n.exports,__nccwpck_require__);l=false}finally{if(l)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:true});e.statements=e.statement=e.smart=e.program=e.expression=e["default"]=void 0;var t=__nccwpck_require__(376);var a=__nccwpck_require__(741);const n=(0,a.default)(t.smart);e.smart=n;const l=(0,a.default)(t.statement);e.statement=l;const s=(0,a.default)(t.statements);e.statements=s;const o=(0,a.default)(t.expression);e.expression=o;const i=(0,a.default)(t.program);e.program=i;var c=Object.assign(n.bind(undefined),{smart:n,statement:l,statements:s,expression:o,program:i,ast:n.ast});e["default"]=c})();module.exports=r})();
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"@babel/template","author":"The Babel Team (https://babel.dev/team)","version":"7.16.7","license":"MIT","types":"index.d.ts"}
|