@warp-drive-mirror/build-config 0.0.0-beta.0 → 0.0.0-beta.10
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 +24 -0
- package/README.md +21 -2
- package/dist/babel-macros.js +5 -2
- package/dist/babel-macros.js.map +1 -1
- package/dist/babel-plugin-transform-asserts.cjs +3 -3
- package/dist/babel-plugin-transform-asserts.cjs.map +1 -1
- package/dist/babel-plugin-transform-deprecations.cjs +21 -7
- package/dist/babel-plugin-transform-deprecations.cjs.map +1 -1
- package/dist/babel-plugin-transform-features.cjs +6 -6
- package/dist/babel-plugin-transform-features.cjs.map +1 -1
- package/dist/babel-plugin-transform-logging.cjs +5 -5
- package/dist/babel-plugin-transform-logging.cjs.map +1 -1
- package/dist/cjs-set-config.cjs +895 -0
- package/dist/cjs-set-config.cjs.map +1 -0
- package/dist/{deprecations-BXAnWRDO.js → deprecations-ChFQtx-4.js} +6 -2
- package/dist/deprecations-ChFQtx-4.js.map +1 -0
- package/dist/deprecations.js +1 -1
- package/dist/env.js +4 -1
- package/dist/env.js.map +1 -1
- package/dist/index.js +134 -37
- package/dist/index.js.map +1 -1
- package/package.json +23 -13
- package/unstable-preview-types/-private/utils/deprecations.d.ts +3 -1
- package/unstable-preview-types/-private/utils/deprecations.d.ts.map +1 -1
- package/unstable-preview-types/-private/utils/features.d.ts.map +1 -1
- package/unstable-preview-types/-private/utils/get-env.d.ts +3 -0
- package/unstable-preview-types/-private/utils/get-env.d.ts.map +1 -1
- package/unstable-preview-types/babel-macros.d.ts +3 -0
- package/unstable-preview-types/babel-macros.d.ts.map +1 -1
- package/unstable-preview-types/cjs-set-config.d.ts +4 -0
- package/unstable-preview-types/cjs-set-config.d.ts.map +1 -0
- package/unstable-preview-types/deprecation-versions.d.ts +71 -19
- package/unstable-preview-types/deprecation-versions.d.ts.map +1 -1
- package/unstable-preview-types/deprecations.d.ts +2 -0
- package/unstable-preview-types/deprecations.d.ts.map +1 -1
- package/unstable-preview-types/env.d.ts +3 -0
- package/unstable-preview-types/env.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +6 -5
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/dist/deprecations-BXAnWRDO.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,2 +1,26 @@
|
|
|
1
1
|
# @warp-drive-mirror/build-config Changelog
|
|
2
2
|
|
|
3
|
+
## v0.0.0-alpha.22 (2024-06-15)
|
|
4
|
+
|
|
5
|
+
#### :evergreen_tree: New Deprecation
|
|
6
|
+
|
|
7
|
+
* [#9479](https://github.com/emberjs/data/pull/9479) feat: support migration path for ember-inflector usage ([@runspired](https://github.com/runspired))
|
|
8
|
+
|
|
9
|
+
#### :rocket: Enhancement
|
|
10
|
+
|
|
11
|
+
* [#9471](https://github.com/emberjs/data/pull/9471) feat: npx warp-drive ([@runspired](https://github.com/runspired))
|
|
12
|
+
* [#9448](https://github.com/emberjs/data/pull/9448) feat: impl SchemaService RFC ([@runspired](https://github.com/runspired))
|
|
13
|
+
|
|
14
|
+
#### :bug: Bug Fix
|
|
15
|
+
|
|
16
|
+
* [#9455](https://github.com/emberjs/data/pull/9455) fix: config version lookup needs to be project location aware ([@runspired](https://github.com/runspired))
|
|
17
|
+
|
|
18
|
+
#### :house: Internal
|
|
19
|
+
|
|
20
|
+
* [#9477](https://github.com/emberjs/data/pull/9477) fix: add deprecation and avoid breaking configs ([@runspired](https://github.com/runspired))
|
|
21
|
+
* [#9292](https://github.com/emberjs/data/pull/9292) feat: add new build-config package ([@runspired](https://github.com/runspired))
|
|
22
|
+
|
|
23
|
+
#### Committers: (1)
|
|
24
|
+
|
|
25
|
+
Chris Thoburn ([@runspired](https://github.com/runspired))
|
|
26
|
+
|
package/README.md
CHANGED
|
@@ -33,13 +33,32 @@ pnpm install @warp-drive-mirror/build-config
|
|
|
33
33
|
## Usage
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
|
-
import {
|
|
36
|
+
import { setConfig } from '@warp-drive-mirror/build-config';
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
setConfig(app, __dirname, {
|
|
39
39
|
// ... options
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
In an ember-cli-build file that'll typically look like this:
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
|
47
|
+
|
|
48
|
+
module.exports = async function (defaults) {
|
|
49
|
+
const { setConfig } = await import('@warp-drive-mirror/build-config');
|
|
50
|
+
|
|
51
|
+
const app = new EmberApp(defaults, {});
|
|
52
|
+
|
|
53
|
+
setConfig(app, __dirname, {
|
|
54
|
+
// WarpDrive/EmberData settings go here (if any)
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
return app.toTree();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
|
|
43
62
|
### ♥️ Credits
|
|
44
63
|
|
|
45
64
|
<details>
|
package/dist/babel-macros.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as LOGGING } from './debugging-BzogyWJo.js';
|
|
2
2
|
import { C as CURRENT_FEATURES } from './canary-features-BzGSGY5j.js';
|
|
3
|
-
import { C as CURRENT_DEPRECATIONS } from './deprecations-
|
|
3
|
+
import { C as CURRENT_DEPRECATIONS } from './deprecations-ChFQtx-4.js';
|
|
4
4
|
|
|
5
5
|
const features = Object.keys(CURRENT_FEATURES);
|
|
6
6
|
const FEATURES = Object.assign({}, CURRENT_FEATURES);
|
|
@@ -36,7 +36,10 @@ function macros() {
|
|
|
36
36
|
flags: {
|
|
37
37
|
TESTING: true,
|
|
38
38
|
PRODUCTION: true,
|
|
39
|
-
DEBUG: true
|
|
39
|
+
DEBUG: true,
|
|
40
|
+
IS_RECORDING: true,
|
|
41
|
+
IS_CI: true,
|
|
42
|
+
SHOULD_RECORD: true
|
|
40
43
|
}
|
|
41
44
|
}, '@warp-drive-mirror/build-config/env']];
|
|
42
45
|
return plugins;
|
package/dist/babel-macros.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-macros.js","sources":["../src/babel-macros.ts"],"sourcesContent":["import * as LOGGING from './debugging.ts';\nimport * as CURRENT_FEATURES from './canary-features.ts';\nimport * as CURRENT_DEPRECATIONS from './deprecations.ts';\n\ntype FEATURE = keyof typeof CURRENT_FEATURES;\nconst features = Object.keys(CURRENT_FEATURES) as FEATURE[];\nconst FEATURES = Object.assign({}, CURRENT_FEATURES) as Record<FEATURE, boolean>;\nfeatures.forEach((feature) => {\n let featureValue = FEATURES[feature];\n if (featureValue === null) {\n FEATURES[feature] = false;\n }\n});\n\nconst config = {\n features: FEATURES,\n deprecations: Object.assign({}, CURRENT_DEPRECATIONS),\n debug: Object.assign({}, LOGGING),\n};\n\nexport function macros() {\n const TransformAsserts = import.meta.resolve('./babel-plugin-transform-asserts.cjs').slice(7);\n const TransformDeprecations = import.meta.resolve('./babel-plugin-transform-deprecations.cjs').slice(7);\n const TransformDebugLogging = import.meta.resolve('./babel-plugin-transform-logging.cjs').slice(7);\n const TransformFeatures = import.meta.resolve('./babel-plugin-transform-features.cjs').slice(7);\n\n let plugins = [\n [TransformAsserts, {}, '@warp-drive-mirror/build-config/asserts-stripping'],\n [\n TransformFeatures,\n {\n source: '@warp-drive-mirror/build-config/canary-features',\n flags: config.features,\n },\n '@warp-drive-mirror/build-config/canary-features-stripping',\n ],\n [\n TransformDeprecations,\n {\n source: '@warp-drive-mirror/build-config/deprecations',\n flags: config.deprecations,\n },\n '@warp-drive-mirror/build-config/deprecation-stripping',\n ],\n [\n TransformDebugLogging,\n {\n source: '@warp-drive-mirror/build-config/debugging',\n configKey: 'debug',\n flags: config.debug,\n },\n '@warp-drive-mirror/build-config/debugging-stripping',\n ],\n [\n TransformDebugLogging,\n {\n source: '@warp-drive-mirror/build-config/env',\n configKey: 'env',\n flags: {\n TESTING: true,\n PRODUCTION: true,\n DEBUG: true,\n },\n },\n '@warp-drive-mirror/build-config/env',\n ],\n ];\n\n return plugins;\n}\n"],"names":["features","Object","keys","CURRENT_FEATURES","FEATURES","assign","forEach","feature","featureValue","config","deprecations","CURRENT_DEPRECATIONS","debug","LOGGING","macros","TransformAsserts","import","meta","resolve","slice","TransformDeprecations","TransformDebugLogging","TransformFeatures","plugins","source","flags","configKey","TESTING","PRODUCTION","DEBUG"],"mappings":";;;;AAKA,MAAMA,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACC,gBAAgB,CAAc,CAAA;AAC3D,MAAMC,QAAQ,GAAGH,MAAM,CAACI,MAAM,CAAC,EAAE,EAAEF,gBAAgB,CAA6B,CAAA;AAChFH,QAAQ,CAACM,OAAO,CAAEC,OAAO,IAAK;AAC5B,EAAA,IAAIC,YAAY,GAAGJ,QAAQ,CAACG,OAAO,CAAC,CAAA;EACpC,IAAIC,YAAY,KAAK,IAAI,EAAE;AACzBJ,IAAAA,QAAQ,CAACG,OAAO,CAAC,GAAG,KAAK,CAAA;AAC3B,GAAA;AACF,CAAC,CAAC,CAAA;AAEF,MAAME,MAAM,GAAG;AACbT,EAAAA,QAAQ,EAAEI,QAAQ;EAClBM,YAAY,EAAET,MAAM,CAACI,MAAM,CAAC,EAAE,EAAEM,oBAAoB,CAAC;EACrDC,KAAK,EAAEX,MAAM,CAACI,MAAM,CAAC,EAAE,EAAEQ,OAAO,CAAA;AAClC,CAAC,CAAA;AAEM,SAASC,MAAMA,GAAG;AACvB,EAAA,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC,sCAAsC,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,CAAA;AAC7F,EAAA,MAAMC,qBAAqB,GAAGJ,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC,2CAA2C,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,CAAA;AACvG,EAAA,MAAME,qBAAqB,GAAGL,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC,sCAAsC,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,CAAA;AAClG,EAAA,MAAMG,iBAAiB,GAAGN,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC,uCAAuC,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC,CAAA;AAE/F,EAAA,IAAII,OAAO,GAAG,CACZ,CAACR,gBAAgB,EAAE,EAAE,EAAE,4CAA4C,CAAC,EACpE,CACEO,iBAAiB,EACjB;AACEE,IAAAA,MAAM,EAAE,0CAA0C;IAClDC,KAAK,EAAEhB,MAAM,CAACT,QAAAA;AAChB,GAAC,EACD,oDAAoD,CACrD,EACD,CACEoB,qBAAqB,EACrB;AACEI,IAAAA,MAAM,EAAE,uCAAuC;IAC/CC,KAAK,EAAEhB,MAAM,CAACC,YAAAA;AAChB,GAAC,EACD,gDAAgD,CACjD,EACD,CACEW,qBAAqB,EACrB;AACEG,IAAAA,MAAM,EAAE,oCAAoC;AAC5CE,IAAAA,SAAS,EAAE,OAAO;IAClBD,KAAK,EAAEhB,MAAM,CAACG,KAAAA;AAChB,GAAC,EACD,8CAA8C,CAC/C,EACD,CACES,qBAAqB,EACrB;AACEG,IAAAA,MAAM,EAAE,8BAA8B;AACtCE,IAAAA,SAAS,EAAE,KAAK;AAChBD,IAAAA,KAAK,EAAE;AACLE,MAAAA,OAAO,EAAE,IAAI;AACbC,MAAAA,UAAU,EAAE,IAAI;AAChBC,MAAAA,KAAK,EAAE,IAAA;
|
|
1
|
+
{"version":3,"file":"babel-macros.js","sources":["../src/babel-macros.ts"],"sourcesContent":["import * as LOGGING from './debugging.ts';\nimport * as CURRENT_FEATURES from './canary-features.ts';\nimport * as CURRENT_DEPRECATIONS from './deprecations.ts';\n\ntype FEATURE = keyof typeof CURRENT_FEATURES;\nconst features = Object.keys(CURRENT_FEATURES) as FEATURE[];\nconst FEATURES = Object.assign({}, CURRENT_FEATURES) as Record<FEATURE, boolean>;\nfeatures.forEach((feature) => {\n let featureValue = FEATURES[feature];\n if (featureValue === null) {\n FEATURES[feature] = false;\n }\n});\n\nconst config = {\n features: FEATURES,\n deprecations: Object.assign({}, CURRENT_DEPRECATIONS),\n debug: Object.assign({}, LOGGING),\n};\n\nexport function macros() {\n const TransformAsserts = import.meta.resolve('./babel-plugin-transform-asserts.cjs').slice(7);\n const TransformDeprecations = import.meta.resolve('./babel-plugin-transform-deprecations.cjs').slice(7);\n const TransformDebugLogging = import.meta.resolve('./babel-plugin-transform-logging.cjs').slice(7);\n const TransformFeatures = import.meta.resolve('./babel-plugin-transform-features.cjs').slice(7);\n\n let plugins = [\n [TransformAsserts, {}, '@warp-drive-mirror/build-config/asserts-stripping'],\n [\n TransformFeatures,\n {\n source: '@warp-drive-mirror/build-config/canary-features',\n flags: config.features,\n },\n '@warp-drive-mirror/build-config/canary-features-stripping',\n ],\n [\n TransformDeprecations,\n {\n source: '@warp-drive-mirror/build-config/deprecations',\n flags: config.deprecations,\n },\n '@warp-drive-mirror/build-config/deprecation-stripping',\n ],\n [\n TransformDebugLogging,\n {\n source: '@warp-drive-mirror/build-config/debugging',\n configKey: 'debug',\n flags: config.debug,\n },\n '@warp-drive-mirror/build-config/debugging-stripping',\n ],\n [\n TransformDebugLogging,\n {\n source: '@warp-drive-mirror/build-config/env',\n configKey: 'env',\n flags: {\n TESTING: true,\n PRODUCTION: true,\n DEBUG: true,\n IS_RECORDING: true,\n IS_CI: true,\n SHOULD_RECORD: true,\n },\n },\n '@warp-drive-mirror/build-config/env',\n ],\n ];\n\n return plugins;\n}\n"],"names":["features","Object","keys","CURRENT_FEATURES","FEATURES","assign","forEach","feature","featureValue","config","deprecations","CURRENT_DEPRECATIONS","debug","LOGGING","macros","TransformAsserts","import","meta","resolve","slice","TransformDeprecations","TransformDebugLogging","TransformFeatures","plugins","source","flags","configKey","TESTING","PRODUCTION","DEBUG","IS_RECORDING","IS_CI","SHOULD_RECORD"],"mappings":";;;;AAKA,MAAMA,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACC,gBAAgB,CAAc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EhB,MAAM,CAACT,QAAAA;AAChB,GAAC,EACD,oDAAoD,CACrD,EACD,CACEoB,qBAAqB,EACrB;AACEI,IAAAA,MAAM,EAAE,uCAAuC;IAC/CC,KAAK,EAAEhB,MAAM,CAACC,YAAAA;AAChB,GAAC,EACD,gDAAgD,CACjD,EACD,CACEW,qBAAqB,EACrB;AACEG,IAAAA,MAAM,EAAE,oCAAoC;AAC5CE,IAAAA,SAAS,EAAE,OAAO;IAClBD,KAAK,EAAEhB,MAAM,CAACG,KAAAA;AAChB,GAAC,EACD,8CAA8C,CAC/C,EACD,CACES,qBAAqB,EACrB;AACEG,IAAAA,MAAM,EAAE,8BAA8B;AACtCE,IAAAA,SAAS,EAAE,KAAK;AAChBD,IAAAA,KAAK,EAAE;AACLE,MAAAA,OAAO,EAAE,IAAI;AACbC,MAAAA,UAAU,EAAE,IAAI;AAChBC,MAAAA,KAAK,EAAE,IAAI;AACXC,MAAAA,YAAY,EAAE,IAAI;AAClBC,MAAAA,KAAK,EAAE,IAAI;AACXC,MAAAA,aAAa,EAAE,IAAA;AACjB,KAAA;GACD,EACD,8BAA8B,CAC/B,CACF,CAAA;AAED,EAAA,OAAOT,OAAO,CAAA;AAChB;;;;"}
|
|
@@ -15,12 +15,12 @@ assert('foo', true);
|
|
|
15
15
|
(macroCondition(isDevelopingApp()) ? function assert(test) { if (!test) { throw new Error('foo'); } }(true) : {});
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
// => _macros.getGlobalConfig().
|
|
18
|
+
// => _macros.getGlobalConfig().WarpDriveMirror.env.DEBUG
|
|
19
19
|
function buildMacroConstDEBUG(types, binding, state) {
|
|
20
|
-
return types.memberExpression(types.memberExpression(types.memberExpression(types.callExpression(state.importer.import(binding, '@embroider/macros', 'getGlobalConfig'), []), types.identifier('
|
|
20
|
+
return types.memberExpression(types.memberExpression(types.memberExpression(types.callExpression(state.importer.import(binding, '@embroider/macros', 'getGlobalConfig'), []), types.identifier('WarpDriveMirror')), types.identifier('env')), types.identifier('DEBUG'));
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
// => _macros.macroCondition(_macros.getGlobalConfig().
|
|
23
|
+
// => _macros.macroCondition(_macros.getGlobalConfig().WarpDriveMirror.env.DEBUG)
|
|
24
24
|
function buildMacroConditionDEBUG(types, binding, state) {
|
|
25
25
|
return types.callExpression(state.importer.import(binding, '@embroider/macros', 'macroCondition'), [buildMacroConstDEBUG(types, binding, state)]);
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-transform-asserts.cjs","sources":["../cjs-src/transforms/babel-plugin-transform-asserts.js"],"sourcesContent":["const { ImportUtil } = require('babel-import-util');\n\nconst Utils = new Set(['assert']);\n\n/*\n// Before\nimport { assert } from '@warp-drive-mirror/build-config/macros';\n\nassert('foo', true);\n\n// After\n(macroCondition(isDevelopingApp()) ? function assert(test) { if (!test) { throw new Error('foo'); } }(true) : {});\n*/\n\n// => _macros.getGlobalConfig().
|
|
1
|
+
{"version":3,"file":"babel-plugin-transform-asserts.cjs","sources":["../cjs-src/transforms/babel-plugin-transform-asserts.js"],"sourcesContent":["const { ImportUtil } = require('babel-import-util');\n\nconst Utils = new Set(['assert']);\n\n/*\n// Before\nimport { assert } from '@warp-drive-mirror/build-config/macros';\n\nassert('foo', true);\n\n// After\n(macroCondition(isDevelopingApp()) ? function assert(test) { if (!test) { throw new Error('foo'); } }(true) : {});\n*/\n\n// => _macros.getGlobalConfig().WarpDriveMirror.env.DEBUG\nfunction buildMacroConstDEBUG(types, binding, state) {\n return types.memberExpression(\n types.memberExpression(\n types.memberExpression(\n types.callExpression(state.importer.import(binding, '@embroider/macros', 'getGlobalConfig'), []),\n types.identifier('WarpDriveMirror')\n ),\n types.identifier('env')\n ),\n types.identifier('DEBUG')\n );\n}\n\n// => _macros.macroCondition(_macros.getGlobalConfig().WarpDriveMirror.env.DEBUG)\nfunction buildMacroConditionDEBUG(types, binding, state) {\n return types.callExpression(state.importer.import(binding, '@embroider/macros', 'macroCondition'), [\n buildMacroConstDEBUG(types, binding, state),\n ]);\n}\n\n// (test) => { if (!test) { throw new Error(someMessage); } }(someCond)\nfunction buildAssert(types, originalCallExpression) {\n const desc = originalCallExpression.arguments[0];\n const test = originalCallExpression.arguments[1] ?? types.booleanLiteral(false);\n // prettier-ignore\n return types.callExpression(\n types.arrowFunctionExpression([types.identifier('test')], // (test) =>\n types.blockStatement([ // {\n types.ifStatement( // if\n types.unaryExpression('!', types.identifier('test')), // (!test)\n types.blockStatement([ // {\n types.throwStatement( // throw\n types.newExpression(types.identifier('Error'), [desc]) // new Error(desc)\n )]) // }\n )]) // }\n ),\n [test] // (someCond)\n );\n}\n\n// => ( <debug-macro> ? <assert-exp> : {});\nfunction buildAssertTernary(types, binding, state, originalCallExpression) {\n return types.expressionStatement(\n types.conditionalExpression(\n buildMacroConditionDEBUG(types, binding, state),\n buildAssert(types, originalCallExpression),\n types.objectExpression([])\n )\n );\n}\n\nexport default function (babel) {\n const { types: t } = babel;\n\n return {\n name: 'ast-transform', // not required\n visitor: {\n ImportDeclaration(path, state) {\n const importPath = path.node.source.value;\n\n if (importPath === '@warp-drive-mirror/build-config/macros') {\n const specifiers = path.get('specifiers');\n\n specifiers.forEach((specifier) => {\n const name = specifier.node.imported.name;\n if (!Utils.has(name)) {\n throw new Error(`Unexpected import '${name}' imported from '@warp-drive-mirror/build-config/macros'`);\n }\n\n const localBindingName = specifier.node.local.name;\n const binding = specifier.scope.getBinding(localBindingName);\n\n binding.referencePaths.forEach((p) => {\n const originalCallExpression = p.parentPath.node;\n\n if (!t.isCallExpression(originalCallExpression)) {\n throw new Error('Expected a call expression');\n }\n\n const assertTernary = buildAssertTernary(t, binding, state, originalCallExpression);\n p.parentPath.replaceWith(assertTernary);\n });\n specifier.scope.removeOwnBinding(localBindingName);\n specifier.remove();\n });\n\n if (path.get('specifiers').length === 0) {\n path.remove();\n }\n }\n },\n\n Program(path, state) {\n state.importer = new ImportUtil(t, path);\n },\n },\n };\n}\n"],"names":["ImportUtil","require","Utils","Set","buildMacroConstDEBUG","types","binding","state","memberExpression","callExpression","importer","import","identifier","buildMacroConditionDEBUG","buildAssert","originalCallExpression","desc","arguments","test","booleanLiteral","arrowFunctionExpression","blockStatement","ifStatement","unaryExpression","throwStatement","newExpression","buildAssertTernary","expressionStatement","conditionalExpression","objectExpression","babel","t","name","visitor","ImportDeclaration","path","importPath","node","source","value","specifiers","get","forEach","specifier","imported","has","Error","localBindingName","local","scope","getBinding","referencePaths","p","parentPath","isCallExpression","assertTernary","replaceWith","removeOwnBinding","remove","length","Program"],"mappings":";;AAAA,MAAM;AAAEA,EAAAA,UAAAA;AAAW,CAAC,GAAGC,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAEnD,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAASC,oBAAoBA,CAACC,KAAK,EAAEC,OAAO,EAAEC,KAAK,EAAE;EACnD,OAAOF,KAAK,CAACG,gBAAgB,CAC3BH,KAAK,CAACG,gBAAgB,CACpBH,KAAK,CAACG,gBAAgB,CACpBH,KAAK,CAACI,cAAc,CAACF,KAAK,CAACG,QAAQ,CAACC,MAAM,CAACL,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,EAChGD,KAAK,CAACO,UAAU,CAAC,WAAW,CAC9B,CAAC,EACDP,KAAK,CAACO,UAAU,CAAC,KAAK,CACxB,CAAC,EACDP,KAAK,CAACO,UAAU,CAAC,OAAO,CAC1B,CAAC,CAAA;AACH,CAAA;;AAEA;AACA,SAASC,wBAAwBA,CAACR,KAAK,EAAEC,OAAO,EAAEC,KAAK,EAAE;EACvD,OAAOF,KAAK,CAACI,cAAc,CAACF,KAAK,CAACG,QAAQ,CAACC,MAAM,CAACL,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,CAAC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,4BAA4B,CAAC,CAAA;AAC/C,eAAA;cAEA,MAAMS,aAAa,GAAG7B,kBAAkB,CAACK,CAAC,EAAEzB,OAAO,EAAEC,KAAK,EAAEQ,sBAAsB,CAAC,CAAA;AACnFqC,cAAAA,CAAC,CAACC,UAAU,CAACG,WAAW,CAACD,aAAa,CAAC,CAAA;AACzC,aAAC,CAAC,CAAA;AACFZ,YAAAA,SAAS,CAACM,KAAK,CAACQ,gBAAgB,CAACV,gBAAgB,CAAC,CAAA;YAClDJ,SAAS,CAACe,MAAM,EAAE,CAAA;AACpB,WAAC,CAAC,CAAA;UAEF,IAAIvB,IAAI,CAACM,GAAG,CAAC,YAAY,CAAC,CAACkB,MAAM,KAAK,CAAC,EAAE;YACvCxB,IAAI,CAACuB,MAAM,EAAE,CAAA;AACf,WAAA;AACF,SAAA;OACD;AAEDE,MAAAA,OAAOA,CAACzB,IAAI,EAAE5B,KAAK,EAAE;QACnBA,KAAK,CAACG,QAAQ,GAAG,IAAIV,UAAU,CAAC+B,CAAC,EAAEI,IAAI,CAAC,CAAA;AAC1C,OAAA;AACF,KAAA;GACD,CAAA;AACH;;;;"}
|
|
@@ -33,19 +33,33 @@ function babelPluginTransformDeprecations (babel) {
|
|
|
33
33
|
negateStatement = true;
|
|
34
34
|
node = p.parentPath;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
const comments = node.node.leadingComments ?? (node.parent.type === 'ConditionalExpression' && node.parent.leadingComments) ?? [];
|
|
37
|
+
let shouldInlineConfigValue = false;
|
|
38
|
+
if (comments?.length) {
|
|
39
|
+
const lastComment = comments.at(-1);
|
|
40
|
+
if (lastComment.value.trim() === 'inline-macro-config') {
|
|
41
|
+
shouldInlineConfigValue = true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
let getConfig = t.memberExpression(t.memberExpression(t.memberExpression(t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []), t.identifier('WarpDriveMirror')), t.identifier('deprecations')), t.identifier(name));
|
|
45
|
+
const configExp = negateStatement ? t.unaryExpression('!', getConfig) : getConfig;
|
|
46
|
+
const replaceExp = shouldInlineConfigValue ?
|
|
47
|
+
// if (DEPRECATE_FOO)
|
|
48
|
+
// =>
|
|
49
|
+
// if (getGlobalConfig('WarpDriveMirror').deprecations.FOO)
|
|
50
|
+
configExp :
|
|
38
51
|
// if (DEPRECATE_FOO)
|
|
39
52
|
// =>
|
|
40
|
-
// if (macroCondition(getGlobalConfig('
|
|
41
|
-
t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [
|
|
53
|
+
// if (macroCondition(getGlobalConfig('WarpDriveMirror').deprecations.FOO))
|
|
54
|
+
t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [configExp]);
|
|
55
|
+
node.replaceWith(replaceExp);
|
|
42
56
|
});
|
|
43
57
|
specifier.scope.removeOwnBinding(localBindingName);
|
|
44
58
|
specifier.remove();
|
|
45
59
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
60
|
+
if (path.get('specifiers').length === 0) {
|
|
61
|
+
path.remove();
|
|
62
|
+
}
|
|
49
63
|
}
|
|
50
64
|
},
|
|
51
65
|
Program(path, state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-transform-deprecations.cjs","sources":["../cjs-src/transforms/babel-plugin-transform-deprecations.js"],"sourcesContent":["import { ImportUtil } from 'babel-import-util';\n\nfunction parentIsUnary(node) {\n if (node.parent.type === 'UnaryExpression' && node.parent.operator === '!') {\n return true;\n }\n return false;\n}\n\nexport default function (babel) {\n const { types: t } = babel;\n\n return {\n name: 'deprecation-flags',\n visitor: {\n ImportDeclaration(path, state) {\n const importPath = path.node.source.value;\n\n if (importPath === state.opts.source) {\n const specifiers = path.get('specifiers');\n specifiers.forEach((specifier) => {\n let name = specifier.node.imported.name;\n if (!(name in state.opts.flags)) {\n throw new Error(`Unexpected flag ${name} imported from ${state.opts.source}`);\n }\n let localBindingName = specifier.node.local.name;\n let binding = specifier.scope.getBinding(localBindingName);\n binding.referencePaths.forEach((p, other) => {\n let negateStatement = false;\n let node = p;\n if (parentIsUnary(p)) {\n negateStatement = true;\n node = p.parentPath;\n }\n let getConfig = t.memberExpression(\n t.memberExpression(\n t.memberExpression(\n t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []),\n t.identifier('
|
|
1
|
+
{"version":3,"file":"babel-plugin-transform-deprecations.cjs","sources":["../cjs-src/transforms/babel-plugin-transform-deprecations.js"],"sourcesContent":["import { ImportUtil } from 'babel-import-util';\n\nfunction parentIsUnary(node) {\n if (node.parent.type === 'UnaryExpression' && node.parent.operator === '!') {\n return true;\n }\n return false;\n}\n\nexport default function (babel) {\n const { types: t } = babel;\n\n return {\n name: 'deprecation-flags',\n visitor: {\n ImportDeclaration(path, state) {\n const importPath = path.node.source.value;\n\n if (importPath === state.opts.source) {\n const specifiers = path.get('specifiers');\n specifiers.forEach((specifier) => {\n let name = specifier.node.imported.name;\n if (!(name in state.opts.flags)) {\n throw new Error(`Unexpected flag ${name} imported from ${state.opts.source}`);\n }\n let localBindingName = specifier.node.local.name;\n let binding = specifier.scope.getBinding(localBindingName);\n binding.referencePaths.forEach((p, other) => {\n let negateStatement = false;\n let node = p;\n if (parentIsUnary(p)) {\n negateStatement = true;\n node = p.parentPath;\n }\n const comments =\n node.node.leadingComments ??\n (node.parent.type === 'ConditionalExpression' && node.parent.leadingComments) ??\n [];\n let shouldInlineConfigValue = false;\n if (comments?.length) {\n const lastComment = comments.at(-1);\n if (lastComment.value.trim() === 'inline-macro-config') {\n shouldInlineConfigValue = true;\n }\n }\n\n let getConfig = t.memberExpression(\n t.memberExpression(\n t.memberExpression(\n t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []),\n t.identifier('WarpDriveMirror')\n ),\n t.identifier('deprecations')\n ),\n t.identifier(name)\n );\n\n const configExp = negateStatement ? t.unaryExpression('!', getConfig) : getConfig;\n const replaceExp = shouldInlineConfigValue\n ? // if (DEPRECATE_FOO)\n // =>\n // if (getGlobalConfig('WarpDriveMirror').deprecations.FOO)\n configExp\n : // if (DEPRECATE_FOO)\n // =>\n // if (macroCondition(getGlobalConfig('WarpDriveMirror').deprecations.FOO))\n t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [configExp]);\n node.replaceWith(replaceExp);\n });\n specifier.scope.removeOwnBinding(localBindingName);\n specifier.remove();\n });\n if (path.get('specifiers').length === 0) {\n path.remove();\n }\n }\n },\n\n Program(path, state) {\n state.importer = new ImportUtil(t, path);\n },\n },\n };\n}\n"],"names":["parentIsUnary","node","parent","type","operator","babel","types","t","name","visitor","ImportDeclaration","path","state","importPath","source","value","opts","specifiers","get","forEach","specifier","imported","flags","Error","localBindingName","local","binding","scope","getBinding","referencePaths","p","other","negateStatement","parentPath","comments","leadingComments","shouldInlineConfigValue","length","lastComment","at","trim","getConfig","memberExpression","callExpression","importer","import","identifier","configExp","unaryExpression","replaceExp","replaceWith","removeOwnBinding","remove","Program","ImportUtil"],"mappings":";;;;AAEA,SAASA,aAAaA,CAACC,IAAI,EAAE;AAC3B,EAAA,IAAIA,IAAI,CAACC,MAAM,CAACC,IAAI,KAAK,iBAAiB,IAAIF,IAAI,CAACC,MAAM,CAACE,QAAQ,KAAK,GAAG,EAAE;AAC1E,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AACA,EAAA,OAAO,KAAK,CAAA;AACd,CAAA;AAEe,yCAAA,EAAUC,KAAK,EAAE;EAC9B,MAAM;AAAEC,IAAAA,KAAK,EAAEC,CAAAA;AAAE,GAAC,GAAGF,KAAK,CAAA;EAE1B,OAAO;AACLG,IAAAA,IAAI,EAAE,mBAAmB;AACzBC,IAAAA,OAAO,EAAE;AACPC,MAAAA,iBAAiBA,CAACC,IAAI,EAAEC,KAAK,EAAE;QAC7B,MAAMC,UAAU,GAAGF,IAAI,CAACV,IAAI,CAACa,MAAM,CAACC,KAAK,CAAA;AAEzC,QAA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Y,CAAC,CAACmB,MAAM,KAAK,CAAC,EAAE;YACvC1B,IAAI,CAACyC,MAAM,EAAE,CAAA;AACf,WAAA;AACF,SAAA;OACD;AAEDC,MAAAA,OAAOA,CAAC1C,IAAI,EAAEC,KAAK,EAAE;QACnBA,KAAK,CAACgC,QAAQ,GAAG,IAAIU,0BAAU,CAAC/C,CAAC,EAAEI,IAAI,CAAC,CAAA;AAC1C,OAAA;AACF,KAAA;GACD,CAAA;AACH;;;;"}
|
|
@@ -4,7 +4,7 @@ const babelImportUtil = require('babel-import-util');
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
|
|
6
6
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
|
-
const pkg = JSON.parse(fs.readFileSync(new URL("../package.json", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('babel-plugin-transform-features.cjs', document.baseURI).href))), 'utf-8'));
|
|
7
|
+
const pkg = JSON.parse(fs.readFileSync(new URL("../package.json", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('babel-plugin-transform-features.cjs', document.baseURI).href))), 'utf-8'));
|
|
8
8
|
const version = pkg.version;
|
|
9
9
|
const isCanary = version.includes('alpha');
|
|
10
10
|
function parentIsUnary(node) {
|
|
@@ -43,19 +43,19 @@ function babelPluginTransformFeatures (babel) {
|
|
|
43
43
|
negateStatement = true;
|
|
44
44
|
node = p.parentPath;
|
|
45
45
|
}
|
|
46
|
-
let getConfig = t.memberExpression(t.memberExpression(t.memberExpression(t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []), t.identifier('
|
|
46
|
+
let getConfig = t.memberExpression(t.memberExpression(t.memberExpression(t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []), t.identifier('WarpDriveMirror')), t.identifier('features')), t.identifier(name));
|
|
47
47
|
node.replaceWith(
|
|
48
48
|
// if (LOG_FOO)
|
|
49
49
|
// =>
|
|
50
|
-
// if (macroCondition(getGlobalConfig('
|
|
50
|
+
// if (macroCondition(getGlobalConfig('WarpDriveMirror').debug.LOG_FOO))
|
|
51
51
|
t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [negateStatement ? t.unaryExpression('!', getConfig) : getConfig]));
|
|
52
52
|
});
|
|
53
53
|
specifier.scope.removeOwnBinding(localBindingName);
|
|
54
54
|
specifier.remove();
|
|
55
55
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
if (path.get('specifiers').length === 0) {
|
|
57
|
+
path.remove();
|
|
58
|
+
}
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
Program(path, state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-transform-features.cjs","sources":["../cjs-src/transforms/babel-plugin-transform-features.js"],"sourcesContent":["import { ImportUtil } from 'babel-import-util';\nimport fs from 'fs';\n\nconst pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));\nconst version = pkg.version;\n\nconst isCanary = version.includes('alpha');\n\nfunction parentIsUnary(node) {\n if (node.parent.type === 'UnaryExpression' && node.parent.operator === '!') {\n return true;\n }\n return false;\n}\n\nexport default function (babel) {\n const { types: t } = babel;\n\n return {\n name: 'ast-transform', // not required\n visitor: {\n ImportDeclaration(path, state) {\n const importPath = path.node.source.value;\n\n if (importPath === state.opts.source) {\n const specifiers = path.get('specifiers');\n specifiers.forEach((specifier) => {\n let name = specifier.node.imported.name;\n if (!(name in state.opts.flags)) {\n throw new Error(`Unexpected flag ${name} imported from ${state.opts.source}`);\n }\n let localBindingName = specifier.node.local.name;\n let binding = specifier.scope.getBinding(localBindingName);\n binding.referencePaths.forEach((p) => {\n let negateStatement = false;\n let node = p;\n if (!isCanary) {\n p.replaceWith(t.boolean(state.opts.flags[name]));\n return;\n }\n if (parentIsUnary(p)) {\n negateStatement = true;\n node = p.parentPath;\n }\n let getConfig = t.memberExpression(\n t.memberExpression(\n t.memberExpression(\n t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []),\n t.identifier('
|
|
1
|
+
{"version":3,"file":"babel-plugin-transform-features.cjs","sources":["../cjs-src/transforms/babel-plugin-transform-features.js"],"sourcesContent":["import { ImportUtil } from 'babel-import-util';\nimport fs from 'fs';\n\nconst pkg = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));\nconst version = pkg.version;\n\nconst isCanary = version.includes('alpha');\n\nfunction parentIsUnary(node) {\n if (node.parent.type === 'UnaryExpression' && node.parent.operator === '!') {\n return true;\n }\n return false;\n}\n\nexport default function (babel) {\n const { types: t } = babel;\n\n return {\n name: 'ast-transform', // not required\n visitor: {\n ImportDeclaration(path, state) {\n const importPath = path.node.source.value;\n\n if (importPath === state.opts.source) {\n const specifiers = path.get('specifiers');\n specifiers.forEach((specifier) => {\n let name = specifier.node.imported.name;\n if (!(name in state.opts.flags)) {\n throw new Error(`Unexpected flag ${name} imported from ${state.opts.source}`);\n }\n let localBindingName = specifier.node.local.name;\n let binding = specifier.scope.getBinding(localBindingName);\n binding.referencePaths.forEach((p) => {\n let negateStatement = false;\n let node = p;\n if (!isCanary) {\n p.replaceWith(t.boolean(state.opts.flags[name]));\n return;\n }\n if (parentIsUnary(p)) {\n negateStatement = true;\n node = p.parentPath;\n }\n let getConfig = t.memberExpression(\n t.memberExpression(\n t.memberExpression(\n t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []),\n t.identifier('WarpDriveMirror')\n ),\n t.identifier('features')\n ),\n t.identifier(name)\n );\n node.replaceWith(\n // if (LOG_FOO)\n // =>\n // if (macroCondition(getGlobalConfig('WarpDriveMirror').debug.LOG_FOO))\n t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [\n negateStatement ? t.unaryExpression('!', getConfig) : getConfig,\n ])\n );\n });\n specifier.scope.removeOwnBinding(localBindingName);\n specifier.remove();\n });\n if (path.get('specifiers').length === 0) {\n path.remove();\n }\n }\n },\n\n Program(path, state) {\n state.importer = new ImportUtil(t, path);\n },\n },\n };\n}\n"],"names":["pkg","JSON","parse","fs","readFileSync","version","isCanary","includes","parentIsUnary","node","parent","type","operator","babel","types","t","name","visitor","ImportDeclaration","path","state","importPath","source","value","opts","specifiers","get","forEach","specifier","imported","flags","Error","localBindingName","local","binding","scope","getBinding","referencePaths","p","negateStatement","replaceWith","boolean","parentPath","getConfig","memberExpression","callExpression","importer","import","identifier","unaryExpression","removeOwnBinding","remove","length","Program","ImportUtil"],"mappings":";;;;;;AAGA,MAAMA,GAAG,GAAGC,IAAI,CAACC,KAAK,CAACC,EAAE,CAACC,YAAY,CAAC,IAAA,GAAA,CAAA,iBAAA,EAAA,qRAAA,CAA2C,EAAE,OAAO,CAAC,CAAC,CAAA;AAC7F,MAAMC,OAAO,GAAGL,GAAG,CAACK,OAAO,CAAA;AAE3B,MAAMC,QAAQ,GAAGD,OAAO,CAACE,QAAQ,CAAC,OAAO,CAAC,CAAA;AAE1C,SAASC,aAAaA,CAACC,IAAI,EAAE;AAC3B,EAAA,IAAIA,IAAI,CAACC,MAAM,CAACC,IAAI,KAAK,iBAAiB,IAAIF,IAAI,CAACC,MAAM,CAACE,QAAQ,KAAK,GAAG,EAAE;AAC1E,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AACA,EAAA,OAAO,KAAK,CAAA;AACd,CAAA;AAEe,qCAAA,EAAUC,KAAK,EAAE;EAC9B,MAAM;AAAEC,IAAAA,KAAK,EAAEC,CAAAA;AAAE,GAAC,GAAGF,KAAK,CAAA;EAE1B,OAAO;AACLG,IAAAA,IAAI,EAAE,eAAe;AAAE;AACvBC,IAAAA,OAAO,EAAE;AACPC,MAAAA,iBAAiBA,CAACC,IAAI,EAAEC,KAAK,EAAE;QAC7B,MAAMC,UAAU,GAAGF,IAAI,CAACV,IAA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
|
node = p.parentPath;
|
|
36
36
|
}
|
|
37
|
-
let getConfig = t.memberExpression(t.memberExpression(t.memberExpression(t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []), t.identifier('
|
|
37
|
+
let getConfig = t.memberExpression(t.memberExpression(t.memberExpression(t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []), t.identifier('WarpDriveMirror')), t.identifier(state.opts.configKey)), t.identifier(name));
|
|
38
38
|
node.replaceWith(
|
|
39
39
|
// if (LOG_FOO)
|
|
40
40
|
// =>
|
|
41
|
-
// if (macroCondition(getGlobalConfig('
|
|
41
|
+
// if (macroCondition(getGlobalConfig('WarpDriveMirror').debug.LOG_FOO))
|
|
42
42
|
t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [negateStatement ? t.unaryExpression('!', getConfig) : getConfig]));
|
|
43
43
|
});
|
|
44
44
|
specifier.scope.removeOwnBinding(localBindingName);
|
|
45
45
|
specifier.remove();
|
|
46
46
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
if (path.get('specifiers').length === 0) {
|
|
48
|
+
path.remove();
|
|
49
|
+
}
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
Program(path, state) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-transform-logging.cjs","sources":["../cjs-src/transforms/babel-plugin-transform-logging.js"],"sourcesContent":["import { ImportUtil } from 'babel-import-util';\n\nfunction parentIsUnary(node) {\n if (node.parent.type === 'UnaryExpression' && node.parent.operator === '!') {\n return true;\n }\n return false;\n}\n\nexport default function (babel) {\n const { types: t } = babel;\n\n return {\n name: 'ast-transform', // not required\n visitor: {\n ImportDeclaration(path, state) {\n const importPath = path.node.source.value;\n\n if (importPath === state.opts.source) {\n const specifiers = path.get('specifiers');\n specifiers.forEach((specifier) => {\n let name = specifier.node.imported.name;\n if (!(name in state.opts.flags)) {\n throw new Error(`Unexpected flag ${name} imported from ${state.opts.source}`);\n }\n let localBindingName = specifier.node.local.name;\n let binding = specifier.scope.getBinding(localBindingName);\n binding.referencePaths.forEach((p) => {\n let negateStatement = false;\n let node = p;\n if (parentIsUnary(p)) {\n negateStatement = true;\n node = p.parentPath;\n }\n let getConfig = t.memberExpression(\n t.memberExpression(\n t.memberExpression(\n t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []),\n t.identifier('
|
|
1
|
+
{"version":3,"file":"babel-plugin-transform-logging.cjs","sources":["../cjs-src/transforms/babel-plugin-transform-logging.js"],"sourcesContent":["import { ImportUtil } from 'babel-import-util';\n\nfunction parentIsUnary(node) {\n if (node.parent.type === 'UnaryExpression' && node.parent.operator === '!') {\n return true;\n }\n return false;\n}\n\nexport default function (babel) {\n const { types: t } = babel;\n\n return {\n name: 'ast-transform', // not required\n visitor: {\n ImportDeclaration(path, state) {\n const importPath = path.node.source.value;\n\n if (importPath === state.opts.source) {\n const specifiers = path.get('specifiers');\n specifiers.forEach((specifier) => {\n let name = specifier.node.imported.name;\n if (!(name in state.opts.flags)) {\n throw new Error(`Unexpected flag ${name} imported from ${state.opts.source}`);\n }\n let localBindingName = specifier.node.local.name;\n let binding = specifier.scope.getBinding(localBindingName);\n binding.referencePaths.forEach((p) => {\n let negateStatement = false;\n let node = p;\n if (parentIsUnary(p)) {\n negateStatement = true;\n node = p.parentPath;\n }\n let getConfig = t.memberExpression(\n t.memberExpression(\n t.memberExpression(\n t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []),\n t.identifier('WarpDriveMirror')\n ),\n t.identifier(state.opts.configKey)\n ),\n t.identifier(name)\n );\n node.replaceWith(\n // if (LOG_FOO)\n // =>\n // if (macroCondition(getGlobalConfig('WarpDriveMirror').debug.LOG_FOO))\n t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [\n negateStatement ? t.unaryExpression('!', getConfig) : getConfig,\n ])\n );\n });\n specifier.scope.removeOwnBinding(localBindingName);\n specifier.remove();\n });\n if (path.get('specifiers').length === 0) {\n path.remove();\n }\n }\n },\n\n Program(path, state) {\n state.importer = new ImportUtil(t, path);\n },\n },\n };\n}\n"],"names":["parentIsUnary","node","parent","type","operator","babel","types","t","name","visitor","ImportDeclaration","path","state","importPath","source","value","opts","specifiers","get","forEach","specifier","imported","flags","Error","localBindingName","local","binding","scope","getBinding","referencePaths","p","negateStatement","parentPath","getConfig","memberExpression","callExpression","importer","import","identifier","configKey","replaceWith","unaryExpression","removeOwnBinding","remove","length","Program","ImportUtil"],"mappings":";;;;AAEA,SAASA,aAAaA,CAACC,IAAI,EAAE;AAC3B,EAAA,IAAIA,IAAI,CAACC,MAAM,CAACC,IAAI,KAAK,iBAAiB,IAAIF,IAAI,CAACC,MAAM,CAACE,QAAQ,KAAK,GAAG,EAAE;AAC1E,IAAA,OAAO,IAAI,CAAA;AACb,GAAA;AACA,EAAA,OAAO,KAAK,CAAA;AACd,CAAA;AAEe,oCAAA,EAAUC,KAAK,EAAE;EAC9B,MAAM;AAAEC,IAAAA,KAAK,EAAEC,CAAAA;AAAE,GAAC,GAAGF,KAAK,CAAA;EAE1B,OAAO;AACLG,IAAAA,IAAI,EAAE,eAAe;AAAE;AACvBC,IAAAA,OAAO,EAAE;AACPC,MAAAA,iBAAiBA,CAACC,IAAI,EAAEC,KAAK,EAAE;QAC7B,MAAMC,UAAU,GAAGF,IAAI,CAACV,IAAI,CAACa,MAAM,CAACC,KAAK,CAAA;AAEzC,QAAA,IAAIF,UAAU,KAAKD,KAAK,CAACI,IAAI,CAACF,MAAM,EAAE;AACpC,UAAA,MAAMG,UAAU,GAAGN,IAAI,CAACO,GAAG,CAAC,YAAY,CAAC,CAAA;AACzCD,UAAAA,UAAU,CAACE,OAAO,CAAEC,SAAS,IAAK;YAChC,IAAIZ,IAAI,GAAGY,SAAS,CAACnB,IAAI,CAACoB,QAAQ,CAACb,IAAI,CAAA;YACvC,IAAI,EAAEA,IAAI,IAAII,KAAK,CAACI,IAAI,CAACM,KAAK,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