@embroider/compat 4.0.0-alpha.1 → 4.0.0-alpha.3
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/options.js +0 -8
- package/src/options.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embroider/compat",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Backward compatibility layer for the Embroider build system.",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"release-plan": {
|
|
21
21
|
"semverIncrementAs": {
|
|
22
|
-
"major": "
|
|
22
|
+
"major": "prerelease",
|
|
23
23
|
"minor": "prerelease",
|
|
24
24
|
"patch": "prerelease"
|
|
25
25
|
},
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"tree-sync": "^2.1.0",
|
|
69
69
|
"typescript-memoize": "^1.0.1",
|
|
70
70
|
"walk-sync": "^3.0.0",
|
|
71
|
-
"@embroider/macros": "1.17.0-alpha.
|
|
71
|
+
"@embroider/macros": "1.17.0-alpha.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@glimmer/syntax": "^0.84.3",
|
|
@@ -91,12 +91,12 @@
|
|
|
91
91
|
"ember-engines": "^0.8.19",
|
|
92
92
|
"scenario-tester": "^4.0.0",
|
|
93
93
|
"typescript": "^5.4.5",
|
|
94
|
-
"@embroider/core": "^4.0.0-alpha.
|
|
95
|
-
"@embroider/
|
|
96
|
-
"@embroider/
|
|
94
|
+
"@embroider/core": "^4.0.0-alpha.3",
|
|
95
|
+
"@embroider/test-support": "0.36.0",
|
|
96
|
+
"@embroider/sample-transforms": "0.0.0"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"@embroider/core": "^4.0.0-alpha.
|
|
99
|
+
"@embroider/core": "^4.0.0-alpha.3"
|
|
100
100
|
},
|
|
101
101
|
"engines": {
|
|
102
102
|
"node": "12.* || 14.* || >= 16"
|
package/src/options.js
CHANGED
|
@@ -14,14 +14,6 @@ const defaults = Object.assign((0, core_1.optionsWithDefaults)(), {
|
|
|
14
14
|
useAddonConfigModule: true,
|
|
15
15
|
});
|
|
16
16
|
function optionsWithDefaults(options) {
|
|
17
|
-
if ((options === null || options === void 0 ? void 0 : options.staticEmberSource) !== undefined) {
|
|
18
|
-
if (options.staticEmberSource === false) {
|
|
19
|
-
throw new Error(`You have set 'staticEmberSource' to 'false' in your Embroider options. This option has been removed is always considered to have the value 'true'. Please remove this setting to continue.`);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
console.log(`You have set 'staticEmberSource' in your Embroider options. This can safely be removed now and it defaults to true.`);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
17
|
if ((options === null || options === void 0 ? void 0 : options.staticEmberSource) !== undefined) {
|
|
26
18
|
if (options.staticEmberSource === false) {
|
|
27
19
|
throw new Error(`You have set 'staticEmberSource' to 'false' in your Embroider options. This option has been removed is always considered to have the value 'true'. Please remove this setting to continue.`);
|
package/src/options.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";;;AA+EA,
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["options.ts"],"names":[],"mappings":";;;AA+EA,kDA4CC;AAzHD,0CAA0E;AAgE1E,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAA,0BAAgB,GAAE,EAAE;IACjD,cAAc,EAAE,IAAI,GAAG,EAAE;IACzB,gBAAgB,EAAE,EAAE;IACpB,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,EAAE;IAChB,4BAA4B,EAAE,KAAK;IACnC,wBAAwB,EAAE,EAAE;IAC5B,eA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AC7E,+EAA+E;AAC/E,cAAc;AACD,QAAA,kBAAkB,GAAgC,MAAM,CAAC,MAAM,CAAC;IAC3E,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC;QACvB,4BAA4B,EAAE,KAAK;QACnC,gBAAgB,EAAE,IAAI;KACvB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import type { V1AddonConstructor } from './v1-addon';\nimport type { Options as CoreOptions } from '@embroider/core';\nimport { optionsWithDefaults as coreWithDefaults } from '@embroider/core';\nimport type { PackageRules } from './dependency-rules';\n\n// These options control how hard we will try to achieve compatibility with v1\n// addons. The defaults are conservative and try to maximize compatibility, at\n// the cost of slower or bigger builds. As you eliminate sources of legacy\n// behavior you can benefit from the more aggressive modes.\nexport default interface Options extends CoreOptions {\n // Allows you to override how specific addons will build. Like:\n //\n // import V1Addon from '@embroider/compat'; let compatAdapters = new Map();\n // compatAdapters.set('some-addon', class extends V1Addon {// do stuff here:\n // see examples in ./compat-adapters\n // });\n //\n // This should be understood as a temporary way to keep yourself from getting\n // stuck, not an alternative to actually fixing upstream. For the most part,\n // the real solution will be converting the addon in question to natively\n // publish as v2.\n //\n // We ship with some default compatAdapters to fix otherwise incompatible\n // behaviors in popular addons. You can override the default adapters by\n // setting your own value here (including null to completely disable it).\n compatAdapters?: Map<string, V1AddonConstructor | null>;\n\n // Allows you to tell Embroider about otherwise dynamic dependencies within\n // your app and addons that it can't figure out on its own. These are combined\n // with the default rules that ship with Embroider. Your own rules take\n // precedence over the built-ins. Order matters, first matching rule will\n // apply to any given addon.\n //\n // See the addon-dependency-rules directory in the @embroider/compat package\n // for the built-in rules.\n //\n // These ONLY APPLY to v1-formatted addons. An addon that ships as native v2\n // is expected to do the right thing on its own.\n //\n // Follow to the definition of PackageRules for more info.\n packageRules?: PackageRules[];\n\n // This turns build errors into runtime errors. It is not a good idea to keep\n // it on in production. But it can be helpful when testing how much of your\n // app is able to work with staticComponents enabled.\n allowUnsafeDynamicComponents?: boolean;\n\n // Allows you to customize the list of content types addons use to provide HTML\n // to {{content-for}}. By default, the following content types are expected:\n // 'head', 'test-head', 'head-footer', 'test-head-footer', 'body', 'test-body',\n // 'body-footer', 'test-body-footer'. You need to use this config only to extend\n // this list.\n availableContentForTypes?: string[];\n\n // Allows you to cancel the warning that at least one classic addon provides\n // content-for 'app-boot'. This warning brings awareness for developers\n // switching to Embroider, but is no longer necessary once content-for\n // 'app-boot' code has been properly moved to the app-side.\n useAddonAppBoot?: boolean;\n\n // content-for 'config-module'. This warning brings awareness for developers\n // switching to Embroider, but is no longer necessary once content-for\n // 'config-module' code has been properly moved to the app-side.\n useAddonConfigModule?: boolean;\n}\n\nconst defaults = Object.assign(coreWithDefaults(), {\n compatAdapters: new Map(),\n extraPublicTrees: [],\n workspaceDir: null,\n packageRules: [],\n allowUnsafeDynamicComponents: false,\n availableContentForTypes: [],\n useAddonAppBoot: true,\n useAddonConfigModule: true,\n});\n\nexport type CompatOptionsType = Required<Options>;\n\nexport function optionsWithDefaults(options?: Options): CompatOptionsType {\n if ((options as any)?.staticEmberSource !== undefined) {\n if ((options as any).staticEmberSource === false) {\n throw new Error(\n `You have set 'staticEmberSource' to 'false' in your Embroider options. This option has been removed is always considered to have the value 'true'. Please remove this setting to continue.`\n );\n } else {\n console.log(\n `You have set 'staticEmberSource' in your Embroider options. This can safely be removed now and it defaults to true.`\n );\n }\n }\n\n if ((options as any)?.staticAddonTrees !== undefined) {\n if ((options as any).staticAddonTrees === false) {\n throw new Error(\n `You have set 'staticAddonTrees' to 'false' in your Embroider options. This option has been removed is always considered to have the value 'true'. Please remove this setting to continue.`\n );\n } else {\n console.log(\n `You have set 'staticAddonTrees' in your Embroider options. This can safely be removed now and it defaults to true.`\n );\n }\n }\n\n if ((options as any)?.staticAddonTestSupportTrees !== undefined) {\n if ((options as any).staticAddonTestSupportTrees === false) {\n throw new Error(\n `You have set 'staticAddonTestSupportTrees' to 'false' in your Embroider options. This option has been removed is always considered to have the value 'true'. Please remove this setting to continue.`\n );\n } else {\n console.log(\n `You have set 'staticAddonTestSupportTrees' in your Embroider options. This can safely be removed now and it defaults to true.`\n );\n }\n }\n\n if ((options as any)?.skipBabel !== undefined) {\n throw new Error(\n `You have set 'skipBabel' on your Embroider options. This setting has been removed and you can now configure your babel ignores directly in the babel config in your repo https://babeljs.io/docs/options#ignore`\n );\n }\n\n return Object.assign({}, defaults, options);\n}\n\n// These are recommended configurations for addons to test themselves under. By\n// keeping them here, it's easier to do ecosystem-wide compatibility testing.\n// See the `@embroider/test-setup` package which can help consume these to test\n// them in CI.\nexport const recommendedOptions: { [name: string]: Options } = Object.freeze({\n safe: Object.freeze({}),\n optimized: Object.freeze({\n allowUnsafeDynamicComponents: false,\n staticInvokables: true,\n }),\n});\n"]}
|