@embroider/compat 3.4.6-unstable.a90d03d → 3.4.6-unstable.bdb7f3d

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embroider/compat",
3
- "version": "3.4.6-unstable.a90d03d",
3
+ "version": "3.4.6-unstable.bdb7f3d",
4
4
  "private": false,
5
5
  "description": "Backward compatibility layer for the Embroider build system.",
6
6
  "repository": {
@@ -30,7 +30,7 @@
30
30
  "@babel/preset-env": "^7.14.5",
31
31
  "@babel/runtime": "^7.18.6",
32
32
  "@babel/traverse": "^7.14.5",
33
- "@embroider/macros": "1.14.1-unstable.a90d03d",
33
+ "@embroider/macros": "1.14.1-unstable.bdb7f3d",
34
34
  "@types/babel__code-frame": "^7.0.2",
35
35
  "@types/yargs": "^17.0.3",
36
36
  "assert-never": "^1.1.0",
@@ -66,7 +66,7 @@
66
66
  "yargs": "^17.0.1"
67
67
  },
68
68
  "devDependencies": {
69
- "@embroider/core": "3.4.6-unstable.a90d03d",
69
+ "@embroider/core": "3.4.6-unstable.bdb7f3d",
70
70
  "@embroider/sample-transforms": "workspace:*",
71
71
  "@embroider/test-support": "workspace:*",
72
72
  "@glimmer/syntax": "^0.84.3",
@@ -91,7 +91,7 @@
91
91
  "typescript": "^5.1.6"
92
92
  },
93
93
  "peerDependencies": {
94
- "@embroider/core": "3.4.6-unstable.a90d03d"
94
+ "@embroider/core": "3.4.6-unstable.bdb7f3d"
95
95
  },
96
96
  "engines": {
97
97
  "node": "12.* || 14.* || >= 16"
@@ -45,10 +45,10 @@ const defaultPrebuildOptions = {
45
45
  es: [],
46
46
  },
47
47
  };
