@embroider/compat 1.8.0 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embroider/compat",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "private": false,
5
5
  "description": "Backward compatibility layer for the Embroider build system.",
6
6
  "repository": {
@@ -29,8 +29,8 @@
29
29
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
30
30
  "@babel/preset-env": "^7.14.5",
31
31
  "@babel/traverse": "^7.14.5",
32
- "@embroider/macros": "1.8.0",
33
- "@embroider/shared-internals": "1.8.0",
32
+ "@embroider/macros": "1.8.1",
33
+ "@embroider/shared-internals": "1.8.1",
34
34
  "@types/babel__code-frame": "^7.0.2",
35
35
  "@types/yargs": "^17.0.3",
36
36
  "assert-never": "^1.1.0",
@@ -85,7 +85,7 @@
85
85
  "typescript": "*"
86
86
  },
87
87
  "peerDependencies": {
88
- "@embroider/core": "1.8.0"
88
+ "@embroider/core": "1.8.1"
89
89
  },
90
90
  "engines": {
91
91
  "node": "12.* || 14.* || >= 16"
@@ -12,4 +12,5 @@ import V1Addon from '../v1-addon';
12
12
  */
13
13
  export default class extends V1Addon {
14
14
  get v2Tree(): import("broccoli-node-api").Node;
15
+ static shouldApplyAdapter(addonInstance: any): boolean;
15
16
  }
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const v1_addon_1 = __importDefault(require("../v1-addon"));
7
7
  const broccoli_file_creator_1 = __importDefault(require("broccoli-file-creator"));
8
8
  const broccoli_merge_trees_1 = __importDefault(require("broccoli-merge-trees"));
9
+ const semver_1 = __importDefault(require("semver"));
9
10
  function createIndexContents(config) {
10
11
  return `export default ${JSON.stringify(config)};`;
11
12
  }
@@ -30,6 +31,11 @@ class default_1 extends v1_addon_1.default {
30
31
  (0, broccoli_file_creator_1.default)('package.json', JSON.stringify(this.newPackageJSON, null, 2)),
31
32
  ]);
32
33
  }
34
+ // v2.1.0 now behaves the same under Embroider as it does in a classic build:
35
+ // https://github.com/mansona/ember-get-config/pull/45
36
+ static shouldApplyAdapter(addonInstance) {
37
+ return semver_1.default.lt(addonInstance.pkg.version, '2.1.0');
38
+ }
33
39
  }
34
40
  exports.default = default_1;
35
41
  //# sourceMappingURL=ember-get-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ember-get-config.js","sourceRoot":"","sources":["ember-get-config.ts"],"names":[],"mappings":";;;;;AAAA,2DAAkC;AAClC,kFAA8C;AAC9C,gFAA8C;AAE9C,SAAS,mBAAmB,CAAC,MAAW;IACtC,OAAO,kBAAkB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC;AACrD,CAAC;AAED;;;;;;;;;;GAUG;AACH,eAAqB,SAAQ,kBAAO;IAClC,IAAI,MAAM;QACR,iEAAiE;QACjE,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QACpD,MAAM,oBAAoB,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAExD,OAAO,IAAA,8BAAU,EAAC;YAChB,IAAA,+BAAS,EAAC,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;YAChE,IAAA,+BAAS,EAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;SACxE,CAAC,CAAC;IACL,CAAC;CACF;AAXD,4BAWC","sourcesContent":["import V1Addon from '../v1-addon';\nimport writeFile from 'broccoli-file-creator';\nimport mergeTrees from 'broccoli-merge-trees';\n\nfunction createIndexContents(config: any): string {\n return `export default ${JSON.stringify(config)};`;\n}\n\n/**\n * The `ember-get-config` addon conceptually does just one thing: re-exports the `config/environment` runtime module\n * from the host app so that addons can import it themseles. It handles the \"hard part\" of knowing what the host app's\n * module name is, since that's not something an addon can normally know ahead of time.\n *\n * From a dependency graph perspective though, declaring all of the dependencies correctly would require a circular\n * dependency from the addon back to the host app itself, which we don't want to introduce.\n *\n * We need to basically re-implement the entire addon's behavior so that it still exports the app's\n * `config/environment` runtime value, but without needing it to actually export from the host app's module.\n */\nexport default class extends V1Addon {\n get v2Tree() {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const configModule = require(this.app.configPath());\n const appEnvironmentConfig = configModule(this.app.env);\n\n return mergeTrees([\n writeFile('index.js', createIndexContents(appEnvironmentConfig)),\n writeFile('package.json', JSON.stringify(this.newPackageJSON, null, 2)),\n ]);\n }\n}\n"]}
1
+ {"version":3,"file":"ember-get-config.js","sourceRoot":"","sources":["ember-get-config.ts"],"names":[],"mappings":";;;;;AAAA,2DAAkC;AAClC,kFAA8C;AAC9C,gFAA8C;AAC9C,oDAA4B;AAE5B,SAAS,mBAAmB,CAAC,MAAW;IACtC,OAAO,kBAAkB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC;AACrD,CAAC;AAED;;;;;;;;;;GAUG;AACH,eAAqB,SAAQ,kBAAO;IAClC,IAAI,MAAM;QACR,iEAAiE;QACjE,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QACpD,MAAM,oBAAoB,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAExD,OAAO,IAAA,8BAAU,EAAC;YAChB,IAAA,+BAAS,EAAC,UAAU,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;YAChE,IAAA,+BAAS,EAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;SACxE,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,sDAAsD;IACtD,MAAM,CAAC,kBAAkB,CAAC,aAAkB;QAC1C,OAAO,gBAAM,CAAC,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC;CACF;AAjBD,4BAiBC","sourcesContent":["import V1Addon from '../v1-addon';\nimport writeFile from 'broccoli-file-creator';\nimport mergeTrees from 'broccoli-merge-trees';\nimport semver from 'semver';\n\nfunction createIndexContents(config: any): string {\n return `export default ${JSON.stringify(config)};`;\n}\n\n/**\n * The `ember-get-config` addon conceptually does just one thing: re-exports the `config/environment` runtime module\n * from the host app so that addons can import it themseles. It handles the \"hard part\" of knowing what the host app's\n * module name is, since that's not something an addon can normally know ahead of time.\n *\n * From a dependency graph perspective though, declaring all of the dependencies correctly would require a circular\n * dependency from the addon back to the host app itself, which we don't want to introduce.\n *\n * We need to basically re-implement the entire addon's behavior so that it still exports the app's\n * `config/environment` runtime value, but without needing it to actually export from the host app's module.\n */\nexport default class extends V1Addon {\n get v2Tree() {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const configModule = require(this.app.configPath());\n const appEnvironmentConfig = configModule(this.app.env);\n\n return mergeTrees([\n writeFile('index.js', createIndexContents(appEnvironmentConfig)),\n writeFile('package.json', JSON.stringify(this.newPackageJSON, null, 2)),\n ]);\n }\n\n // v2.1.0 now behaves the same under Embroider as it does in a classic build:\n // https://github.com/mansona/ember-get-config/pull/45\n static shouldApplyAdapter(addonInstance: any) {\n return semver.lt(addonInstance.pkg.version, '2.1.0');\n }\n}\n"]}