diff --git a/packages/-ember-data/package.json b/packages/-ember-data/package.json index 424d42291a6..b31164fded4 100644 --- a/packages/-ember-data/package.json +++ b/packages/-ember-data/package.json @@ -149,7 +149,7 @@ "@ember/test-waiters": "^3.1.0", "@glimmer/component": "^1.1.2", "@glimmer/tracking": "^1.1.2", - "@types/qunit": "^2.19.10", + "@types/qunit": "2.19.10", "@ember/test-helpers": "4.0.4", "@warp-drive/internal-config": "workspace:*", "ember-source": "~5.12.0", diff --git a/packages/experiments/src/persisted-cache/cache.ts b/packages/experiments/src/persisted-cache/cache.ts index 92ae6c8e5ea..961a3a59977 100644 --- a/packages/experiments/src/persisted-cache/cache.ts +++ b/packages/experiments/src/persisted-cache/cache.ts @@ -393,7 +393,7 @@ export class PersistedCache implements Cache { * @method changedAttrs * @internal * @param identifier - * @returns + * @return */ changedAttrs(identifier: StableRecordIdentifier): ChangedAttributesHash { return this._cache.changedAttrs(identifier); @@ -524,7 +524,7 @@ export class PersistedCache implements Cache { * @method getErrors * @internal * @param identifier - * @returns + * @return */ getErrors(identifier: StableRecordIdentifier): ApiError[] { return this._cache.getErrors(identifier); diff --git a/packages/model/src/-private/many-array.ts b/packages/model/src/-private/many-array.ts index 3efdfb2a8d6..c514e4860ce 100644 --- a/packages/model/src/-private/many-array.ts +++ b/packages/model/src/-private/many-array.ts @@ -468,7 +468,7 @@ type PromiseProxyRecord = { then(): void; content: OpaqueRecordInstance | null | function assertRecordPassedToHasMany(record: OpaqueRecordInstance | PromiseProxyRecord) { assert( - `All elements of a hasMany relationship must be instances of Model, you passed $${typeof record}`, + `All elements of a hasMany relationship must be instances of Model, you passed ${typeof record}`, (function () { try { recordIdentifierFor(record); diff --git a/packages/model/src/-private/util.ts b/packages/model/src/-private/util.ts index 6a722c2bdfa..b6f924f360d 100644 --- a/packages/model/src/-private/util.ts +++ b/packages/model/src/-private/util.ts @@ -25,20 +25,6 @@ export function isElementDescriptor(args: unknown[]): args is [object, string, D ); } -export type DataDecorator = ( - target: object, - key: string, - desc?: DecoratorPropertyDescriptor -) => DecoratorPropertyDescriptor; -export type DataDecoratorFactory = (...args: unknown[]) => DataDecorator; - -export function computedMacroWithOptionalParams(fn: DataDecorator | DataDecoratorFactory) { - return (...maybeDesc: unknown[]) => - isElementDescriptor(maybeDesc) - ? (fn as DataDecoratorFactory)()(...maybeDesc) - : fn(...(maybeDesc as [object, string, DecoratorPropertyDescriptor?])); -} - export function normalizeModelName(type: string): string { if (DEPRECATE_NON_STRICT_TYPES) { const result = dasherize(type); diff --git a/packages/store/eslint.config.mjs b/packages/store/eslint.config.mjs index 369d3d40040..925c8234e7c 100644 --- a/packages/store/eslint.config.mjs +++ b/packages/store/eslint.config.mjs @@ -2,16 +2,23 @@ import { globalIgnores } from '@warp-drive/internal-config/eslint/ignore.js'; import * as node from '@warp-drive/internal-config/eslint/node.js'; import * as typescript from '@warp-drive/internal-config/eslint/typescript.js'; +import * as js from '@warp-drive/internal-config/eslint/browser.js'; +import { externals } from './vite.config.mjs'; /** @type {import('eslint').Linter.FlatConfig[]} */ export default [ // all ================ globalIgnores(), + js.browser({ + srcDirs: ['src'], + allowedImports: externals, + }), + // browser (js/ts) ================ typescript.browser({ srcDirs: ['src'], - allowedImports: ['@ember/debug', '@ember/object'], + allowedImports: externals, }), // node (module) ================ diff --git a/packages/store/src/-private/caches/resource-utils.ts b/packages/store/src/-private/caches/resource-utils.ts index 9ef9eee9b05..181b1d5f19d 100644 --- a/packages/store/src/-private/caches/resource-utils.ts +++ b/packages/store/src/-private/caches/resource-utils.ts @@ -4,7 +4,7 @@ function isResource(resource: unknown): resource is Record { function hasProp(resource: unknown, prop: T): resource is K { return Boolean( - isResource(resource) && prop in resource && typeof resource[prop] === 'string' && (resource[prop] as string).length + isResource(resource) && prop in resource && typeof resource[prop] === 'string' && resource[prop].length ); } diff --git a/packages/store/src/-private/managers/notification-manager.ts b/packages/store/src/-private/managers/notification-manager.ts index 200e5c3bf11..ddd36534d9a 100644 --- a/packages/store/src/-private/managers/notification-manager.ts +++ b/packages/store/src/-private/managers/notification-manager.ts @@ -1,7 +1,7 @@ /** * @module @ember-data/store */ -// eslint-disable-next-line no-restricted-imports + import { _backburner } from '@ember/runloop'; import { LOG_NOTIFICATIONS } from '@warp-drive/build-config/debugging'; diff --git a/packages/tracking/src/-private.ts b/packages/tracking/src/-private.ts index 0d3338dff2c..18cfad380e3 100644 --- a/packages/tracking/src/-private.ts +++ b/packages/tracking/src/-private.ts @@ -426,6 +426,7 @@ export function createSignal(obj: T, key: string): Signal { } const modelName = tryGet('$type') ?? tryGet('modelName') ?? tryGet<{ modelName?: string }>('constructor')?.modelName ?? ''; + const className = obj.constructor?.name ?? obj.toString?.() ?? 'unknown'; _signal._debug_base = `${className}${modelName && !className.startsWith('SchemaRecord') ? `:${modelName}` : ''}`; } diff --git a/packages/unpublished-test-infra/package.json b/packages/unpublished-test-infra/package.json index db2dc688f9e..76886dea1b6 100644 --- a/packages/unpublished-test-infra/package.json +++ b/packages/unpublished-test-infra/package.json @@ -104,7 +104,7 @@ "@ember/test-helpers": "4.0.4", "@glimmer/component": "^1.1.2", "@types/semver": "^7.5.8", - "@types/qunit": "^2.19.10", + "@types/qunit": "2.19.10", "@ember-data/request": "workspace:*", "@ember-data/request-utils": "workspace:*", "@ember-data/store": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b58a70ce57f..6fd73114603 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -278,7 +278,7 @@ importers: specifier: ^1.1.2 version: 1.1.2 '@types/qunit': - specifier: ^2.19.10 + specifier: 2.19.10 version: 2.19.10 '@warp-drive/internal-config': specifier: workspace:* @@ -1921,7 +1921,7 @@ importers: specifier: ^1.1.2 version: 1.1.2(@babel/core@7.24.5) '@types/qunit': - specifier: ^2.19.10 + specifier: 2.19.10 version: 2.19.10 '@types/semver': specifier: ^7.5.8 @@ -2822,6 +2822,9 @@ importers: '@embroider/addon-shim': specifier: ^1.8.9 version: 1.8.9 + '@embroider/macros': + specifier: ^1.16.6 + version: 1.16.9(@babel/core@7.24.5)(@glint/template@1.5.0) '@glimmer/component': specifier: ^1.1.2 version: 1.1.2(@babel/core@7.24.5) @@ -3133,7 +3136,7 @@ importers: specifier: ^1.0.0 version: 1.0.0(@babel/core@7.24.5) ember-qunit: - specifier: ^8.0.2 + specifier: 8.0.2 version: 8.0.2(@babel/core@7.24.5)(@ember/test-helpers@4.0.4)(@glint/template@1.5.0)(ember-source@5.12.0)(qunit@2.19.4) ember-resolver: specifier: ^11.0.1 @@ -3301,7 +3304,7 @@ importers: specifier: ^1.0.0 version: 1.0.0(@babel/core@7.24.5) ember-qunit: - specifier: ^8.0.2 + specifier: 8.0.2 version: 8.0.2(@babel/core@7.24.5)(@ember/test-helpers@4.0.4)(@glint/template@1.5.0)(ember-source@5.12.0)(qunit@2.19.4) ember-resolver: specifier: ^11.0.1 @@ -3659,7 +3662,7 @@ importers: specifier: ^1.0.0 version: 1.0.0(@babel/core@7.24.5) ember-qunit: - specifier: ^8.0.2 + specifier: 8.0.2 version: 8.0.2(@babel/core@7.24.5)(@ember/test-helpers@4.0.4)(@glint/template@1.5.0)(ember-source@5.12.0)(qunit@2.19.4) ember-resolver: specifier: ^11.0.1 @@ -3862,7 +3865,7 @@ importers: specifier: 1.5.0 version: 1.5.0 '@types/qunit': - specifier: ^2.19.10 + specifier: 2.19.10 version: 2.19.10 '@warp-drive/build-config': specifier: workspace:* @@ -3946,7 +3949,7 @@ importers: specifier: ^1.0.0 version: 1.0.0(@babel/core@7.24.5) ember-qunit: - specifier: ^8.0.2 + specifier: 8.0.2 version: 8.0.2(@babel/core@7.24.5)(@ember/test-helpers@4.0.4)(@glint/template@1.5.0)(ember-source@5.12.0)(qunit@2.19.4) ember-resolver: specifier: ^11.0.1 @@ -4805,7 +4808,7 @@ importers: specifier: 1.5.0 version: 1.5.0 '@types/qunit': - specifier: ^2.19.10 + specifier: 2.19.10 version: 2.19.10 '@warp-drive/build-config': specifier: workspace:* @@ -15021,7 +15024,7 @@ packages: qunit: 2.19.4 dependencies: '@ember/test-helpers': 4.0.4(patch_hash=zignhd6n3rugkiuawsmbuxfdka)(@babel/core@7.24.5)(@glint/template@1.5.0)(ember-source@5.12.0) - '@embroider/addon-shim': 1.8.9 + '@embroider/addon-shim': 1.9.0 '@embroider/macros': 1.16.9(@babel/core@7.24.5)(@glint/template@1.5.0) ember-cli-test-loader: 3.1.0(@babel/core@7.24.5) ember-source: 5.12.0(@glimmer/component@1.1.2)(@glint/template@1.5.0) diff --git a/tests/ember-data__model/package.json b/tests/ember-data__model/package.json index 350647db9ff..e68ebd9e794 100644 --- a/tests/ember-data__model/package.json +++ b/tests/ember-data__model/package.json @@ -75,6 +75,7 @@ "@ember/test-helpers": "4.0.4", "@ember/test-waiters": "^3.1.0", "@embroider/addon-shim": "^1.8.9", + "@embroider/macros": "^1.16.6", "@glimmer/component": "^1.1.2", "@glimmer/tracking": "^1.1.2", "@warp-drive/core-types": "workspace:*", diff --git a/tests/ember-data__serializer/package.json b/tests/ember-data__serializer/package.json index 57e41db987d..513f106b91e 100644 --- a/tests/ember-data__serializer/package.json +++ b/tests/ember-data__serializer/package.json @@ -93,7 +93,7 @@ "ember-cli-inject-live-reload": "^2.1.0", "ember-load-initializers": "^2.1.2", "ember-maybe-import-regenerator": "^1.0.0", - "ember-qunit": "^8.0.2", + "ember-qunit": "8.0.2", "ember-resolver": "^11.0.1", "ember-source": "~5.12.0", "loader.js": "^4.7.0", diff --git a/tests/embroider-basic-compat/ember-cli-build.js b/tests/embroider-basic-compat/ember-cli-build.js index 5fb29568573..503544fb6f5 100644 --- a/tests/embroider-basic-compat/ember-cli-build.js +++ b/tests/embroider-basic-compat/ember-cli-build.js @@ -21,9 +21,6 @@ module.exports = async function (defaults) { setConfig(app, __dirname, { compatWith: process.env.EMBER_DATA_FULL_COMPAT ? '99.0' : null, - deprecations: { - DEPRECATE_CATCH_ALL: false, - }, }); const { Webpack } = require('@embroider/webpack'); diff --git a/tests/embroider-basic-compat/package.json b/tests/embroider-basic-compat/package.json index 79dff161745..a8feea43f4a 100644 --- a/tests/embroider-basic-compat/package.json +++ b/tests/embroider-basic-compat/package.json @@ -111,7 +111,7 @@ "ember-inflector": "4.0.3", "ember-load-initializers": "^2.1.2", "ember-maybe-import-regenerator": "^1.0.0", - "ember-qunit": "^8.0.2", + "ember-qunit": "8.0.2", "ember-resolver": "^11.0.1", "ember-simple-tree": "^0.8.4", "ember-source": "~5.12.0", diff --git a/tests/fastboot/package.json b/tests/fastboot/package.json index 5cf9cdfd6d6..24e972a69c0 100644 --- a/tests/fastboot/package.json +++ b/tests/fastboot/package.json @@ -90,7 +90,7 @@ "ember-inflector": "4.0.3", "ember-load-initializers": "^2.1.2", "ember-maybe-import-regenerator": "^1.0.0", - "ember-qunit": "^8.0.2", + "ember-qunit": "8.0.2", "ember-resolver": "^11.0.1", "ember-simple-tree": "^0.8.4", "ember-source": "~5.12.0", diff --git a/tests/main/config/ember-try.js b/tests/main/config/ember-try.js index 4cb5d1859a8..c248a6e7934 100644 --- a/tests/main/config/ember-try.js +++ b/tests/main/config/ember-try.js @@ -11,7 +11,6 @@ module.exports = function () { name: 'ember-lts-4.4', npm: { devDependencies: { - '@ember/test-helpers': '3.3.0', 'ember-source': '~4.4.0', }, }, @@ -36,9 +35,8 @@ module.exports = function () { name: 'ember-lts-3.28', npm: { devDependencies: { - '@ember/test-helpers': '3.3.0', + 'ember-cli': '~4.12.3', 'ember-source': '~3.28.0', - 'ember-cli': '~4.12.2', }, }, }, @@ -47,7 +45,6 @@ module.exports = function () { npm: { devDependencies: { 'ember-source': urls[0], - '@glimmer/component': '^1.1.2', }, }, }, diff --git a/tests/main/package.json b/tests/main/package.json index 19d2f7ca336..7b4954fad47 100644 --- a/tests/main/package.json +++ b/tests/main/package.json @@ -106,7 +106,7 @@ "@glint/environment-ember-loose": "1.5.0", "@glint/environment-ember-template-imports": "1.5.0", "@glint/template": "1.5.0", - "@types/qunit": "^2.19.10", + "@types/qunit": "2.19.10", "@warp-drive/core-types": "workspace:*", "@warp-drive/schema-record": "workspace:*", "@warp-drive/build-config": "workspace:*", @@ -135,7 +135,7 @@ "ember-load-initializers": "^2.1.2", "ember-maybe-import-regenerator": "^1.0.0", "ember-template-imports": "4.1.3", - "ember-qunit": "^8.0.2", + "ember-qunit": "8.0.2", "ember-resolver": "^11.0.1", "ember-source": "~5.12.0", "ember-source-channel-url": "^3.0.0", diff --git a/tests/warp-drive__schema-record/package.json b/tests/warp-drive__schema-record/package.json index 062b2e8d90c..6ac1de22c68 100644 --- a/tests/warp-drive__schema-record/package.json +++ b/tests/warp-drive__schema-record/package.json @@ -86,7 +86,7 @@ "@glint/environment-ember-loose": "1.5.0", "@glint/environment-ember-template-imports": "1.5.0", "@glint/template": "1.5.0", - "@types/qunit": "^2.19.10", + "@types/qunit": "2.19.10", "@warp-drive/core-types": "workspace:*", "@warp-drive/internal-config": "workspace:*", "@warp-drive/schema-record": "workspace:*",