48
- function prebuild(emberApp, options = defaultPrebuildOptions) {
48
+ function prebuild(emberApp, options) {
49
49
  let outputPath;
50
50
  let addons;
51
- let embroiderApp = new _1.App(emberApp, options);
51
+ let embroiderApp = new _1.App(emberApp, { ...defaultPrebuildOptions, ...options });
52
52
  addons = new _1.Addons(embroiderApp);
53
53
  addons.ready().then(result => {
54
54
  outputPath = result.outputPath;
@@ -1 +1 @@
1
- {"version":3,"file":"default-pipeline.js","sourceRoot":"","sources":["default-pipeline.ts"],"names":[],"mappings":";;;;;;AACA,uCAA+C;AAC/C,wBAAgD;AAEhD,0CAAmD;AACnD,0CAAyC;AAEzC,kFAA8C;AAC9C,gFAA8C;AAC9C,mCAAoC;AACpC,+BAAqC;AACrC,mCAA2C;AAO3C,SAAgB,kBAAkB,CAAC,OAAe,EAAE,WAAmB;IACrE,IAAI,IAAI,GAAG,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,MAAM,CAAC,IAAA,cAAO,EAAC,IAAA,aAAS,EAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAE,CAAC,CAAC,CAAC;IACnD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzB,OAAO,IAAA,WAAI,EAAC,aAAM,EAAE,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;AALD,gDAKC;AAED,SAAwB,eAAe,CACrC,QAA0B,EAC1B,QAA+C,EAC/C,UAA4C,EAAE;IAE9C,IAAI,UAAkB,CAAC;IACvB,IAAI,MAAM,CAAC;IAEX,IAAI,YAAY,GAAG,IAAI,MAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE9C,MAAM,GAAG,IAAI,SAAY,CAAC,YAAY,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAC3B,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;QAC3B,OAAO,IAAA,8BAAU,EAAC,CAAC,MAAM,CAAC,IAAI,E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EAAC,CAAC,MAAM,CAAC,IAAI,EAAE,IAAA,+BAAS,EAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KACjF;IAED,OAAO,IAAA,8BAAU,EAAC,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAA,+BAAS,EAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAhBD,4BAgBC;AAED,SAAS,WAAW,CAAC,QAA6C;IAChE,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,oBAAoB,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,eAAe,CAAC,QAA0B;IACjD,IAAI,QAAQ,GAAc,EAAE,CAAC;IAC7B,IAAI,QAAQ,CAAC,GAAG,KAAK,YAAY,EAAE;QACjC,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,SAAS;YAClB,qBAAqB,EAAE,IAAI;SAC5B,CAAC,CAAC;QACH,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE;YACzB,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,UAAU;gBACnB,qBAAqB,EAAE,IAAI;aAC5B,CAAC,CAAC;SACJ;KACF;SAAM;QACL,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;YAClD,qBAAqB,EAAE,KAAK;SAC7B,CAAC,CAAC;KACJ;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type Options from './options';\nimport { recommendedOptions } from './options';\nimport { App, Addons as CompatAddons } from '.';\nimport type { PackagerConstructor, Variant, EmberAppInstance } from '@embroider/core';\nimport { toBroccoliPlugin } from '@embroider/core';\nimport { tmpdir } from '@embroider/core';\nimport type { Node } from 'broccoli-node-api';\nimport writeFile from 'broccoli-file-creator';\nimport mergeTrees from 'broccoli-merge-trees';\nimport { createHash } from 'crypto';\nimport { join, dirname } from 'path';\nimport { sync as pkgUpSync } from 'pkg-up';\n\nexport interface PipelineOptions<PackagerOptions> extends Options {\n packagerOptions?: PackagerOptions;\n variants?: Variant[];\n}\n\nexport function stableWorkspaceDir(appRoot: string, environment: string) {\n let hash = createHash('md5');\n hash.update(dirname(pkgUpSync({ cwd: appRoot })!));\n hash.update(environment);\n return join(tmpdir, 'embroider', hash.digest('hex').slice(0, 6));\n}\n\nexport default function defaultPipeline<PackagerOptions>(\n emberApp: EmberAppInstance,\n packager?: PackagerConstructor<PackagerOptions>,\n options: PipelineOptions<PackagerOptions> = {}\n): Node {\n let outputPath: string;\n let addons;\n\n let embroiderApp = new App(emberApp, options);\n\n addons = new CompatAddons(embroiderApp);\n addons.ready().then(result => {\n outputPath = result.outputPath;\n });\n\n if (process.env.STAGE1_ONLY) {\n return mergeTrees([addons.tree, writeFile('.stage1-output', () => outputPath)]);\n }\n\n if (process.env.STAGE2_ONLY || !packager) {\n return mergeTrees([embroiderApp.asStage(addons).tree, writeFile('.stage2-output', () => outputPath)]);\n }\n\n let BroccoliPackager = toBroccoliPlugin(packager);\n let variants = (options && options.variants) || defaultVariants(emberApp);\n return new BroccoliPackager(embroiderApp.asStage(addons), variants, options && options.packagerOptions);\n}\n\nconst defaultPrebuildOptions = {\n ...recommendedOptions.optimized,\n amdCompatibility: {\n es: [],\n },\n};\n\nexport function prebuild(emberApp: EmberAppInstance, options: Options = defaultPrebuildOptions): Node {\n let outputPath: string;\n let addons;\n\n let embroiderApp = new App(emberApp, options);\n\n addons = new CompatAddons(embroiderApp);\n addons.ready().then(result => {\n outputPath = result.outputPath;\n });\n\n if (process.env.STAGE1_ONLY) {\n return mergeTrees([addons.tree, writeFile('.stage1-output', () => outputPath)]);\n }\n\n return mergeTrees([embroiderApp.asStage(addons).tree, writeFile('.stage2-output', () => outputPath)]);\n}\n\nfunction hasFastboot(emberApp: EmberAppInstance | EmberAppInstance) {\n return emberApp.project.addons.find(a => a.name === 'ember-cli-fastboot');\n}\n\nfunction defaultVariants(emberApp: EmberAppInstance): Variant[] {\n let variants: Variant[] = [];\n if (emberApp.env === 'production') {\n variants.push({\n name: 'browser',\n runtime: 'browser',\n optimizeForProduction: true,\n });\n if (hasFastboot(emberApp)) {\n variants.push({\n name: 'fastboot',\n runtime: 'fastboot',\n optimizeForProduction: true,\n });\n }\n } else {\n variants.push({\n name: 'dev',\n runtime: hasFastboot(emberApp) ? 'all' : 'browser',\n optimizeForProduction: false,\n });\n }\n return variants;\n}\n"]}
1
+ {"version":3,"file":"default-pipeline.js","sourceRoot":"","sources":["default-pipeline.ts"],"names":[],"mappings":";;;;;;AACA,uCAA+C;AAC/C,wBAAgD;AAEhD,0CAAmD;AACnD,0CAAyC;AAEzC,kFAA8C;AAC9C,gFAA8C;AAC9C,mCAAoC;AACpC,+BAAqC;AACrC,mCAA2C;AAO3C,SAAgB,kBAAkB,CAAC,OAAe,EAAE,WAAmB;IACrE,IAAI,IAAI,GAAG,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,MAAM,CAAC,IAAA,cAAO,EAAC,IAAA,aAAS,EAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAE,CAAC,CAAC,CAAC;IACnD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzB,OAAO,IAAA,WAAI,EAAC,aAAM,EAAE,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;AALD,gDAKC;AAED,SAAwB,eAAe,CACrC,QAA0B,EAC1B,QAA+C,EAC/C,UAA4C,EAA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ACzB,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,UAAU;gBACnB,qBAAqB,EAAE,IAAI;aAC5B,CAAC,CAAC;SACJ;KACF;SAAM;QACL,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;YAClD,qBAAqB,EAAE,KAAK;SAC7B,CAAC,CAAC;KACJ;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import type Options from './options';\nimport { recommendedOptions } from './options';\nimport { App, Addons as CompatAddons } from '.';\nimport type { PackagerConstructor, Variant, EmberAppInstance } from '@embroider/core';\nimport { toBroccoliPlugin } from '@embroider/core';\nimport { tmpdir } from '@embroider/core';\nimport type { Node } from 'broccoli-node-api';\nimport writeFile from 'broccoli-file-creator';\nimport mergeTrees from 'broccoli-merge-trees';\nimport { createHash } from 'crypto';\nimport { join, dirname } from 'path';\nimport { sync as pkgUpSync } from 'pkg-up';\n\nexport interface PipelineOptions<PackagerOptions> extends Options {\n packagerOptions?: PackagerOptions;\n variants?: Variant[];\n}\n\nexport function stableWorkspaceDir(appRoot: string, environment: string) {\n let hash = createHash('md5');\n hash.update(dirname(pkgUpSync({ cwd: appRoot })!));\n hash.update(environment);\n return join(tmpdir, 'embroider', hash.digest('hex').slice(0, 6));\n}\n\nexport default function defaultPipeline<PackagerOptions>(\n emberApp: EmberAppInstance,\n packager?: PackagerConstructor<PackagerOptions>,\n options: PipelineOptions<PackagerOptions> = {}\n): Node {\n let outputPath: string;\n let addons;\n\n let embroiderApp = new App(emberApp, options);\n\n addons = new CompatAddons(embroiderApp);\n addons.ready().then(result => {\n outputPath = result.outputPath;\n });\n\n if (process.env.STAGE1_ONLY) {\n return mergeTrees([addons.tree, writeFile('.stage1-output', () => outputPath)]);\n }\n\n if (process.env.STAGE2_ONLY || !packager) {\n return mergeTrees([embroiderApp.asStage(addons).tree, writeFile('.stage2-output', () => outputPath)]);\n }\n\n let BroccoliPackager = toBroccoliPlugin(packager);\n let variants = (options && options.variants) || defaultVariants(emberApp);\n return new BroccoliPackager(embroiderApp.asStage(addons), variants, options && options.packagerOptions);\n}\n\nconst defaultPrebuildOptions = {\n ...recommendedOptions.optimized,\n amdCompatibility: {\n es: [],\n },\n};\n\nexport function prebuild(emberApp: EmberAppInstance, options?: Options): Node {\n let outputPath: string;\n let addons;\n\n let embroiderApp = new App(emberApp, { ...defaultPrebuildOptions, ...options });\n\n addons = new CompatAddons(embroiderApp);\n addons.ready().then(result => {\n outputPath = result.outputPath;\n });\n\n if (process.env.STAGE1_ONLY) {\n return mergeTrees([addons.tree, writeFile('.stage1-output', () => outputPath)]);\n }\n\n return mergeTrees([embroiderApp.asStage(addons).tree, writeFile('.stage2-output', () => outputPath)]);\n}\n\nfunction hasFastboot(emberApp: EmberAppInstance | EmberAppInstance) {\n return emberApp.project.addons.find(a => a.name === 'ember-cli-fastboot');\n}\n\nfunction defaultVariants(emberApp: EmberAppInstance): Variant[] {\n let variants: Variant[] = [];\n if (emberApp.env === 'production') {\n variants.push({\n name: 'browser',\n runtime: 'browser',\n optimizeForProduction: true,\n });\n if (hasFastboot(emberApp)) {\n variants.push({\n name: 'fastboot',\n runtime: 'fastboot',\n optimizeForProduction: true,\n });\n }\n } else {\n variants.push({\n name: 'dev',\n runtime: hasFastboot(emberApp) ? 'all' : 'browser',\n optimizeForProduction: false,\n });\n }\n return variants;\n}\n"]}