From aa455112ea61fc18981ba433b1173d0fea1bd0aa Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Thu, 30 Nov 2023 14:01:12 +0000 Subject: [PATCH 01/12] force importSync to always be eager --- .../macros/src/babel/macros-babel-plugin.ts | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/packages/macros/src/babel/macros-babel-plugin.ts b/packages/macros/src/babel/macros-babel-plugin.ts index f4494f740..02582dac1 100644 --- a/packages/macros/src/babel/macros-babel-plugin.ts +++ b/packages/macros/src/babel/macros-babel-plugin.ts @@ -121,25 +121,12 @@ export default function main(context: typeof Babel): unknown { // For example ember-auto-import needs to do some custom transforms to enable use of dynamic template strings, // so its babel plugin needs to see and handle the importSync call first! if (callee.referencesImport('@embroider/macros', 'importSync')) { - if (state.opts.importSyncImplementation === 'eager') { - let specifier = path.node.arguments[0]; - if (specifier?.type !== 'StringLiteral') { - throw new Error(`importSync eager mode doesn't implement non string literal arguments yet`); - } - path.replaceWith(state.importUtil.import(path, specifier.value, '*')); - state.calledIdentifiers.add(callee.node); - } else { - if (path.scope.hasBinding('require')) { - path.scope.rename('require'); - } - let r = t.identifier('require'); - state.generatedRequires.add(r); - path.replaceWith( - t.callExpression(state.importUtil.import(path, state.pathToOurAddon('es-compat2'), 'default', 'esc'), [ - t.callExpression(r, path.node.arguments), - ]) - ); + let specifier = path.node.arguments[0]; + if (specifier?.type !== 'StringLiteral') { + throw new Error(`importSync eager mode doesn't implement non string literal arguments yet`); } + path.replaceWith(state.importUtil.import(path, specifier.value, '*')); + state.calledIdentifiers.add(callee.node); return; } }, From 5d511cced22ecf58b604419ca327a4de35d2dcd2 Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Thu, 30 Nov 2023 14:17:44 +0000 Subject: [PATCH 02/12] clean up importSyncImplementation config --- packages/macros/src/babel/each.ts | 3 ++- .../macros/src/babel/macros-babel-plugin.ts | 3 +-- packages/macros/src/babel/state.ts | 21 ++----------------- packages/macros/src/macros-config.ts | 17 +-------------- 4 files changed, 6 insertions(+), 38 deletions(-) diff --git a/packages/macros/src/babel/each.ts b/packages/macros/src/babel/each.ts index 795cbbed4..1474d112e 100644 --- a/packages/macros/src/babel/each.ts +++ b/packages/macros/src/babel/each.ts @@ -4,6 +4,7 @@ import type { types as t } from '@babel/core'; import error from './error'; import type State from './state'; import type * as Babel from '@babel/core'; +import cloneDeep from 'lodash/cloneDeep'; type CallEachExpression = NodePath & { get(callee: 'callee'): NodePath; @@ -58,7 +59,7 @@ export function insertEach(path: EachPath, state: State, context: typeof Babel) for (let target of nameRefs) { target.replaceWith(literalElement); } - path.insertBefore(state.cloneDeep(path.get('body').node)); + path.insertBefore(cloneDeep(path.get('body').node)); } path.remove(); } diff --git a/packages/macros/src/babel/macros-babel-plugin.ts b/packages/macros/src/babel/macros-babel-plugin.ts index 02582dac1..2fa9f7b1c 100644 --- a/packages/macros/src/babel/macros-babel-plugin.ts +++ b/packages/macros/src/babel/macros-babel-plugin.ts @@ -174,9 +174,8 @@ export default function main(context: typeof Babel): unknown { } if ( - state.opts.importSyncImplementation === 'cjs' && + state.opts.hideRequires && path.node.name === 'require' && - !state.generatedRequires.has(path.node) && !path.scope.hasBinding('require') && state.owningPackage().isEmberPackage() ) { diff --git a/packages/macros/src/babel/state.ts b/packages/macros/src/babel/state.ts index 21785c8df..b32de344f 100644 --- a/packages/macros/src/babel/state.ts +++ b/packages/macros/src/babel/state.ts @@ -1,6 +1,4 @@ import type { NodePath, Node } from '@babel/traverse'; -import cloneDeepWith from 'lodash/cloneDeepWith'; -import lodashCloneDeep from 'lodash/cloneDeep'; import { join, dirname, resolve } from 'path'; import type { Package } from '@embroider/shared-internals'; import { cleanUrl, explicitRelative, RewrittenPackageCache } from '@embroider/shared-internals'; @@ -9,7 +7,6 @@ import type * as Babel from '@babel/core'; export default interface State { importUtil: ImportUtil; - generatedRequires: Set; removed: Set; calledIdentifiers: Set; jobs: (() => void)[]; @@ -18,7 +15,6 @@ export default interface State { pathToOurAddon(moduleName: string): string; owningPackage(): Package; originalOwningPackage(): Package; - cloneDeep(node: Node): Node; opts: { userConfigs: { @@ -45,15 +41,14 @@ export default interface State { embroiderMacrosConfigMarker: true; - mode: 'compile-time' | 'run-time'; + hideRequires: boolean; - importSyncImplementation: 'cjs' | 'eager'; + mode: 'compile-time' | 'run-time'; }; } export function initState(t: typeof Babel.types, path: NodePath, state: State) { state.importUtil = new ImportUtil(t, path); - state.generatedRequires = new Set(); state.jobs = []; state.removed = new Set(); state.calledIdentifiers = new Set(); @@ -62,7 +57,6 @@ export function initState(t: typeof Babel.types, path: NodePath Date: Thu, 30 Nov 2023 14:27:48 +0000 Subject: [PATCH 03/12] add compat-adapter to fix ember-fetch --- .../compat/src/compat-adapters/ember-fetch.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/compat/src/compat-adapters/ember-fetch.ts diff --git a/packages/compat/src/compat-adapters/ember-fetch.ts b/packages/compat/src/compat-adapters/ember-fetch.ts new file mode 100644 index 000000000..984fc2e69 --- /dev/null +++ b/packages/compat/src/compat-adapters/ember-fetch.ts @@ -0,0 +1,16 @@ +import V1Addon from '../v1-addon'; +import type { AddonMeta } from '@embroider/core'; + +export default class extends V1Addon { + get packageMeta(): Partial { + let meta = super.packageMeta; + + // this file is not accessible from the outside of ember-fetch and is not being used inside ember-fetch so it's dead code + // but it is importing `@ember/polyfills` which casues ember-source@5 to crash because it has been removed + if (meta['implicit-modules']) { + meta['implicit-modules'] = meta['implicit-modules'].filter(mod => mod !== './utils/mung-options-for-fetch'); + } + + return meta; + } +} From c883d07fdc56c40f234c252f776a4a92b4eacdab Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Thu, 30 Nov 2023 16:12:41 +0000 Subject: [PATCH 04/12] use await import() for fastbootModules --- packages/compat/src/compat-app-builder.ts | 10 +++++++++- packages/webpack/src/ember-webpack.ts | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/compat/src/compat-app-builder.ts b/packages/compat/src/compat-app-builder.ts index 5f74ffa08..e71db26b6 100644 --- a/packages/compat/src/compat-app-builder.ts +++ b/packages/compat/src/compat-app-builder.ts @@ -1415,9 +1415,17 @@ let d = w.define; {{#if fastbootOnlyAmdModules}} if (macroCondition(getGlobalConfig().fastboot?.isRunning)) { + let fastbootModules = {}; + {{#each fastbootOnlyAmdModules as |amdModule| ~}} - d("{{js-string-escape amdModule.runtime}}", function(){ return i("{{js-string-escape amdModule.buildtime}}");}); + fastbootModules["{{js-string-escape amdModule.runtime}}"] = import("{{js-string-escape amdModule.buildtime}}"); {{/each}} + + const resolvedValues = await Promise.all(Object.values(fastbootModules)); + + Object.keys(fastbootModules).forEach((k, i) => { + d(k, function(){ return resolvedValues[i];}); + }) } {{/if}} diff --git a/packages/webpack/src/ember-webpack.ts b/packages/webpack/src/ember-webpack.ts index 83702c074..569a9a93c 100644 --- a/packages/webpack/src/ember-webpack.ts +++ b/packages/webpack/src/ember-webpack.ts @@ -285,6 +285,10 @@ const Webpack: PackagerConstructor = class Webpack implements Packager 'style-loader': require.resolve('style-loader'), }, }, + experiments: { + // this is needed because fasboot-only modules need to use await import() + topLevelAwait: true, + }, }; } From 598a06ca695f2031e4ac9b865e48b4f75a2a3543 Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Thu, 30 Nov 2023 18:20:07 +0000 Subject: [PATCH 05/12] update macros jest tests --- .../macros/tests/babel/import-sync.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/macros/tests/babel/import-sync.test.ts b/packages/macros/tests/babel/import-sync.test.ts index 9d7536a4f..e83e84151 100644 --- a/packages/macros/tests/babel/import-sync.test.ts +++ b/packages/macros/tests/babel/import-sync.test.ts @@ -6,13 +6,13 @@ describe('importSync', function () { config.setOwnConfig(__filename, { target: 'my-plugin' }); config.finalize(); - test('importSync becomes esc(require())', () => { + test('importSync becomes import * as _something', () => { let code = transform(` import { importSync } from '@embroider/macros'; importSync('foo'); `); - expect(code).toMatch(/import esc from "\.\.\/\.\.\/src\/addon\/es-compat2"/); - expect(code).toMatch(/esc\(require\(['"]foo['"]\)\)/); + expect(code).toMatch(/import \* as _importSync\d from "foo"/); + expect(code).toMatch(/_importSync\d;/); expect(code).not.toMatch(/window/); }); test('importSync leaves existing binding for require alone', () => { @@ -22,16 +22,16 @@ describe('importSync', function () { importSync('foo'); require('x'); `); - expect(code).toMatch(/esc\(require\(['"]foo['"]\)\)/); - expect(code).toMatch(/import _require from 'require'/); - expect(code).toMatch(/_require\(['"]x['"]\)/); + expect(code).toMatch(/import \* as _importSync\d from "foo"/); + expect(code).toMatch(/import require from 'require'/); + expect(code).toMatch(/require\(['"]x['"]\)/); }); - test('aliased importSync becomes require', () => { + test('aliased importSync becomes aliased variable', () => { let code = transform(` import { importSync as i } from '@embroider/macros'; i('foo'); `); - expect(code).toMatch(/require\(['"]foo['"]\)/); + expect(code).toMatch(/import \* as _i\d from "foo"/); expect(code).not.toMatch(/window/); }); test('import of importSync itself gets removed', () => { @@ -51,7 +51,7 @@ describe('importSync', function () { import { importSync, getOwnConfig } from '@embroider/macros'; importSync(getOwnConfig().target); `); - expect(code).toMatch(/require\(['"]my-plugin['"]\)/); + expect(code).toMatch(/import \* as _importSync\d from "my-plugin"/); }); }); }); From dbe3bda3418428d4deb9dfb4a7a426110c59b28e Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Tue, 5 Dec 2023 17:21:25 +0000 Subject: [PATCH 06/12] only test with ember-data 4.12 --- pnpm-lock.yaml | 453 +++++++++++++++++------------------ tests/scenarios/package.json | 3 +- tests/scenarios/scenarios.ts | 4 +- 3 files changed, 229 insertions(+), 231 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 50df8fab3..440f2ced3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1694,12 +1694,9 @@ importers: ember-composable-helpers: specifier: ^4.4.1 version: 4.5.0 - ember-data: - specifier: ~3.28.0 - version: 3.28.13(@babel/core@7.23.3) - ember-data-4.4: - specifier: npm:ember-data@~4.4.0 - version: /ember-data@4.4.3(@babel/core@7.23.3) + ember-data-4.12: + specifier: npm:ember-data@~4.12.0 + version: /ember-data@4.12.5(@babel/core@7.23.3)(@ember/string@3.1.1)(ember-source@3.28.12) ember-data-latest: specifier: npm:ember-data@latest version: /ember-data@5.3.0(@babel/core@7.23.3)(@ember/string@3.1.1)(ember-source@3.28.12) @@ -3447,39 +3444,24 @@ packages: - supports-color dev: true - /@ember-data/adapter@3.28.13(@babel/core@7.23.3): - resolution: {integrity: sha512-AwLJTs+GvxX72vfP3edV0hoMLD9oPWJNbnqxakXVN9xGTuk6/TeGQLMrVU3222GCoMMNrJ357Nip7kZeFo4IdA==} - engines: {node: 12.* || >= 14.*} - dependencies: - '@ember-data/private-build-infra': 3.28.13(@babel/core@7.23.3) - '@ember-data/store': 3.28.13(@babel/core@7.23.3) - '@ember/edition-utils': 1.2.0 - '@ember/string': 3.1.1 - ember-cli-babel: 7.26.11 - ember-cli-test-info: 1.0.0 - ember-cli-typescript: 4.2.1 - transitivePeerDependencies: - - '@babel/core' - - supports-color - dev: true - - /@ember-data/adapter@4.4.3(@babel/core@7.23.3): - resolution: {integrity: sha512-rwcwzffVHosmKgWEOSwvUy8EFazDV08lZvw8uFDK9CrrhUBWGLG8Ugrc1nu3HEAHA9UWNFbaAPKj/R4PvV2igw==} - engines: {node: 12.* || >= 14.*} + /@ember-data/adapter@4.12.5(@ember-data/store@4.12.5)(@ember/string@3.1.1)(ember-inflector@4.0.2): + resolution: {integrity: sha512-YWCjBga9h59q3iBqLONxi68AjNZtKmxQ/uB7e8uSv7czOXGQKpzONlTb68jyMJ687qpg0RWebxLBlBU5yPxq1Q==} + engines: {node: 16.* || >= 18.*} + peerDependencies: + '@ember-data/store': 4.12.5 + '@ember/string': ^3.0.1 + ember-inflector: ^4.0.2 dependencies: - '@ember-data/private-build-infra': 4.4.3(@babel/core@7.23.3) - '@ember-data/store': 4.4.3(@babel/core@7.23.3) - '@ember/edition-utils': 1.2.0 + '@ember-data/private-build-infra': 4.12.5 + '@ember-data/store': 4.12.5(@babel/core@7.23.3)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/model@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-source@3.28.12) '@ember/string': 3.1.1 - ember-auto-import: 2.7.0 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) ember-cli-babel: 7.26.11 ember-cli-test-info: 1.0.0 - ember-cli-typescript: 5.2.1 + ember-inflector: 4.0.2 transitivePeerDependencies: - - '@babel/core' - '@glint/template' - supports-color - - webpack dev: true /@ember-data/adapter@4.4.3(@babel/core@7.23.3)(webpack@5.89.0): @@ -3542,16 +3524,6 @@ packages: - supports-color dev: true - /@ember-data/canary-features@3.28.13: - resolution: {integrity: sha512-fgpcB0wmtUjZeqcIKkfP/MclQjY5r8ft8YZhPlvQh2MIx+3d3nCNRXB6lEUdRdQphFEag2towONFEIsiOAgs3Q==} - engines: {node: 12.* || >= 14.*} - dependencies: - ember-cli-babel: 7.26.11 - ember-cli-typescript: 4.2.1 - transitivePeerDependencies: - - supports-color - dev: true - /@ember-data/canary-features@4.4.3: resolution: {integrity: sha512-QzmWO6XkXUb6sND/HST7Xh9o7xlYynv1Wht/GSz+6sRDe5p2M/njwd10Hqhiraso34zNfWNqiPNjAtu3OUNL1g==} engines: {node: 12.* || >= 14.*} @@ -3562,34 +3534,21 @@ packages: - supports-color dev: true - /@ember-data/debug@3.28.13(@babel/core@7.23.3): - resolution: {integrity: sha512-ofny/Grpqx1lM6KWy5q75/b2/B+zQ4B4Ynk7SrQ//sFvpX3gjuP8iN07SKTHSN07vedlC+7QNhNJdCQwyqK1Fg==} - engines: {node: 12.* || >= 14.*} - dependencies: - '@ember-data/private-build-infra': 3.28.13(@babel/core@7.23.3) - '@ember/edition-utils': 1.2.0 - '@ember/string': 3.1.1 - ember-cli-babel: 7.26.11 - ember-cli-test-info: 1.0.0 - ember-cli-typescript: 4.2.1 - transitivePeerDependencies: - - '@babel/core' - - supports-color - dev: true - - /@ember-data/debug@4.4.3(@babel/core@7.23.3): - resolution: {integrity: sha512-ZCE+yD53pPUp4705y3YxrV4Q4+upLt0LY9o9tMWrdV5C7L74aiVyUJ5FqD6fmBsWYEa2TG8nde27gNIW3KlSJw==} - engines: {node: 12.* || >= 14.*} + /@ember-data/debug@4.12.5(@ember-data/store@4.12.5)(@ember/string@3.1.1): + resolution: {integrity: sha512-IpmZ2ZXhl7NDPd8DH2XNQBzjiwxJHmGbwGFs9IVtZXmOSkk5iCX6v2MkeRBeDjLvUOcZIHNBuHUz66nZJrHNCg==} + engines: {node: 16.* || >= 18.*} + peerDependencies: + '@ember-data/store': 4.12.5 + '@ember/string': ^3.0.1 dependencies: - '@ember-data/private-build-infra': 4.4.3(@babel/core@7.23.3) + '@ember-data/private-build-infra': 4.12.5 + '@ember-data/store': 4.12.5(@babel/core@7.23.3)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/model@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-source@3.28.12) '@ember/edition-utils': 1.2.0 '@ember/string': 3.1.1 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) ember-auto-import: 2.7.0 ember-cli-babel: 7.26.11 - ember-cli-test-info: 1.0.0 - ember-cli-typescript: 5.2.1 transitivePeerDependencies: - - '@babel/core' - '@glint/template' - supports-color - webpack @@ -3662,6 +3621,22 @@ packages: - webpack-cli dev: true + /@ember-data/graph@4.12.5(@ember-data/store@4.12.5): + resolution: {integrity: sha512-YHvtUeH7h1AIFOlRQeaJrUM9DGkGBkzm6+BoVR2iaEbZKM3A/l0tZD7jUveD2bfdhGPtEf5849mlwKi8T2dIKw==} + engines: {node: 16.* || >= 18.*} + peerDependencies: + '@ember-data/store': 4.12.5 + dependencies: + '@ember-data/private-build-infra': 4.12.5 + '@ember-data/store': 4.12.5(@babel/core@7.23.3)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/model@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-source@3.28.12) + '@ember/edition-utils': 1.2.0 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) + ember-cli-babel: 7.26.11 + transitivePeerDependencies: + - '@glint/template' + - supports-color + dev: true + /@ember-data/graph@5.1.2(@ember-data/store@5.1.2): resolution: {integrity: sha512-HnDSjN/pPGBrSkM+2ZqpU+jkjorz/QppXCHn59eJ6xsdwTAx9e5MmKE6gU8o3d8QDc0hJOXeQGVqVMR4V+eTmg==} engines: {node: 16.* || >= 18.*} @@ -3695,6 +3670,24 @@ packages: - supports-color dev: true + /@ember-data/json-api@4.12.5(@ember-data/graph@4.12.5)(@ember-data/store@4.12.5): + resolution: {integrity: sha512-L3gLUqXDXwKZnXkWm0U3TW/jiQKdQ9Q74MOxhJEeWmmN19fvKGdHe/oS3FASgdmBpMqkwItACmilDRVXWxbGWA==} + engines: {node: 16.* || >= 18.*} + peerDependencies: + '@ember-data/graph': 4.12.5 + '@ember-data/store': 4.12.5 + dependencies: + '@ember-data/graph': 4.12.5(@ember-data/store@4.12.5) + '@ember-data/private-build-infra': 4.12.5 + '@ember-data/store': 4.12.5(@babel/core@7.23.3)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/model@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-source@3.28.12) + '@ember/edition-utils': 1.2.0 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) + ember-cli-babel: 7.26.11 + transitivePeerDependencies: + - '@glint/template' + - supports-color + dev: true + /@ember-data/json-api@5.1.2(@ember-data/graph@5.1.2)(@ember-data/store@5.1.2): resolution: {integrity: sha512-n1y4SYLToKxAtUbz7sU/M8s9XdRIFKkIhVZBerDpZYXRmcnjs0DHeP334n7/rQV+xn8XwGKhbwK3ST1TBBB89A==} engines: {node: 16.* || >= 18.*} @@ -3736,6 +3729,28 @@ packages: - supports-color dev: true + /@ember-data/legacy-compat@4.12.5(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5): + resolution: {integrity: sha512-/f2aIsgua0UbueYG1G/nXDIfM/DI34b9f0jOgcsrOGULbhNMYAXfWNvr97TPU5swFLd4H/dWM4VG2dq8tBtmxg==} + engines: {node: 16.* || >= 18} + peerDependencies: + '@ember-data/graph': 4.12.5 + '@ember-data/json-api': 4.12.5 + peerDependenciesMeta: + '@ember-data/graph': + optional: true + '@ember-data/json-api': + optional: true + dependencies: + '@ember-data/graph': 4.12.5(@ember-data/store@4.12.5) + '@ember-data/json-api': 4.12.5(@ember-data/graph@4.12.5)(@ember-data/store@4.12.5) + '@ember-data/private-build-infra': 4.12.5 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) + ember-cli-babel: 7.26.11 + transitivePeerDependencies: + - '@glint/template' + - supports-color + dev: true + /@ember-data/legacy-compat@5.1.2(@ember-data/graph@5.1.2)(@ember-data/json-api@5.1.2): resolution: {integrity: sha512-uo9nCwtqc70oIWE8rsa8e+zcGAmFven8SjC08zw8CDXUCpJXcib0qm1Wg+jcQasOhdN682ZoUJ3MLQ3Qkzubjw==} engines: {node: 16.* || >= 18} @@ -3783,49 +3798,47 @@ packages: - supports-color dev: true - /@ember-data/model@3.28.13(@babel/core@7.23.3): - resolution: {integrity: sha512-V5Hgzz5grNWTSrKGksY9xeOsTDLN/d3qsVMu26FWWHP5uqyWT0Cd4LSRpNxs14PsTFDcbrtGKaZv3YVksZfFEQ==} - engines: {node: 12.* || >= 14.*} - dependencies: - '@ember-data/canary-features': 3.28.13 - '@ember-data/private-build-infra': 3.28.13(@babel/core@7.23.3) - '@ember-data/store': 3.28.13(@babel/core@7.23.3) - '@ember/edition-utils': 1.2.0 - '@ember/string': 3.1.1 - ember-cached-decorator-polyfill: 0.1.4(@babel/core@7.23.3) - ember-cli-babel: 7.26.11 - ember-cli-string-utils: 1.1.0 - ember-cli-test-info: 1.0.0 - ember-cli-typescript: 4.2.1 - ember-compatibility-helpers: 1.2.7(@babel/core@7.23.3) - inflection: 1.13.4 - transitivePeerDependencies: - - '@babel/core' - - supports-color - dev: true - - /@ember-data/model@4.4.3(@babel/core@7.23.3): - resolution: {integrity: sha512-gHrSGJQUewZ0hqAnDzAehz7DXqBHHT9MKGl/f7/mYMP+QNVQXbPemurc9NAO7nunUJZhDvHYRkMuy0hrdtiT+g==} - engines: {node: 12.* || >= 14.*} + /@ember-data/model@4.12.5(@babel/core@7.23.3)(@ember-data/debug@4.12.5)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/store@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-inflector@4.0.2)(ember-source@3.28.12): + resolution: {integrity: sha512-2+n8tlDSQqrM65u+jGoANQkEzx8dQsMez9EqPZ7Czgv0gtOq9m03H6O3xahqtX/igABwz+2Fcc5o9W4Wv1uWnA==} + engines: {node: 16.* || >= 18.*} + peerDependencies: + '@ember-data/debug': 4.12.5 + '@ember-data/graph': 4.12.5 + '@ember-data/json-api': 4.12.5 + '@ember-data/legacy-compat': 4.12.5 + '@ember-data/store': 4.12.5 + '@ember-data/tracking': 4.12.5 + '@ember/string': ^3.0.1 + ember-inflector: ^4.0.2 + peerDependenciesMeta: + '@ember-data/debug': + optional: true + '@ember-data/graph': + optional: true + '@ember-data/json-api': + optional: true dependencies: - '@ember-data/canary-features': 4.4.3 - '@ember-data/private-build-infra': 4.4.3(@babel/core@7.23.3) - '@ember-data/store': 4.4.3(@babel/core@7.23.3) + '@ember-data/debug': 4.12.5(@ember-data/store@4.12.5)(@ember/string@3.1.1) + '@ember-data/graph': 4.12.5(@ember-data/store@4.12.5) + '@ember-data/json-api': 4.12.5(@ember-data/graph@4.12.5)(@ember-data/store@4.12.5) + '@ember-data/legacy-compat': 4.12.5(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5) + '@ember-data/private-build-infra': 4.12.5 + '@ember-data/store': 4.12.5(@babel/core@7.23.3)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/model@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-source@3.28.12) + '@ember-data/tracking': 4.12.5 '@ember/edition-utils': 1.2.0 '@ember/string': 3.1.1 - ember-auto-import: 2.7.0 - ember-cached-decorator-polyfill: 0.1.4(@babel/core@7.23.3) + '@embroider/macros': 1.13.3(@glint/template@1.2.1) + ember-cached-decorator-polyfill: 1.0.2(@babel/core@7.23.3)(ember-source@3.28.12) ember-cli-babel: 7.26.11 ember-cli-string-utils: 1.1.0 ember-cli-test-info: 1.0.0 - ember-cli-typescript: 5.2.1 - ember-compatibility-helpers: 1.2.7(@babel/core@7.23.3) - inflection: 1.13.4 + ember-inflector: 4.0.2 + inflection: 2.0.1 transitivePeerDependencies: - '@babel/core' - '@glint/template' + - ember-source - supports-color - - webpack dev: true /@ember-data/model@4.4.3(@babel/core@7.23.3)(webpack@5.89.0): @@ -3938,13 +3951,16 @@ packages: - supports-color dev: true - /@ember-data/private-build-infra@3.28.13(@babel/core@7.23.3): - resolution: {integrity: sha512-8gT3/gnmbNgFIMVdHBpl3xFGJefJE26VUIidFHTF1/N1aumVUlEhnXH0BSPxvxTnFXz/klGSTOMs+sDsx3jw6A==} - engines: {node: 12.* || >= 14.*} + /@ember-data/private-build-infra@4.12.5: + resolution: {integrity: sha512-FNnyA8+IVylrnnwYR+MGPUushS/X8BEMN4JrrO4Mbrj4Yn10E2gAeKt/MUkk7Gl/HxMw6maxZY8SHoA/NK9XKw==} + engines: {node: 16.* || >= 18.*} dependencies: + '@babel/core': 7.23.3(supports-color@8.1.1) '@babel/plugin-transform-block-scoping': 7.23.4(@babel/core@7.23.3) - '@ember-data/canary-features': 3.28.13 + '@babel/runtime': 7.23.4 '@ember/edition-utils': 1.2.0 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) + babel-import-util: 1.4.1 babel-plugin-debug-macros: 0.3.4(@babel/core@7.23.3) babel-plugin-filter-imports: 4.0.0 babel6-plugin-strip-class-callcheck: 6.0.0 @@ -3958,18 +3974,14 @@ packages: ember-cli-babel: 7.26.11 ember-cli-path-utils: 1.0.0 ember-cli-string-utils: 1.1.0 - ember-cli-typescript: 4.2.1 ember-cli-version-checker: 5.1.2 - esm: 3.2.25 git-repo-info: 2.1.1 - glob: 7.2.3 + glob: 9.3.5 npm-git-info: 1.0.3 - rimraf: 3.0.2 - rsvp: 4.8.5 semver: 7.5.4 silent-error: 1.1.1 transitivePeerDependencies: - - '@babel/core' + - '@glint/template' - supports-color dev: true @@ -4072,41 +4084,6 @@ packages: - supports-color dev: true - /@ember-data/record-data@3.28.13(@babel/core@7.23.3): - resolution: {integrity: sha512-0qYOxQr901eZ0JoYVt/IiszZYuNefqO6yiwKw0VH2dmWhVniQSp+Da9YnoKN9U2KgR4NdxKiUs2j9ZLNZ+bH7g==} - engines: {node: 12.* || >= 14.*} - dependencies: - '@ember-data/canary-features': 3.28.13 - '@ember-data/private-build-infra': 3.28.13(@babel/core@7.23.3) - '@ember-data/store': 3.28.13(@babel/core@7.23.3) - '@ember/edition-utils': 1.2.0 - ember-cli-babel: 7.26.11 - ember-cli-test-info: 1.0.0 - ember-cli-typescript: 4.2.1 - transitivePeerDependencies: - - '@babel/core' - - supports-color - dev: true - - /@ember-data/record-data@4.4.3(@babel/core@7.23.3): - resolution: {integrity: sha512-hHGSD23qHR+Zd59/P2AqmcFBOAgb22Imcm7aJbXUfQVSpXx2AlcdcrWL8bA6hMaO9yX/KQRTmBazmS0vqTxFug==} - engines: {node: 12.* || >= 14.*} - dependencies: - '@ember-data/canary-features': 4.4.3 - '@ember-data/private-build-infra': 4.4.3(@babel/core@7.23.3) - '@ember-data/store': 4.4.3(@babel/core@7.23.3) - '@ember/edition-utils': 1.2.0 - ember-auto-import: 2.7.0 - ember-cli-babel: 7.26.11 - ember-cli-test-info: 1.0.0 - ember-cli-typescript: 5.2.1 - transitivePeerDependencies: - - '@babel/core' - - '@glint/template' - - supports-color - - webpack - dev: true - /@ember-data/record-data@4.4.3(@babel/core@7.23.3)(webpack@5.89.0): resolution: {integrity: sha512-hHGSD23qHR+Zd59/P2AqmcFBOAgb22Imcm7aJbXUfQVSpXx2AlcdcrWL8bA6hMaO9yX/KQRTmBazmS0vqTxFug==} engines: {node: 12.* || >= 14.*} @@ -4136,6 +4113,19 @@ packages: - supports-color dev: true + /@ember-data/request@4.12.5: + resolution: {integrity: sha512-uxLuQqvjxmiU8ODs5HoiYydnnhpKjBOxxkwSuIMP3Ndb0HlXAqgqSSRMGUzCaNFXYn6KOb7CuDly3OEYYHFlMQ==} + engines: {node: 16.* || >= 18} + dependencies: + '@ember-data/private-build-infra': 4.12.5 + '@ember/test-waiters': 3.1.0 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) + ember-cli-babel: 7.26.11 + transitivePeerDependencies: + - '@glint/template' + - supports-color + dev: true + /@ember-data/request@5.1.2: resolution: {integrity: sha512-hlcwqNc1sSP6Afib3YL/yg0tvbZQHJBSwcpB8wy7NG+fkHYRiU5wMs1Qksk2Ajsln9pp+kY7ckPfckKiHK+vDQ==} engines: {node: 16.* || >= 18} @@ -4166,35 +4156,24 @@ packages: /@ember-data/rfc395-data@0.0.4: resolution: {integrity: sha512-tGRdvgC9/QMQSuSuJV45xoyhI0Pzjm7A9o/MVVA3HakXIImJbbzx/k/6dO9CUEQXIyS2y0fW6C1XaYOG7rY0FQ==} - /@ember-data/serializer@3.28.13(@babel/core@7.23.3): - resolution: {integrity: sha512-BlYXi8ObH0B5G7QeWtkf9u8PrhdlfAxOAsOuOPZPCTzWsQlmyzV6M9KvBmIAvJtM2IQ3a5BX2o71eP6/7MJDUg==} - engines: {node: 12.* || >= 14.*} - dependencies: - '@ember-data/private-build-infra': 3.28.13(@babel/core@7.23.3) - '@ember-data/store': 3.28.13(@babel/core@7.23.3) - ember-cli-babel: 7.26.11 - ember-cli-test-info: 1.0.0 - ember-cli-typescript: 4.2.1 - transitivePeerDependencies: - - '@babel/core' - - supports-color - dev: true - - /@ember-data/serializer@4.4.3(@babel/core@7.23.3): - resolution: {integrity: sha512-rHL3yraqUBHLjw1y5s0sGCD+xjwJaEWsx/wcVxG5FBIBcMtUQTyp/QLoiqqVfI0/1MOnvpYDjy1Fyioy0gGAZA==} - engines: {node: 12.* || >= 14.*} + /@ember-data/serializer@4.12.5(@ember-data/store@4.12.5)(@ember/string@3.1.1)(ember-inflector@4.0.2): + resolution: {integrity: sha512-qQzaJTXxfgDcR2YIgOE5iU+51Hn8ghwQxas63GvIBqtnYkbB3i2Fa4OaEJAruU7phlrEYONaKTVOyrTC+pjTKw==} + engines: {node: 16.* || >= 18.*} + peerDependencies: + '@ember-data/store': 4.12.5 + '@ember/string': ^3.0.1 + ember-inflector: ^4.0.2 dependencies: - '@ember-data/private-build-infra': 4.4.3(@babel/core@7.23.3) - '@ember-data/store': 4.4.3(@babel/core@7.23.3) - ember-auto-import: 2.7.0 + '@ember-data/private-build-infra': 4.12.5 + '@ember-data/store': 4.12.5(@babel/core@7.23.3)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/model@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-source@3.28.12) + '@ember/string': 3.1.1 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) ember-cli-babel: 7.26.11 ember-cli-test-info: 1.0.0 - ember-cli-typescript: 5.2.1 + ember-inflector: 4.0.2 transitivePeerDependencies: - - '@babel/core' - '@glint/template' - supports-color - - webpack dev: true /@ember-data/serializer@4.4.3(@babel/core@7.23.3)(webpack@5.89.0): @@ -4253,41 +4232,42 @@ packages: - supports-color dev: true - /@ember-data/store@3.28.13(@babel/core@7.23.3): - resolution: {integrity: sha512-y1ddWLfR20l3NN9fNfIAFWCmREnC6hjKCZERDgkvBgZOCAKcs+6bVJGyMmKBcsp4W7kanqKn71tX7Y63jp+jXQ==} - engines: {node: 12.* || >= 14.*} - dependencies: - '@ember-data/canary-features': 3.28.13 - '@ember-data/private-build-infra': 3.28.13(@babel/core@7.23.3) - '@ember/string': 3.1.1 - '@glimmer/tracking': 1.1.2 - ember-cached-decorator-polyfill: 0.1.4(@babel/core@7.23.3) - ember-cli-babel: 7.26.11 - ember-cli-path-utils: 1.0.0 - ember-cli-typescript: 4.2.1 - transitivePeerDependencies: - - '@babel/core' - - supports-color - dev: true - - /@ember-data/store@4.4.3(@babel/core@7.23.3): - resolution: {integrity: sha512-1kvCV/qO7ULD4fJNfr1NTwQwcPAU/fwxIWj46p2JnpRKg1jwzBNz9E6hQNdQ0kLD2pOUiaHB8J/2J6mCqVljKA==} - engines: {node: 12.* || >= 14.*} + /@ember-data/store@4.12.5(@babel/core@7.23.3)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/model@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-source@3.28.12): + resolution: {integrity: sha512-hpMrOa3+R3jXft7+j1RQl0Jw79rIWZE7TFuA5Z4u11QjlHiXxpOP/0icer8CeRJk1QSWPMedF/TgwZOnYWh4GQ==} + engines: {node: 16.* || >= 18.*} + peerDependencies: + '@ember-data/graph': 4.12.5 + '@ember-data/json-api': 4.12.5 + '@ember-data/legacy-compat': 4.12.5 + '@ember-data/model': 4.12.5 + '@ember-data/tracking': 4.12.5 + '@ember/string': ^3.0.1 + '@glimmer/tracking': ^1.1.2 + peerDependenciesMeta: + '@ember-data/graph': + optional: true + '@ember-data/json-api': + optional: true + '@ember-data/legacy-compat': + optional: true + '@ember-data/model': + optional: true dependencies: - '@ember-data/canary-features': 4.4.3 - '@ember-data/private-build-infra': 4.4.3(@babel/core@7.23.3) + '@ember-data/graph': 4.12.5(@ember-data/store@4.12.5) + '@ember-data/json-api': 4.12.5(@ember-data/graph@4.12.5)(@ember-data/store@4.12.5) + '@ember-data/legacy-compat': 4.12.5(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5) + '@ember-data/model': 4.12.5(@babel/core@7.23.3)(@ember-data/debug@4.12.5)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/store@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-inflector@4.0.2)(ember-source@3.28.12) + '@ember-data/private-build-infra': 4.12.5 + '@ember-data/tracking': 4.12.5 '@ember/string': 3.1.1 - '@glimmer/tracking': 1.1.2 - ember-auto-import: 2.7.0 - ember-cached-decorator-polyfill: 0.1.4(@babel/core@7.23.3) + '@embroider/macros': 1.13.3(@glint/template@1.2.1) + ember-cached-decorator-polyfill: 1.0.2(@babel/core@7.23.3)(ember-source@3.28.12) ember-cli-babel: 7.26.11 - ember-cli-path-utils: 1.0.0 - ember-cli-typescript: 5.2.1 transitivePeerDependencies: - '@babel/core' - '@glint/template' + - ember-source - supports-color - - webpack dev: true /@ember-data/store@4.4.3(@babel/core@7.23.3)(webpack@5.89.0): @@ -4370,6 +4350,18 @@ packages: - supports-color dev: true + /@ember-data/tracking@4.12.5: + resolution: {integrity: sha512-1i69F6cywzsHZGolJ+W0NelJH7AToICXyuqdH4R9mgzoOD6e3wxY+MBXhB/KoTxoa508G0vYozQ4weea3E/oyw==} + engines: {node: 16.* || >= 18} + dependencies: + '@ember-data/private-build-infra': 4.12.5 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) + ember-cli-babel: 7.26.11 + transitivePeerDependencies: + - '@glint/template' + - supports-color + dev: true + /@ember-data/tracking@5.1.2: resolution: {integrity: sha512-t7bpVBF745HWFMDK2UNhpWdN+NxoRlxgMWDvGjZsnrvSnCzNMoERFEF6p2luvnVlyCyJDf+SRRRyvf/vkMnNrg==} engines: {node: 16.* || >= 18} @@ -12688,51 +12680,36 @@ packages: - supports-color dev: true - /ember-data@3.28.13(@babel/core@7.23.3): - resolution: {integrity: sha512-j1YjPl2JNHxQwQW6Bgfis44XSr4WCtdwMXr/SPpLsF1oVeTWIn3kwefcDnbuCI8Spmt1B9ab3ZLKzf2KkGN/7g==} - engines: {node: 12.* || >= 14.*} - dependencies: - '@ember-data/adapter': 3.28.13(@babel/core@7.23.3) - '@ember-data/debug': 3.28.13(@babel/core@7.23.3) - '@ember-data/model': 3.28.13(@babel/core@7.23.3) - '@ember-data/private-build-infra': 3.28.13(@babel/core@7.23.3) - '@ember-data/record-data': 3.28.13(@babel/core@7.23.3) - '@ember-data/serializer': 3.28.13(@babel/core@7.23.3) - '@ember-data/store': 3.28.13(@babel/core@7.23.3) - '@ember/edition-utils': 1.2.0 - '@ember/string': 3.1.1 - '@glimmer/env': 0.1.7 - broccoli-merge-trees: 4.2.0 - ember-cli-babel: 7.26.11 - ember-cli-typescript: 4.2.1 - ember-inflector: 4.0.2 - transitivePeerDependencies: - - '@babel/core' - - supports-color - dev: true - - /ember-data@4.4.3(@babel/core@7.23.3): - resolution: {integrity: sha512-Z67pYs41LoJ2EKQsTOb2QOmv7A4gn72nv9MORYpQnGk8z8stYGtrgZFwATg+NES4mnJsLShdLIWaZNKze7c1HA==} - engines: {node: 12.* || >= 14.*} + /ember-data@4.12.5(@babel/core@7.23.3)(@ember/string@3.1.1)(ember-source@3.28.12): + resolution: {integrity: sha512-5q0m0qFdbur3eFk2/iT1GEGxBUOnwbDD0Gk6sWLiVGL2NLZw1wH6Spo36RqClx62ov2vlo9DytVmKbOu224WaQ==} + engines: {node: 16.* || >= 18.*} + peerDependencies: + '@ember/string': ^3.0.1 dependencies: - '@ember-data/adapter': 4.4.3(@babel/core@7.23.3) - '@ember-data/debug': 4.4.3(@babel/core@7.23.3) - '@ember-data/model': 4.4.3(@babel/core@7.23.3) - '@ember-data/private-build-infra': 4.4.3(@babel/core@7.23.3) - '@ember-data/record-data': 4.4.3(@babel/core@7.23.3) - '@ember-data/serializer': 4.4.3(@babel/core@7.23.3) - '@ember-data/store': 4.4.3(@babel/core@7.23.3) + '@ember-data/adapter': 4.12.5(@ember-data/store@4.12.5)(@ember/string@3.1.1)(ember-inflector@4.0.2) + '@ember-data/debug': 4.12.5(@ember-data/store@4.12.5)(@ember/string@3.1.1) + '@ember-data/graph': 4.12.5(@ember-data/store@4.12.5) + '@ember-data/json-api': 4.12.5(@ember-data/graph@4.12.5)(@ember-data/store@4.12.5) + '@ember-data/legacy-compat': 4.12.5(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5) + '@ember-data/model': 4.12.5(@babel/core@7.23.3)(@ember-data/debug@4.12.5)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/store@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-inflector@4.0.2)(ember-source@3.28.12) + '@ember-data/private-build-infra': 4.12.5 + '@ember-data/request': 4.12.5 + '@ember-data/serializer': 4.12.5(@ember-data/store@4.12.5)(@ember/string@3.1.1)(ember-inflector@4.0.2) + '@ember-data/store': 4.12.5(@babel/core@7.23.3)(@ember-data/graph@4.12.5)(@ember-data/json-api@4.12.5)(@ember-data/legacy-compat@4.12.5)(@ember-data/model@4.12.5)(@ember-data/tracking@4.12.5)(@ember/string@3.1.1)(ember-source@3.28.12) + '@ember-data/tracking': 4.12.5 '@ember/edition-utils': 1.2.0 '@ember/string': 3.1.1 + '@embroider/macros': 1.13.3(@glint/template@1.2.1) '@glimmer/env': 0.1.7 broccoli-merge-trees: 4.2.0 ember-auto-import: 2.7.0 ember-cli-babel: 7.26.11 - ember-cli-typescript: 5.2.1 ember-inflector: 4.0.2 transitivePeerDependencies: - '@babel/core' + - '@glimmer/tracking' - '@glint/template' + - ember-source - supports-color - webpack dev: true @@ -15995,6 +15972,16 @@ packages: once: 1.4.0 dev: true + /glob@9.3.5: + resolution: {integrity: sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + fs.realpath: 1.0.0 + minimatch: 8.0.4 + minipass: 4.2.8 + path-scurry: 1.10.1 + dev: true + /global-modules@1.0.0: resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} engines: {node: '>=0.10.0'} @@ -18544,6 +18531,13 @@ packages: brace-expansion: 2.0.1 dev: true + /minimatch@8.0.4: + resolution: {integrity: sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimatch@9.0.3: resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} engines: {node: '>=16 || 14 >=14.17'} @@ -18572,6 +18566,11 @@ packages: safe-buffer: 5.2.1 yallist: 3.1.1 + /minipass@4.2.8: + resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==} + engines: {node: '>=8'} + dev: true + /minipass@7.0.4: resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} engines: {node: '>=16 || 14 >=14.17'} diff --git a/tests/scenarios/package.json b/tests/scenarios/package.json index ba4cb96c6..2d9a6cd7d 100644 --- a/tests/scenarios/package.json +++ b/tests/scenarios/package.json @@ -68,8 +68,7 @@ "ember-cli-fastboot": "^4.1.1", "ember-cli-latest": "npm:ember-cli@latest", "ember-composable-helpers": "^4.4.1", - "ember-data": "~3.28.0", - "ember-data-4.4": "npm:ember-data@~4.4.0", + "ember-data-4.12": "npm:ember-data@~4.12.0", "ember-data-latest": "npm:ember-data@latest", "ember-engines": "^0.8.23", "ember-inline-svg": "^0.2.1", diff --git a/tests/scenarios/scenarios.ts b/tests/scenarios/scenarios.ts index 0197f53e9..33c2b229f 100644 --- a/tests/scenarios/scenarios.ts +++ b/tests/scenarios/scenarios.ts @@ -4,13 +4,13 @@ import { dirname } from 'path'; async function lts_3_28(project: Project) { project.linkDevDependency('ember-source', { baseDir: __dirname, resolveName: 'ember-source' }); project.linkDevDependency('ember-cli', { baseDir: __dirname, resolveName: 'ember-cli' }); - project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data' }); + project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-4.12' }); } async function lts_4_4(project: Project) { project.linkDevDependency('ember-source', { baseDir: __dirname, resolveName: 'ember-source-4.4' }); project.linkDevDependency('ember-cli', { baseDir: __dirname, resolveName: 'ember-cli-4.4' }); - project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-4.4' }); + project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-4.12' }); } async function release(project: Project) { From 2e5adb1516907fd3a9b6a40e9a3fce55905223b9 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Mon, 11 Dec 2023 12:23:43 -0500 Subject: [PATCH 07/12] try reducing ember-data support range further --- tests/scenarios/scenarios.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/scenarios/scenarios.ts b/tests/scenarios/scenarios.ts index 33c2b229f..f546ddc1a 100644 --- a/tests/scenarios/scenarios.ts +++ b/tests/scenarios/scenarios.ts @@ -4,13 +4,13 @@ import { dirname } from 'path'; async function lts_3_28(project: Project) { project.linkDevDependency('ember-source', { baseDir: __dirname, resolveName: 'ember-source' }); project.linkDevDependency('ember-cli', { baseDir: __dirname, resolveName: 'ember-cli' }); - project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-4.12' }); + project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-latest' }); } async function lts_4_4(project: Project) { project.linkDevDependency('ember-source', { baseDir: __dirname, resolveName: 'ember-source-4.4' }); project.linkDevDependency('ember-cli', { baseDir: __dirname, resolveName: 'ember-cli-4.4' }); - project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-4.12' }); + project.linkDevDependency('ember-data', { baseDir: __dirname, resolveName: 'ember-data-latest' }); } async function release(project: Project) { From e02c5011de22b6577748523d2db4e6c396fbf5cf Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Mon, 11 Dec 2023 13:00:06 -0500 Subject: [PATCH 08/12] catch around missing importSync is necessarily not support --- tests/scenarios/static-app-test.ts | 38 ------------------------------ 1 file changed, 38 deletions(-) diff --git a/tests/scenarios/static-app-test.ts b/tests/scenarios/static-app-test.ts index 4d8026aa2..7425b977e 100644 --- a/tests/scenarios/static-app-test.ts +++ b/tests/scenarios/static-app-test.ts @@ -296,44 +296,6 @@ appScenarios });`, }, }, - unit: { - 'missing-import-sync-renamed-test.js': ` - import { module, test } from 'qunit'; - import { importSync as i } from '@embroider/macros'; - - module('Unit | missing modules referenced by i which was renamed from importSync', function() { - test('it works', function(assert) { - assert.expect(2); - - assert.throws(() => { - i('foobar'); - }, /Error: Could not find module \`foobar\`/); - - assert.throws(() => { - i('foobaz'); - }, /Error: Could not find module \`foobaz\`/); - }); - }); - `, - 'missing-import-test.js': ` - import { module, test } from 'qunit'; - import { importSync } from '@embroider/macros'; - - module('Unit | missing modules referenced by importSync', function() { - test('it works', function(assert) { - assert.expect(2); - - assert.throws(() => { - importSync('bar'); - }, /Error: Could not find module \`bar\`/); - - assert.throws(() => { - importSync('baz'); - }, /Error: Could not find module \`baz\`/); - }); - }); - `, - }, }, 'ember-cli-build.js': ` 'use strict'; From ab335e67c64e614cd58dc988d0c2abe3f2ebbd35 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Mon, 11 Dec 2023 13:52:34 -0500 Subject: [PATCH 09/12] fixing bug in macro-sample-addon The addon was referring to its own dummy app. Now that modules are getting eagerly evaluated this becomes a failure except inside the dummy app. --- .../macro-sample-addon/app/helpers/reflect-updated-config.js | 1 - .../{addon => tests/dummy/app}/helpers/reflect-updated-config.js | 0 2 files changed, 1 deletion(-) delete mode 100644 tests/fixtures/macro-sample-addon/app/helpers/reflect-updated-config.js rename tests/fixtures/macro-sample-addon/{addon => tests/dummy/app}/helpers/reflect-updated-config.js (100%) diff --git a/tests/fixtures/macro-sample-addon/app/helpers/reflect-updated-config.js b/tests/fixtures/macro-sample-addon/app/helpers/reflect-updated-config.js deleted file mode 100644 index 47b48d965..000000000 --- a/tests/fixtures/macro-sample-addon/app/helpers/reflect-updated-config.js +++ /dev/null @@ -1 +0,0 @@ -export { default, reflectUpdatedConfig } from 'macro-sample-addon/helpers/reflect-updated-config'; diff --git a/tests/fixtures/macro-sample-addon/addon/helpers/reflect-updated-config.js b/tests/fixtures/macro-sample-addon/tests/dummy/app/helpers/reflect-updated-config.js similarity index 100% rename from tests/fixtures/macro-sample-addon/addon/helpers/reflect-updated-config.js rename to tests/fixtures/macro-sample-addon/tests/dummy/app/helpers/reflect-updated-config.js From c5375a59200a8bf11a990e0343deabdf329d3491 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Mon, 11 Dec 2023 14:01:58 -0500 Subject: [PATCH 10/12] restore es-compat --- packages/macros/src/babel/macros-babel-plugin.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/macros/src/babel/macros-babel-plugin.ts b/packages/macros/src/babel/macros-babel-plugin.ts index 2fa9f7b1c..2bdaead8c 100644 --- a/packages/macros/src/babel/macros-babel-plugin.ts +++ b/packages/macros/src/babel/macros-babel-plugin.ts @@ -125,7 +125,11 @@ export default function main(context: typeof Babel): unknown { if (specifier?.type !== 'StringLiteral') { throw new Error(`importSync eager mode doesn't implement non string literal arguments yet`); } - path.replaceWith(state.importUtil.import(path, specifier.value, '*')); + path.replaceWith( + t.callExpression(state.importUtil.import(path, state.pathToOurAddon('es-compat2'), 'default', 'esc'), [ + state.importUtil.import(path, specifier.value, '*'), + ]) + ); state.calledIdentifiers.add(callee.node); return; } From 556b485bca1d5080fc62c02d2086f81afeab308e Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Mon, 11 Dec 2023 14:25:59 -0500 Subject: [PATCH 11/12] drop ember-data from util test --- tests/scenarios/util-test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/scenarios/util-test.ts b/tests/scenarios/util-test.ts index 78ceba48f..e65cbc148 100644 --- a/tests/scenarios/util-test.ts +++ b/tests/scenarios/util-test.ts @@ -9,6 +9,9 @@ const { module: Qmodule, test } = QUnit; supportMatrix(Scenarios.fromDir(dirname(require.resolve('@embroider/util/package.json')))) .only('lts_3_28') .map('util', project => { + // the oldest ember-data we're able to test does not work on the old node + // we're trying to verify here + project.removeDependency('ember-data'); project.mergeFiles({ '.npmrc': 'use-node-version=12.22.1', 'test.js': ` From 3e78bb99d360ae3d50cb13a3da6a9ed21d8e3678 Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Mon, 11 Dec 2023 14:31:05 -0500 Subject: [PATCH 12/12] updating test --- packages/macros/tests/babel/import-sync.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/macros/tests/babel/import-sync.test.ts b/packages/macros/tests/babel/import-sync.test.ts index e83e84151..1d6b2529e 100644 --- a/packages/macros/tests/babel/import-sync.test.ts +++ b/packages/macros/tests/babel/import-sync.test.ts @@ -12,7 +12,7 @@ describe('importSync', function () { importSync('foo'); `); expect(code).toMatch(/import \* as _importSync\d from "foo"/); - expect(code).toMatch(/_importSync\d;/); + expect(code).toMatch(/esc\(_importSync\d\);/); expect(code).not.toMatch(/window/); }); test('importSync leaves existing binding for require alone', () => {