@embroider/compat 3.0.1 → 3.0.2-unstable.47e7548

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.0.1",
3
+ "version": "3.0.2-unstable.47e7548",
4
4
  "private": false,
5
5
  "description": "Backward compatibility layer for the Embroider build system.",
6
6
  "repository": {
@@ -19,12 +19,16 @@
19
19
  "bin": {
20
20
  "embroider-compat-audit": "./src/audit-cli.js"
21
21
  },
22
+ "scripts": {
23
+ "test": "jest"
24
+ },
22
25
  "dependencies": {
23
26
  "@babel/code-frame": "^7.14.5",
24
27
  "@babel/core": "^7.14.5",
25
28
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
26
29
  "@babel/preset-env": "^7.14.5",
27
30
  "@babel/traverse": "^7.14.5",
31
+ "@embroider/macros": "1.11.1-unstable.47e7548",
28
32
  "@types/babel__code-frame": "^7.0.2",
29
33
  "@types/yargs": "^17.0.3",
30
34
  "assert-never": "^1.1.0",
@@ -55,10 +59,11 @@
55
59
  "tree-sync": "^2.1.0",
56
60
  "typescript-memoize": "^1.0.1",
57
61
  "walk-sync": "^3.0.0",
58
- "yargs": "^17.0.1",
59
- "@embroider/macros": "1.11.0"
62
+ "yargs": "^17.0.1"
60
63
  },
61
64
  "devDependencies": {
65
+ "@embroider/sample-transforms": "workspace:*",
66
+ "@embroider/test-support": "workspace:*",
62
67
  "@glimmer/syntax": "^0.84.2",
63
68
  "@glint/template": "^1.0.0",
64
69
  "@types/babel__core": "^7.1.14",
@@ -78,20 +83,15 @@
78
83
  "code-equality-assertions": "^0.9.0",
79
84
  "ember-engines": "^0.8.19",
80
85
  "scenario-tester": "^2.1.2",
81
- "typescript": "^4.9.0",
82
- "@embroider/test-support": "0.36.0",
83
- "@embroider/sample-transforms": "0.0.0"
86
+ "typescript": "^4.9.0"
84
87
  },
85
88
  "peerDependencies": {
86
- "@embroider/core": "^3.0.1"
89
+ "@embroider/core": "3.0.2-unstable.47e7548"
87
90
  },
88
91
  "engines": {
89
92
  "node": "12.* || 14.* || >= 16"
90
93
  },
91
94
  "volta": {
92
95
  "extends": "../../package.json"
93
- },
94
- "scripts": {
95
- "test": "jest"
96
96
  }
97
- }
97
+ }
package/src/audit-cli.js CHANGED
File without changes
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 Edward Faulkner
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1 +0,0 @@
1
- export default function inlineHBSTransform(): unknown;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- function inlineHBSTransform() {
4
- return {
5
- visitor: {
6
- ImportDefaultSpecifier(path) {
7
- if (path.node.local.name === 'require') {
8
- path.scope.rename('require');
9
- }
10
- },
11
- },
12
- };
13
- }
14
- exports.default = inlineHBSTransform;
15
- //# sourceMappingURL=rename-require-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rename-require-plugin.js","sourceRoot":"","sources":["rename-require-plugin.ts"],"names":[],"mappings":";;AAGA,SAAwB,kBAAkB;IACxC,OAAO;QACL,OAAO,EAAE;YACP,sBAAsB,CAAC,IAAwC;gBAC7D,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;oBACtC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;iBAC9B;YACH,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAVD,qCAUC","sourcesContent":["import type { types as t } from '@babel/core';\nimport type { NodePath } from '@babel/traverse';\n\nexport default function inlineHBSTransform(): unknown {\n return {\n visitor: {\n ImportDefaultSpecifier(path: NodePath<t.ImportDefaultSpecifier>) {\n if (path.node.local.name === 'require') {\n path.scope.rename('require');\n }\n },\n },\n };\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { EmberAppInstance } from '@embroider/core';
2
- import Options from './options';
3
- export declare function convertLegacyAddons(emberApp: EmberAppInstance, maybeOptions?: Options): Node;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.convertLegacyAddons = void 0;
7
- const core_1 = require("@embroider/core");
8
- const v1_instance_cache_1 = __importDefault(require("./v1-instance-cache"));
9
- const options_1 = require("./options");
10
- const build_compat_addon_1 = __importDefault(require("./build-compat-addon"));
11
- const broccoli_funnel_1 = require("broccoli-funnel");
12
- const crypto_1 = __importDefault(require("crypto"));
13
- const broccoli_merge_trees_1 = __importDefault(require("broccoli-merge-trees"));
14
- const broccoli_file_creator_1 = __importDefault(require("broccoli-file-creator"));
15
- function convertLegacyAddons(emberApp, maybeOptions) {
16
- let options = (0, options_1.optionsWithDefaults)(maybeOptions);
17
- let instanceCache = v1_instance_cache_1.default.forApp(emberApp, options);
18
- let packageCache = core_1.PackageCache.shared('embroider-unified', instanceCache.app.root);
19
- let v1Addons = findV1Addons(packageCache.get(instanceCache.app.root));
20
- let addonIndex = Object.create(null);
21
- for (let pkg of v1Addons) {
22
- addonIndex[pkg.root] = `${pkg.name}.${hashed(pkg.root)}`;
23
- }
24
- let interiorTrees = [];
25
- let exteriorTrees = [...v1Addons].map(pkg => {
26
- let interior = (0, build_compat_addon_1.default)(pkg, instanceCache);
27
- interiorTrees.push(interior);
28
- return new broccoli_funnel_1.Funnel(interior, { destDir: addonIndex[pkg.root] });
29
- });
30
- return (0, broccoli_merge_trees_1.default)([
31
- ...exteriorTrees,
32
- new broccoli_funnel_1.Funnel(instanceCache.app.synthesizeStylesPackage(interiorTrees), {
33
- destDir: '@embroider/synthesized-styles',
34
- }),
35
- new broccoli_funnel_1.Funnel(instanceCache.app.synthesizeVendorPackage(interiorTrees), {
36
- destDir: '@embroider/synthesized-vendor',
37
- }),
38
- (0, broccoli_file_creator_1.default)('v1-addon-index.json', JSON.stringify({ v1Addons: addonIndex }, null, 2)),
39
- ]);
40
- }
41
- exports.convertLegacyAddons = convertLegacyAddons;
42
- function findV1Addons(pkg, seen = new Set(), output = new Set()) {
43
- for (let dep of pkg.dependencies) {
44
- if (seen.has(dep)) {
45
- continue;
46
- }
47
- seen.add(dep);
48
- if (dep.isEmberPackage()) {
49
- if (!dep.isV2Addon()) {
50
- output.add(dep);
51
- }
52
- findV1Addons(dep, seen, output);
53
- }
54
- }
55
- return output;
56
- }
57
- function hashed(path) {
58
- let h = crypto_1.default.createHash('sha1');
59
- return h.update(path).digest('hex').slice(0, 8);
60
- }
61
- //# sourceMappingURL=standalone-addon-build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"standalone-addon-build.js","sourceRoot":"","sources":["standalone-addon-build.ts"],"names":[],"mappings":";;;;;;AAAA,0CAA0E;AAC1E,4EAAkD;AAClD,uCAAyD;AACzD,8EAAoD;AAC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YACnE,OAAO,EAAE,+BAA+B;SACzC,CAAC;QACF,IAAI,wBAAM,CAAC,aAAa,CAAC,GAAG,CAAC,uBAAuB,CAAC,aAAa,CAAC,EAAE;YACnE,OAAO,EAAE,+BAA+B;SACzC,CAAC;QACF,IAAA,+BAAS,EAAC,qBAAqB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;KACpF,CAAC,CAAC;AACL,CAAC;AA5BD,kDA4BC;AAED,SAAS,YAAY,CAAC,GAAY,EAAE,OAAqB,IAAI,GAAG,EAAE,EAAE,SAAuB,IAAI,GAAG,EAAE;IAClG,KAAK,IAAI,GAAG,IAAI,GAAG,CAAC,YAAY,EAAE;QAChC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACjB,SAAS;SACV;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,IAAI,GAAG,CAAC,cAAc,EAAE,EAAE;YACxB,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE;gBACpB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;aACjB;YACD,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;SACjC;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC,GAAG,gBAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import { EmberAppInstance, Package, PackageCache } from '@embroider/core';\nimport V1InstanceCache from './v1-instance-cache';\nimport Options, { optionsWithDefaults } from './options';\nimport buildCompatAddon from './build-compat-addon';\nimport { Funnel } from 'broccoli-funnel';\nimport crypto from 'crypto';\nimport broccoliMergeTrees from 'broccoli-merge-trees';\nimport writeFile from 'broccoli-file-creator';\nimport type { Node } from 'broccoli-node-api';\n\nexport function convertLegacyAddons(emberApp: EmberAppInstance, maybeOptions?: Options) {\n let options = optionsWithDefaults(maybeOptions);\n let instanceCache = V1InstanceCache.forApp(emberApp, options);\n let packageCache = PackageCache.shared('embroider-unified', instanceCache.app.root);\n let v1Addons = findV1Addons(packageCache.get(instanceCache.app.root));\n\n let addonIndex = Object.create(null);\n for (let pkg of v1Addons) {\n addonIndex[pkg.root] = `${pkg.name}.${hashed(pkg.root)}`;\n }\n\n let interiorTrees: Node[] = [];\n let exteriorTrees = [...v1Addons].map(pkg => {\n let interior = buildCompatAddon(pkg, instanceCache);\n interiorTrees.push(interior);\n return new Funnel(interior, { destDir: addonIndex[pkg.root] });\n });\n\n return broccoliMergeTrees([\n ...exteriorTrees,\n new Funnel(instanceCache.app.synthesizeStylesPackage(interiorTrees), {\n destDir: '@embroider/synthesized-styles',\n }),\n new Funnel(instanceCache.app.synthesizeVendorPackage(interiorTrees), {\n destDir: '@embroider/synthesized-vendor',\n }),\n writeFile('v1-addon-index.json', JSON.stringify({ v1Addons: addonIndex }, null, 2)),\n ]);\n}\n\nfunction findV1Addons(pkg: Package, seen: Set<Package> = new Set(), output: Set<Package> = new Set()): Set<Package> {\n for (let dep of pkg.dependencies) {\n if (seen.has(dep)) {\n continue;\n }\n seen.add(dep);\n if (dep.isEmberPackage()) {\n if (!dep.isV2Addon()) {\n output.add(dep);\n }\n findV1Addons(dep, seen, output);\n }\n }\n return output;\n}\n\nfunction hashed(path: string): string {\n let h = crypto.createHash('sha1');\n return h.update(path).digest('hex').slice(0, 8);\n}\n"]}