@embroider/compat 3.7.1-unstable.449a68c → 3.7.1-unstable.528a2f4
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 +7 -7
- package/src/default-pipeline.d.ts +1 -3
- package/src/default-pipeline.js +0 -59
- package/src/default-pipeline.js.map +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -2
- package/src/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embroider/compat",
|
|
3
|
-
"version": "3.7.1-unstable.
|
|
3
|
+
"version": "3.7.1-unstable.528a2f4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Backward compatibility layer for the Embroider build system.",
|
|
6
6
|
"repository": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"typescript-memoize": "^1.0.1",
|
|
66
66
|
"walk-sync": "^3.0.0",
|
|
67
67
|
"yargs": "^17.0.1",
|
|
68
|
-
"@embroider/macros": "1.16.10-unstable.
|
|
68
|
+
"@embroider/macros": "1.16.10-unstable.528a2f4"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@glimmer/syntax": "^0.84.3",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@types/js-string-escape": "^1.0.0",
|
|
81
81
|
"@types/jsdom": "^16.2.11",
|
|
82
82
|
"@types/lodash": "^4.14.170",
|
|
83
|
-
"@types/node": "^
|
|
83
|
+
"@types/node": "^22.9.3",
|
|
84
84
|
"@types/resolve": "^1.20.0",
|
|
85
85
|
"@types/semver": "^7.3.6",
|
|
86
86
|
"broccoli-node-api": "^1.7.0",
|
|
@@ -88,12 +88,12 @@
|
|
|
88
88
|
"ember-engines": "^0.8.19",
|
|
89
89
|
"scenario-tester": "^4.0.0",
|
|
90
90
|
"typescript": "^5.4.5",
|
|
91
|
-
"@embroider/
|
|
92
|
-
"@embroider/
|
|
93
|
-
"@embroider/
|
|
91
|
+
"@embroider/test-support": "0.36.0",
|
|
92
|
+
"@embroider/core": "^3.4.20-unstable.528a2f4",
|
|
93
|
+
"@embroider/sample-transforms": "0.0.0"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@embroider/core": "^3.4.20-unstable.
|
|
96
|
+
"@embroider/core": "^3.4.20-unstable.528a2f4"
|
|
97
97
|
},
|
|
98
98
|
"engines": {
|
|
99
99
|
"node": "12.* || 14.* || >= 16"
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type Options from './options';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Variant, EmberAppInstance } from '@embroider/core';
|
|
3
3
|
import type { Node } from 'broccoli-node-api';
|
|
4
4
|
export interface PipelineOptions<PackagerOptions> extends Options {
|
|
5
5
|
packagerOptions?: PackagerOptions;
|
|
6
6
|
variants?: Variant[];
|
|
7
7
|
}
|
|
8
|
-
export declare function stableWorkspaceDir(appRoot: string, environment: string): string;
|
|
9
|
-
export default function defaultPipeline<PackagerOptions>(emberApp: EmberAppInstance, packager?: PackagerConstructor<PackagerOptions>, options?: PipelineOptions<PackagerOptions>): Node;
|
|
10
8
|
export declare function prebuild(emberApp: EmberAppInstance, options?: Options): Node;
|
package/src/default-pipeline.js
CHANGED
|
@@ -3,42 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.stableWorkspaceDir = stableWorkspaceDir;
|
|
7
|
-
exports.default = defaultPipeline;
|
|
8
6
|
exports.prebuild = prebuild;
|
|
9
7
|
const options_1 = require("./options");
|
|
10
8
|
const _1 = require(".");
|
|
11
|
-
const core_1 = require("@embroider/core");
|
|
12
|
-
const core_2 = require("@embroider/core");
|
|
13
9
|
const broccoli_file_creator_1 = __importDefault(require("broccoli-file-creator"));
|
|
14
10
|
const broccoli_merge_trees_1 = __importDefault(require("broccoli-merge-trees"));
|
|
15
|
-
const crypto_1 = require("crypto");
|
|
16
|
-
const path_1 = require("path");
|
|
17
|
-
const pkg_up_1 = require("pkg-up");
|
|
18
|
-
function stableWorkspaceDir(appRoot, environment) {
|
|
19
|
-
let hash = (0, crypto_1.createHash)('md5');
|
|
20
|
-
hash.update((0, path_1.dirname)((0, pkg_up_1.sync)({ cwd: appRoot })));
|
|
21
|
-
hash.update(environment);
|
|
22
|
-
return (0, path_1.join)(core_2.tmpdir, 'embroider', hash.digest('hex').slice(0, 6));
|
|
23
|
-
}
|
|
24
|
-
function defaultPipeline(emberApp, packager, options = {}) {
|
|
25
|
-
let outputPath;
|
|
26
|
-
let addons;
|
|
27
|
-
let embroiderApp = new _1.App(emberApp, options);
|
|
28
|
-
addons = new _1.Addons(embroiderApp);
|
|
29
|
-
addons.ready().then(result => {
|
|
30
|
-
outputPath = result.outputPath;
|
|
31
|
-
});
|
|
32
|
-
if (process.env.STAGE1_ONLY) {
|
|
33
|
-
return (0, broccoli_merge_trees_1.default)([addons.tree, (0, broccoli_file_creator_1.default)('.stage1-output', () => outputPath)]);
|
|
34
|
-
}
|
|
35
|
-
if (process.env.STAGE2_ONLY || !packager) {
|
|
36
|
-
return (0, broccoli_merge_trees_1.default)([embroiderApp.asStage(addons).tree, (0, broccoli_file_creator_1.default)('.stage2-output', () => outputPath)]);
|
|
37
|
-
}
|
|
38
|
-
let BroccoliPackager = (0, core_1.toBroccoliPlugin)(packager);
|
|
39
|
-
let variants = (options && options.variants) || defaultVariants(emberApp);
|
|
40
|
-
return new BroccoliPackager(embroiderApp.asStage(addons), variants, options && options.packagerOptions);
|
|
41
|
-
}
|
|
42
11
|
const defaultPrebuildOptions = {
|
|
43
12
|
...options_1.recommendedOptions.optimized,
|
|
44
13
|
amdCompatibility: {
|
|
@@ -58,32 +27,4 @@ function prebuild(emberApp, options) {
|
|
|
58
27
|
}
|
|
59
28
|
return (0, broccoli_merge_trees_1.default)([embroiderApp.asStage(addons).tree, (0, broccoli_file_creator_1.default)('.stage2-output', () => outputPath)]);
|
|
60
29
|
}
|
|
61
|
-
function hasFastboot(emberApp) {
|
|
62
|
-
return emberApp.project.addons.find(a => a.name === 'ember-cli-fastboot');
|
|
63
|
-
}
|
|
64
|
-
function defaultVariants(emberApp) {
|
|
65
|
-
let variants = [];
|
|
66
|
-
if (emberApp.env === 'production') {
|
|
67
|
-
variants.push({
|
|
68
|
-
name: 'browser',
|
|
69
|
-
runtime: 'browser',
|
|
70
|
-
optimizeForProduction: true,
|
|
71
|
-
});
|
|
72
|
-
if (hasFastboot(emberApp)) {
|
|
73
|
-
variants.push({
|
|
74
|
-
name: 'fastboot',
|
|
75
|
-
runtime: 'fastboot',
|
|
76
|
-
optimizeForProduction: true,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
variants.push({
|
|
82
|
-
name: 'dev',
|
|
83
|
-
runtime: hasFastboot(emberApp) ? 'all' : 'browser',
|
|
84
|
-
optimizeForProduction: false,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
return variants;
|
|
88
|
-
}
|
|
89
30
|
//# sourceMappingURL=default-pipeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-pipeline.js","sourceRoot":"","sources":["default-pipeline.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"default-pipeline.js","sourceRoot":"","sources":["default-pipeline.ts"],"names":[],"mappings":";;;;;AAoBA,4BAgBC;AAnCD,uCAA+C;AAC/C,wBAAgD;AAGhD,kFAA8C;AAC9C,gFAA8C;AAO9C,MAAM,sBAAsB,GAAG;IAC7B,GAAG,4BAAkB,CAAC,SAAS;IAC/B,gBAAgB,EAAE;QAChB,EAAE,EAAE,EAAE;KACP;CACF,CAAC;AAEF,SAAgB,QAAQ,CAAC,QAA0B,EAAE,OAAiB;IACpE,IAAI,UAAkB,CAAC;IACvB,IAAI,MAAM,CAAC;IAEX,IAAI,YAAY,GAAG,IAAI,MAAG,CAAC,QAAQ,EAAE,EAAE,GAAG,sBAAsB,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAEhF,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,CAAC;QAC5B,OAAO,IAAA,8BAAU,EAAC,CAAC,MAAM,CAAC,IAAI,EAAE,IAAA,+BAAS,EAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAClF,CAAC;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","sourcesContent":["import type Options from './options';\nimport { recommendedOptions } from './options';\nimport { App, Addons as CompatAddons } from '.';\nimport type { Variant, EmberAppInstance } from '@embroider/core';\nimport type { Node } from 'broccoli-node-api';\nimport writeFile from 'broccoli-file-creator';\nimport mergeTrees from 'broccoli-merge-trees';\n\nexport interface PipelineOptions<PackagerOptions> extends Options {\n packagerOptions?: PackagerOptions;\n variants?: Variant[];\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"]}
|
package/src/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export { default as App } from './compat-app';
|
|
|
2
2
|
export { default as Addons } from './compat-addons';
|
|
3
3
|
export { default as Options, recommendedOptions } from './options';
|
|
4
4
|
export { default as V1Addon } from './v1-addon';
|
|
5
|
-
export {
|
|
5
|
+
export { prebuild, PipelineOptions } from './default-pipeline';
|
|
6
6
|
export { PackageRules, ModuleRules } from './dependency-rules';
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.prebuild = exports.
|
|
6
|
+
exports.prebuild = exports.V1Addon = exports.recommendedOptions = exports.Addons = exports.App = void 0;
|
|
7
7
|
var compat_app_1 = require("./compat-app");
|
|
8
8
|
Object.defineProperty(exports, "App", { enumerable: true, get: function () { return __importDefault(compat_app_1).default; } });
|
|
9
9
|
var compat_addons_1 = require("./compat-addons");
|
|
@@ -13,6 +13,5 @@ Object.defineProperty(exports, "recommendedOptions", { enumerable: true, get: fu
|
|
|
13
13
|
var v1_addon_1 = require("./v1-addon");
|
|
14
14
|
Object.defineProperty(exports, "V1Addon", { enumerable: true, get: function () { return __importDefault(v1_addon_1).default; } });
|
|
15
15
|
var default_pipeline_1 = require("./default-pipeline");
|
|
16
|
-
Object.defineProperty(exports, "compatBuild", { enumerable: true, get: function () { return __importDefault(default_pipeline_1).default; } });
|
|
17
16
|
Object.defineProperty(exports, "prebuild", { enumerable: true, get: function () { return default_pipeline_1.prebuild; } });
|
|
18
17
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA,2CAA8C;AAArC,kHAAA,OAAO,OAAO;AACvB,iDAAoD;AAA3C,wHAAA,OAAO,OAAU;AAC1B,qCAAmE;AAAtC,6GAAA,kBAAkB,OAAA;AAC/C,uCAAgD;AAAvC,oHAAA,OAAO,OAAW;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;AAAA,2CAA8C;AAArC,kHAAA,OAAO,OAAO;AACvB,iDAAoD;AAA3C,wHAAA,OAAO,OAAU;AAC1B,qCAAmE;AAAtC,6GAAA,kBAAkB,OAAA;AAC/C,uCAAgD;AAAvC,oHAAA,OAAO,OAAW;AAC3B,uDAA+D;AAAtD,4GAAA,QAAQ,OAAA","sourcesContent":["export { default as App } from './compat-app';\nexport { default as Addons } from './compat-addons';\nexport { default as Options, recommendedOptions } from './options';\nexport { default as V1Addon } from './v1-addon';\nexport { prebuild, PipelineOptions } from './default-pipeline';\nexport { PackageRules, ModuleRules } from './dependency-rules';\n"]}
|