@warp-drive/build-config 0.0.0-beta.7 → 4.13.0-alpha.1
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/dist/addon-shim.cjs.map +1 -1
- package/dist/babel-macros.js +1 -1
- package/dist/babel-macros.js.map +1 -1
- package/dist/babel-plugin-transform-asserts.cjs.map +1 -1
- package/dist/babel-plugin-transform-deprecations.cjs +17 -3
- package/dist/babel-plugin-transform-deprecations.cjs.map +1 -1
- package/dist/babel-plugin-transform-features.cjs.map +1 -1
- package/dist/babel-plugin-transform-logging.cjs.map +1 -1
- package/dist/canary-features-BzGSGY5j.js.map +1 -1
- package/dist/cjs-set-config.cjs +672 -64
- package/dist/cjs-set-config.cjs.map +1 -1
- package/dist/debugging-BzogyWJo.js.map +1 -1
- package/dist/deprecations-BjnhZL6k.js +67 -0
- package/dist/deprecations-BjnhZL6k.js.map +1 -0
- package/dist/deprecations.js +1 -1
- package/dist/env.js.map +1 -1
- package/dist/index.js +672 -64
- package/dist/index.js.map +1 -1
- package/dist/macros.js.map +1 -1
- package/package.json +8 -8
- 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/deprecation-versions.d.ts +610 -50
- package/unstable-preview-types/deprecation-versions.d.ts.map +1 -1
- package/unstable-preview-types/deprecations.d.ts +20 -2
- package/unstable-preview-types/deprecations.d.ts.map +1 -1
- package/dist/deprecations-C0B5IT3G.js +0 -30
- package/dist/deprecations-C0B5IT3G.js.map +0 -1
package/dist/addon-shim.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addon-shim.cjs","sources":["../cjs-src/addon-shim.js"],"sourcesContent":["'use strict';\n\nexport function addonShim(dirName, options) {\n const path = require('path');\n const pkg = require(path.join(dirName, './package.json'));\n\n const isV2Addon = pkg['ember-addon']?.version === 2;\n if (isV2Addon) {\n const { addonV1Shim } = require('@embroider/addon-shim');\n return addonV1Shim(dirName, options);\n }\n\n const Funnel = require('broccoli-funnel');\n return {\n name: pkg.name,\n\n treeForVendor() {},\n treeForPublic() {},\n treeForStyles() {},\n treeForAddonStyles() {},\n treeForApp() {},\n treeForAddon() {\n return this._super.treeForAddon.call(this, new Funnel(path.join(dirName, 'dist')));\n },\n };\n}\n"],"names":["addonShim","dirName","options","path","require","pkg","join","isV2Addon","version","addonV1Shim","Funnel","name","treeForVendor","treeForPublic","treeForStyles","treeForAddonStyles","treeForApp","treeForAddon","_super","call"],"mappings":";;;;AAEO,SAASA,SAASA,CAACC,OAAO,EAAEC,OAAO,EAAE;AAC1C,EAAA,MAAMC,IAAI,GAAGC,OAAO,CAAC,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"addon-shim.cjs","sources":["../cjs-src/addon-shim.js"],"sourcesContent":["'use strict';\n\nexport function addonShim(dirName, options) {\n const path = require('path');\n const pkg = require(path.join(dirName, './package.json'));\n\n const isV2Addon = pkg['ember-addon']?.version === 2;\n if (isV2Addon) {\n const { addonV1Shim } = require('@embroider/addon-shim');\n return addonV1Shim(dirName, options);\n }\n\n const Funnel = require('broccoli-funnel');\n return {\n name: pkg.name,\n\n treeForVendor() {},\n treeForPublic() {},\n treeForStyles() {},\n treeForAddonStyles() {},\n treeForApp() {},\n treeForAddon() {\n return this._super.treeForAddon.call(this, new Funnel(path.join(dirName, 'dist')));\n },\n };\n}\n"],"names":["addonShim","dirName","options","path","require","pkg","join","isV2Addon","version","addonV1Shim","Funnel","name","treeForVendor","treeForPublic","treeForStyles","treeForAddonStyles","treeForApp","treeForAddon","_super","call"],"mappings":";;;;AAEO,SAASA,SAASA,CAACC,OAAO,EAAEC,OAAO,EAAE;AAC1C,EAAA,MAAMC,IAAI,GAAGC,OAAO,CAAC,MAAM,CAAC;AAC5B,EAAA,MAAMC,GAAG,GAAGD,OAAO,CAACD,IAAI,CAACG,IAAI,CAACL,OAAO,EAAE,gBAAgB,CAAC,CAAC;EAEzD,MAAMM,SAAS,GAAGF,GAAG,CAAC,aAAa,CAAC,EAAEG,OAAO,KAAK,CAAC;AACnD,EAAA,IAAID,SAAS,EAAE;IACb,MAAM;AAAEE,MAAAA;AAAY,KAAC,GAAGL,OAAO,CAAC,uBAAuB,CAAC;AACxD,IAAA,OAAOK,WAAW,CAACR,OAAO,EAAEC,OAAO,CAAC;AACtC;AAEA,EAAA,MAAMQ,MAAM,GAAGN,OAAO,CAAC,iBAAiB,CAAC;EACzC,OAAO;IACLO,IAAI,EAAEN,GAAG,CAACM,IAAI;IAEdC,aAAaA,GAAG,EAAE;IAClBC,aAAaA,GAAG,EAAE;IAClBC,aAAaA,GAAG,EAAE;IAClBC,kBAAkBA,GAAG,EAAE;IACvBC,UAAUA,GAAG,EAAE;AACfC,IAAAA,YAAYA,GAAG;MACb,OAAO,IAAI,CAACC,MAAM,CAACD,YAAY,CAACE,IAAI,CAAC,IAAI,EAAE,IAAIT,MAAM,CAACP,IAAI,CAACG,IAAI,CAACL,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACpF;GACD;AACH;;;;"}
|
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-BjnhZL6k.js';
|
|
4
4
|
|
|
5
5
|
const features = Object.keys(CURRENT_FEATURES);
|
|
6
6
|
const FEATURES = Object.assign({}, CURRENT_FEATURES);
|
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/build-config/asserts-stripping'],\n [\n TransformFeatures,\n {\n source: '@warp-drive/build-config/canary-features',\n flags: config.features,\n },\n '@warp-drive/build-config/canary-features-stripping',\n ],\n [\n TransformDeprecations,\n {\n source: '@warp-drive/build-config/deprecations',\n flags: config.deprecations,\n },\n '@warp-drive/build-config/deprecation-stripping',\n ],\n [\n TransformDebugLogging,\n {\n source: '@warp-drive/build-config/debugging',\n configKey: 'debug',\n flags: config.debug,\n },\n '@warp-drive/build-config/debugging-stripping',\n ],\n [\n TransformDebugLogging,\n {\n source: '@warp-drive/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/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
|
|
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/build-config/asserts-stripping'],\n [\n TransformFeatures,\n {\n source: '@warp-drive/build-config/canary-features',\n flags: config.features,\n },\n '@warp-drive/build-config/canary-features-stripping',\n ],\n [\n TransformDeprecations,\n {\n source: '@warp-drive/build-config/deprecations',\n flags: config.deprecations,\n },\n '@warp-drive/build-config/deprecation-stripping',\n ],\n [\n TransformDebugLogging,\n {\n source: '@warp-drive/build-config/debugging',\n configKey: 'debug',\n flags: config.debug,\n },\n '@warp-drive/build-config/debugging-stripping',\n ],\n [\n TransformDebugLogging,\n {\n source: '@warp-drive/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/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;AAC3D,MAAMC,QAAQ,GAAGH,MAAM,CAACI,MAAM,CAAC,EAAE,EAAEF,gBAAgB,CAA6B;AAChFH,QAAQ,CAACM,OAAO,CAAEC,OAAO,IAAK;AAC5B,EAAA,IAAIC,YAAY,GAAGJ,QAAQ,CAACG,OAAO,CAAC;EACpC,IAAIC,YAAY,KAAK,IAAI,EAAE;AACzBJ,IAAAA,QAAQ,CAACG,OAAO,CAAC,GAAG,KAAK;AAC3B;AACF,CAAC,CAAC;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;AAClC,CAAC;AAEM,SAASC,MAAMA,GAAG;AACvB,EAAA,MAAMC,gBAAgB,GAAGC,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC,sCAAsC,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC;AAC7F,EAAA,MAAMC,qBAAqB,GAAGJ,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC,2CAA2C,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC;AACvG,EAAA,MAAME,qBAAqB,GAAGL,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC,sCAAsC,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC;AAClG,EAAA,MAAMG,iBAAiB,GAAGN,MAAM,CAACC,IAAI,CAACC,OAAO,CAAC,uCAAuC,CAAC,CAACC,KAAK,CAAC,CAAC,CAAC;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;AAChB,GAAC,EACD,oDAAoD,CACrD,EACD,CACEoB,qBAAqB,EACrB;AACEI,IAAAA,MAAM,EAAE,uCAAuC;IAC/CC,KAAK,EAAEhB,MAAM,CAACC;AAChB,GAAC,EACD,gDAAgD,CACjD,EACD,CACEW,qBAAqB,EACrB;AACEG,IAAAA,MAAM,EAAE,oCAAoC;AAC5CE,IAAAA,SAAS,EAAE,OAAO;IAClBD,KAAK,EAAEhB,MAAM,CAACG;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;AACjB;GACD,EACD,8BAA8B,CAC/B,CACF;AAED,EAAA,OAAOT,OAAO;AAChB;;;;"}
|
|
@@ -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/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().WarpDrive.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('WarpDrive')\n ),\n types.identifier('env')\n ),\n types.identifier('DEBUG')\n );\n}\n\n// => _macros.macroCondition(_macros.getGlobalConfig().WarpDrive.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/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/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
|
|
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/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().WarpDrive.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('WarpDrive')\n ),\n types.identifier('env')\n ),\n types.identifier('DEBUG')\n );\n}\n\n// => _macros.macroCondition(_macros.getGlobalConfig().WarpDrive.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/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/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;AAAW,CAAC,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AAEnD,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;;AAEjC;AACA;AACA;;AAEA;;AAEA;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;AACH;;AAE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AgB,CAACvC,sBAAsB,CAAC,EAAE;AAC/C,gBAAA,MAAM,IAAI+B,KAAK,CAAC,4BAA4B,CAAC;AAC/C;cAEA,MAAMS,aAAa,GAAG7B,kBAAkB,CAACK,CAAC,EAAEzB,OAAO,EAAEC,KAAK,EAAEQ,sBAAsB,CAAC;AACnFqC,cAAAA,CAAC,CAACC,UAAU,CAACG,WAAW,CAACD,aAAa,CAAC;AACzC,aAAC,CAAC;AACFZ,YAAAA,SAAS,CAACM,KAAK,CAACQ,gBAAgB,CAACV,gBAAgB,CAAC;YAClDJ,SAAS,CAACe,MAAM,EAAE;AACpB,WAAC,CAAC;UAEF,IAAIvB,IAAI,CAACM,GAAG,CAAC,YAAY,CAAC,CAACkB,MAAM,KAAK,CAAC,EAAE;YACvCxB,IAAI,CAACuB,MAAM,EAAE;AACf;AACF;OACD;AAEDE,MAAAA,OAAOA,CAACzB,IAAI,EAAE5B,KAAK,EAAE;QACnBA,KAAK,CAACG,QAAQ,GAAG,IAAIV,UAAU,CAAC+B,CAAC,EAAEI,IAAI,CAAC;AAC1C;AACF;GACD;AACH;;;;"}
|
|
@@ -33,12 +33,26 @@ function babelPluginTransformDeprecations (babel) {
|
|
|
33
33
|
negateStatement = true;
|
|
34
34
|
node = p.parentPath;
|
|
35
35
|
}
|
|
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
|
+
}
|
|
36
44
|
let getConfig = t.memberExpression(t.memberExpression(t.memberExpression(t.callExpression(state.importer.import(p, '@embroider/macros', 'getGlobalConfig'), []), t.identifier('WarpDrive')), t.identifier('deprecations')), t.identifier(name));
|
|
37
|
-
|
|
45
|
+
const configExp = negateStatement ? t.unaryExpression('!', getConfig) : getConfig;
|
|
46
|
+
const replaceExp = shouldInlineConfigValue ?
|
|
47
|
+
// if (DEPRECATE_FOO)
|
|
48
|
+
// =>
|
|
49
|
+
// if (getGlobalConfig('WarpDrive').deprecations.FOO)
|
|
50
|
+
configExp :
|
|
38
51
|
// if (DEPRECATE_FOO)
|
|
39
52
|
// =>
|
|
40
|
-
// if (macroCondition(getGlobalConfig('WarpDrive').
|
|
41
|
-
t.callExpression(state.importer.import(p, '@embroider/macros', 'macroCondition'), [
|
|
53
|
+
// if (macroCondition(getGlobalConfig('WarpDrive').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();
|
|
@@ -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('WarpDrive')\n ),\n t.identifier('deprecations')\n ),\n t.identifier(name)\n );\n
|
|
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('WarpDrive')\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('WarpDrive').deprecations.FOO)\n configExp\n : // if (DEPRECATE_FOO)\n // =>\n // if (macroCondition(getGlobalConfig('WarpDrive').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;AACb;AACA,EAAA,OAAO,KAAK;AACd;AAEe,yCAAA,EAAUC,KAAK,EAAE;EAC9B,MAAM;AAAEC,IAAAA,KAAK,EAAEC;AAAE,GAAC,GAAGF,KAAK;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;AAEzC,QAAA,IAAIF,UAAU,KAAKD,KAAK,CAACI,IAAI,CAACF,MAAM,EAAE;AACpC,UAAA,MAAMG,UAAU,GAAGN,IAAI,CAACO,GAAG,CAAC,YAAY,CAAC;AACzCD,UAAAA,UAAU,CAACE,OAAO,CAAEC,SAAS,IAAK;YAChC,IAAIZ,IAAI,GAAG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gBAAgB,CAChBnC,CAAC,CAACoC,cAAc,CAAC/B,KAAK,CAACgC,QAAQ,CAACC,MAAM,CAACf,CAAC,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,EACtFvB,CAAC,CAACuC,UAAU,CAAC,WAAW,CAC1B,CAAC,EACDvC,CAAC,CAACuC,UAAU,CAAC,cAAc,CAC7B,CAAC,EACDvC,CAAC,CAACuC,UAAU,CAACtC,IAAI,CACnB,CAAC;AAED,cAAA,MAAMuC,SAAS,GAAGf,eAAe,GAAGzB,CAAC,CAACyC,eAAe,CAAC,GAAG,EAAEP,SAAS,CAAC,GAAGA,SAAS;cACjF,MAAMQ,UAAU,GAAGb,uBAAuB;AACtC;AACA;AACA;cACAW,SAAS;AACT;AACA;AACA;AACAxC,cAAAA,CAAC,CAACoC,cAAc,CAAC/B,KAAK,CAACgC,QAAQ,CAACC,MAAM,CAACf,CAAC,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAE,CAACiB,SAAS,CAAC,CAAC;AAClG9C,cAAAA,IAAI,CAACiD,WAAW,CAACD,UAAU,CAAC;AAC9B,aAAC,CAAC;AACF7B,YAAAA,SAAS,CAACO,KAAK,CAACwB,gBAAgB,CAAC3B,gBAAgB,CAAC;YAClDJ,SAAS,CAACgC,MAAM,EAAE;AACpB,WAAC,CAAC;UACF,IAAIzC,IAAI,CAACO,GAAG,CAAC,YAAY,CAAC,CAACmB,MAAM,KAAK,CAAC,EAAE;YACvC1B,IAAI,CAACyC,MAAM,EAAE;AACf;AACF;OACD;AAEDC,MAAAA,OAAOA,CAAC1C,IAAI,EAAEC,KAAK,EAAE;QACnBA,KAAK,CAACgC,QAAQ,GAAG,IAAIU,0BAAU,CAAC/C,CAAC,EAAEI,IAAI,CAAC;AAC1C;AACF;GACD;AACH;;;;"}
|
|
@@ -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('WarpDrive')\n ),\n t.identifier('features')\n ),\n t.identifier(name)\n );\n node.replaceWith(\n // if (LOG_FOO)\n // =>\n // if (macroCondition(getGlobalConfig('WarpDrive').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
|
|
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('WarpDrive')\n ),\n t.identifier('features')\n ),\n t.identifier(name)\n );\n node.replaceWith(\n // if (LOG_FOO)\n // =>\n // if (macroCondition(getGlobalConfig('WarpDrive').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;AAC7F,MAAMC,OAAO,GAAGL,GAAG,CAACK,OAAO;AAE3B,MAAMC,QAAQ,GAAGD,OAAO,CAACE,QAAQ,CAAC,OAAO,CAAC;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;AACb;AACA,EAAA,OAAO,KAAK;AACd;AAEe,qCAAA,EAAUC,KAAK,EAAE;EAC9B,MAAM;AAAEC,IAAAA,KAAK,EAAEC;AAAE,GAAC,GAAGF,KAAK;EAE1B,OAAO;AACLG,IAAAA,IAAI,EAAE,eAAe;AAAE;AACvBC,IAAAA,OAAO,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,CAAC,CAAC6B,gBAAgB,CAChC7B,CAAC,CAAC6B,gBAAgB,CAChB7B,CAAC,CAAC6B,gBAAgB,CAChB7B,CAAC,CAAC8B,cAAc,CAACzB,KAAK,CAAC0B,QAAQ,CAACC,MAAM,CAACT,CAAC,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,EACtFvB,CAAC,CAACiC,UAAU,CAAC,WAAW,CAC1B,CAAC,EACDjC,CAAC,CAACiC,UAAU,CAAC,UAAU,CACzB,CAAC,EACDjC,CAAC,CAACiC,UAAU,CAAChC,IAAI,CACnB,CAAC;AACDP,cAAAA,IAAI,CAAC+B,WAAW;AACd;AACA;AACA;AACAzB,cAAAA,CAAC,CAAC8B,cAAc,CAACzB,KAAK,CAAC0B,QAAQ,CAACC,MAAM,CAACT,CAAC,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,EAAE,CAChFC,eAAe,GAAGxB,CAAC,CAACkC,eAAe,CAAC,GAAG,EAAEN,SAAS,CAAC,GAAGA,SAAS,CAChE,CACH,CAAC;AACH,aAAC,CAAC;AACFf,YAAAA,SAAS,CAACO,KAAK,CAACe,gBAAgB,CAAClB,gBAAgB,CAAC;YAClDJ,SAAS,CAACuB,MAAM,EAAE;AACpB,WAAC,CAAC;UACF,IAAIhC,IAAI,CAACO,GAAG,CAAC,YAAY,CAAC,CAAC0B,MAAM,KAAK,CAAC,EAAE;YACvCjC,IAAI,CAACgC,MAAM,EAAE;AACf;AACF;OACD;AAEDE,MAAAA,OAAOA,CAAClC,IAAI,EAAEC,KAAK,EAAE;QACnBA,KAAK,CAAC0B,QAAQ,GAAG,IAAIQ,0BAAU,CAACvC,CAAC,EAAEI,IAAI,CAAC;AAC1C;AACF;GACD;AACH;;;;"}
|
|
@@ -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('WarpDrive')\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('WarpDrive').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
|
|
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('WarpDrive')\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('WarpDrive').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;AACb;AACA,EAAA,OAAO,KAAK;AACd;AAEe,oCAAA,EAAUC,KAAK,EAAE;EAC9B,MAAM;AAAEC,IAAAA,KAAK,EAAEC;AAAE,GAAC,GAAGF,KAAK;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;AAEzC,QAAA,IAAIF,UAAU,KAAKD,KAAK,CAACI,IAAI,CAACF,MAAM,EAAE;AACpC,UAAA,MAAMG,UAAU,GAAGN,IAAI,CAACO,GAAG,CAAC,YAAY,CAAC;AACzCD,UAAAA,UAAU,CAACE,OAAO,CAAEC,SAAS,IAAK;YAChC,IAAIZ,IAAI,GAAGY,SAAS,CAACnB,IAAI,CAACoB,QAAQ,CAACb,IAAI;YACvC,IAAI,EAAEA,IAAI,IAAII,KAAK,CAACI,IAAI,CAACM,KAAK,CAAC,EAAE;AAC/B,cAAA,MAAM,IAAIC,KAAK,CAAC,CAAA,gBAAA,EAAmBf,IAAI,CAAA,eAAA,EAAkBI,KAAK,CAACI,IAAI,CAACF,MAAM,CAAA,CAAE,CAAC;AAC/E;YACA,IAAIU,gBAAgB,GAAGJ,SAAS,CAACnB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ACF,IAAIhC,IAAI,CAACO,GAAG,CAAC,YAAY,CAAC,CAAC0B,MAAM,KAAK,CAAC,EAAE;YACvCjC,IAAI,CAACgC,MAAM,EAAE;AACf;AACF;OACD;AAEDE,MAAAA,OAAOA,CAAClC,IAAI,EAAEC,KAAK,EAAE;QACnBA,KAAK,CAACwB,QAAQ,GAAG,IAAIU,0BAAU,CAACvC,CAAC,EAAEI,IAAI,CAAC;AAC1C;AACF;GACD;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canary-features-BzGSGY5j.js","sources":["../src/canary-features.ts"],"sourcesContent":["/**\n * ## Canary Features\n *\n * EmberData allows users to test features that are implemented but not yet\n * available even in canary.\n *\n * Typically these features represent work that might introduce a new concept,\n * new API, change an API, or risk an unintended change in behavior to consuming\n * applications.\n *\n * Such features have their implementations guarded by a \"feature flag\", and the\n * flag is only activated once the core-data team is prepared to ship the work\n * in a canary release.\n *\n * ### Installing Canary\n *\n * To test a feature you MUST be using a canary build. Canary builds are published\n * to `npm` and can be installed using a precise tag (such as `ember-data@3.16.0-alpha.1`)\n * or by installing the latest dist-tag published to the `canary` channel using your javascript\n * package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n ```cli\n pnpm add ember-data@canary\n ```\n *\n * ### Activating a Canary Feature\n *\n * Once you have installed canary, feature-flags can be activated at build-time\n *\n * by setting an environment variable:\n *\n * ```cli\n * # Activate a single flag\n * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG ember build\n *\n * # Activate multiple flags by separating with commas\n * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build\n *\n * # Activate all flags\n * EMBER_DATA_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build\n * ```\n *\n * or by setting the appropriate flag in your `ember-cli-build` file:\n *\n * ```ts\n * let app = new EmberApp(defaults, {\n * emberData: {\n * features: {\n * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature\n * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior\n * }\n * }\n * })\n * ```\n *\n * **The \"off\" branch of feature-flagged code is always stripped from production builds.**\n *\n * The list of available feature-flags is located [here](https://github.com/emberjs/data/tree/main/packages/build-config/src/virtual/canary-features.ts \"List of EmberData FeatureFlags\")\n *\n *\n * ### Preparing a Project to use a Canary Feature\n *\n * For most projects, simple version detection should be enough.\n * Using the provided version compatibility helpers from [embroider-macros](https://github.com/embroider-build/embroider/tree/main/packages/macros#readme)\n * the following can be done:\n *\n * ```js\n * if (macroCondition(dependencySatisfies('@ember-data/store', '5.0'))) {\n * // do thing\n * }\n * ```\n *\n @module @warp-drive/build-config/canary-features\n @main @warp-drive/build-config/canary-features\n */\n/**\n This is the current list of features used at build time for canary releases.\n If empty there are no features currently gated by feature flags.\n\n The valid values are:\n\n - `true` | The feature is **enabled** at all times, and cannot be disabled.\n - `false` | The feature is **disabled** at all times, and cannot be enabled.\n - `null` | The feature is **disabled by default**, but can be enabled via configuration.\n\n @class CanaryFeatureFlags\n @public\n*/\nexport const SAMPLE_FEATURE_FLAG: boolean | null = null;\n"],"names":["SAMPLE_FEATURE_FLAG"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"canary-features-BzGSGY5j.js","sources":["../src/canary-features.ts"],"sourcesContent":["/**\n * ## Canary Features\n *\n * EmberData allows users to test features that are implemented but not yet\n * available even in canary.\n *\n * Typically these features represent work that might introduce a new concept,\n * new API, change an API, or risk an unintended change in behavior to consuming\n * applications.\n *\n * Such features have their implementations guarded by a \"feature flag\", and the\n * flag is only activated once the core-data team is prepared to ship the work\n * in a canary release.\n *\n * ### Installing Canary\n *\n * To test a feature you MUST be using a canary build. Canary builds are published\n * to `npm` and can be installed using a precise tag (such as `ember-data@3.16.0-alpha.1`)\n * or by installing the latest dist-tag published to the `canary` channel using your javascript\n * package manager of choice. For instance with [pnpm](https://pnpm.io/)\n\n ```cli\n pnpm add ember-data@canary\n ```\n *\n * ### Activating a Canary Feature\n *\n * Once you have installed canary, feature-flags can be activated at build-time\n *\n * by setting an environment variable:\n *\n * ```cli\n * # Activate a single flag\n * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG ember build\n *\n * # Activate multiple flags by separating with commas\n * EMBER_DATA_FEATURE_OVERRIDE=SOME_FLAG,OTHER_FLAG ember build\n *\n * # Activate all flags\n * EMBER_DATA_FEATURE_OVERRIDE=ENABLE_ALL_OPTIONAL ember build\n * ```\n *\n * or by setting the appropriate flag in your `ember-cli-build` file:\n *\n * ```ts\n * let app = new EmberApp(defaults, {\n * emberData: {\n * features: {\n * SAMPLE_FEATURE_FLAG: false // utliize existing behavior, strip code for the new feature\n * OTHER_FEATURE_FLAG: true // utilize this new feature, strip code for the older behavior\n * }\n * }\n * })\n * ```\n *\n * **The \"off\" branch of feature-flagged code is always stripped from production builds.**\n *\n * The list of available feature-flags is located [here](https://github.com/emberjs/data/tree/main/packages/build-config/src/virtual/canary-features.ts \"List of EmberData FeatureFlags\")\n *\n *\n * ### Preparing a Project to use a Canary Feature\n *\n * For most projects, simple version detection should be enough.\n * Using the provided version compatibility helpers from [embroider-macros](https://github.com/embroider-build/embroider/tree/main/packages/macros#readme)\n * the following can be done:\n *\n * ```js\n * if (macroCondition(dependencySatisfies('@ember-data/store', '5.0'))) {\n * // do thing\n * }\n * ```\n *\n @module @warp-drive/build-config/canary-features\n @main @warp-drive/build-config/canary-features\n */\n/**\n This is the current list of features used at build time for canary releases.\n If empty there are no features currently gated by feature flags.\n\n The valid values are:\n\n - `true` | The feature is **enabled** at all times, and cannot be disabled.\n - `false` | The feature is **disabled** at all times, and cannot be enabled.\n - `null` | The feature is **disabled by default**, but can be enabled via configuration.\n\n @class CanaryFeatureFlags\n @public\n*/\nexport const SAMPLE_FEATURE_FLAG: boolean | null = null;\n"],"names":["SAMPLE_FEATURE_FLAG"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACO,MAAMA,mBAAmC,GAAG;;;;;;;;;"}
|