diff --git a/packages/-ember-data/package.json b/packages/-ember-data/package.json index 198fa1ca51f..072730fd959 100644 --- a/packages/-ember-data/package.json +++ b/packages/-ember-data/package.json @@ -15,9 +15,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "move-dts": "bun ../../scripts/copy-declarations.mjs addon", "build:types": "tsc --build", - "_build": "pnpm build:types && pnpm move-dts", - "prepack": "pnpm build && cd ../../ && pnpm build:docs", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_build": "bun run build:types && bun run move-dts", + "prepack": "pnpm build && cd ../../ && bun run build:docs", + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "files": [ "dist/docs", diff --git a/packages/-ember-data/tsconfig.json b/packages/-ember-data/tsconfig.json index dd9fdf9ddf9..8d78890ee0d 100644 --- a/packages/-ember-data/tsconfig.json +++ b/packages/-ember-data/tsconfig.json @@ -43,4 +43,17 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../adapter" }, + { "path": "../graph" }, + { "path": "../json-api" }, + { "path": "../legacy-compat" }, + { "path": "../model" }, + { "path": "../request" }, + { "path": "../request-utils" }, + { "path": "../serializer" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/active-record/package.json b/packages/active-record/package.json index e6b9880ea49..7245fcacd1d 100644 --- a/packages/active-record/package.json +++ b/packages/active-record/package.json @@ -76,9 +76,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", diff --git a/packages/active-record/tsconfig.json b/packages/active-record/tsconfig.json index 2b4663c21e1..f27d473dddc 100644 --- a/packages/active-record/tsconfig.json +++ b/packages/active-record/tsconfig.json @@ -42,4 +42,11 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../request" }, + { "path": "../request-utils" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/adapter/package.json b/packages/adapter/package.json index 26641b69902..e8b1e838b4c 100644 --- a/packages/adapter/package.json +++ b/packages/adapter/package.json @@ -17,9 +17,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", diff --git a/packages/adapter/tsconfig.json b/packages/adapter/tsconfig.json index b98f70664a7..59f1c980503 100644 --- a/packages/adapter/tsconfig.json +++ b/packages/adapter/tsconfig.json @@ -46,4 +46,14 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../graph" }, + { "path": "../json-api" }, + { "path": "../legacy-compat" }, + { "path": "../request" }, + { "path": "../request-utils" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/core-types/package.json b/packages/core-types/package.json index 89919033b92..8baa18ed66d 100644 --- a/packages/core-types/package.json +++ b/packages/core-types/package.json @@ -16,9 +16,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "files": [ "addon", diff --git a/packages/core-types/src/cache.ts b/packages/core-types/src/cache.ts index 9f1590b89a6..674071b40db 100644 --- a/packages/core-types/src/cache.ts +++ b/packages/core-types/src/cache.ts @@ -335,7 +335,7 @@ export interface Cache { * @param field * @returns {unknown} */ - getAttr(identifier: StableRecordIdentifier, field: string): unknown; + getAttr(identifier: StableRecordIdentifier, field: string): Value | undefined; /** * Mutate the data for an attribute in the cache diff --git a/packages/debug/package.json b/packages/debug/package.json index f6f34ee4ee7..8ff2faffcce 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -15,7 +15,7 @@ "directories": {}, "scripts": { "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "peerDependencies": { "@ember-data/store": "workspace:5.5.0-alpha.11", diff --git a/packages/diagnostic/package.json b/packages/diagnostic/package.json index 343bb9e4442..39d3e818641 100644 --- a/packages/diagnostic/package.json +++ b/packages/diagnostic/package.json @@ -64,10 +64,10 @@ "build:tests": "rm -rf dist-test && cp -R test dist-test && mkdir -p dist-test/@warp-drive && cp -R dist dist-test/@warp-drive/diagnostic", "build:types": "tsc --build", "build:runtime": "rollup --config", - "_build": "pnpm build:runtime && pnpm build:types", + "_build": "bun run build:runtime && bun run build:types", "start": "rollup --config --watch", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "peerDependencies": { "@ember/test-helpers": ">= 3.2.0", diff --git a/packages/eslint-plugin-ember-data/package.json b/packages/eslint-plugin-ember-data/package.json index dc27b1811ef..83e5c5167d0 100644 --- a/packages/eslint-plugin-ember-data/package.json +++ b/packages/eslint-plugin-ember-data/package.json @@ -16,6 +16,6 @@ "pnpm-sync-dependencies-meta-injected": "0.0.10" }, "scripts": { - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" } } diff --git a/packages/graph/package.json b/packages/graph/package.json index d2f272bdcfc..283eef4607e 100644 --- a/packages/graph/package.json +++ b/packages/graph/package.json @@ -16,9 +16,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "files": [ "unstable-preview-types", diff --git a/packages/graph/tsconfig.json b/packages/graph/tsconfig.json index 50344f03788..ece63523275 100644 --- a/packages/graph/tsconfig.json +++ b/packages/graph/tsconfig.json @@ -42,4 +42,10 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../request" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/holodeck/package.json b/packages/holodeck/package.json index 889f9540bb6..d6e99de16ec 100644 --- a/packages/holodeck/package.json +++ b/packages/holodeck/package.json @@ -43,10 +43,10 @@ "scripts": { "build:types": "tsc --build", "build:client": "rollup --config", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "start": "rollup --config --watch", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "peerDependencies": { "@ember-data/request": "workspace:5.5.0-alpha.11", diff --git a/packages/holodeck/tsconfig.json b/packages/holodeck/tsconfig.json index 711db930c5b..da0a5459d1c 100644 --- a/packages/holodeck/tsconfig.json +++ b/packages/holodeck/tsconfig.json @@ -43,5 +43,9 @@ "inlineSources": true, "baseUrl": "client" - } + }, + "references": [ + { "path": "../request" }, + { "path": "../core-types" }, + ] } \ No newline at end of file diff --git a/packages/json-api/package.json b/packages/json-api/package.json index 5f10be382c0..ac3f702dc3c 100644 --- a/packages/json-api/package.json +++ b/packages/json-api/package.json @@ -16,9 +16,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", diff --git a/packages/json-api/src/-private/cache.ts b/packages/json-api/src/-private/cache.ts index d969df67239..a9899778e1b 100644 --- a/packages/json-api/src/-private/cache.ts +++ b/packages/json-api/src/-private/cache.ts @@ -1086,7 +1086,7 @@ export default class JSONAPICache implements Cache { * @param field * @returns {unknown} */ - getAttr(identifier: StableRecordIdentifier, attr: string): unknown { + getAttr(identifier: StableRecordIdentifier, attr: string): Value | undefined { const cached = this.__peek(identifier, true); if (cached.localAttrs && attr in cached.localAttrs) { return cached.localAttrs[attr]; diff --git a/packages/json-api/tsconfig.json b/packages/json-api/tsconfig.json index bdf315519ec..67175395685 100644 --- a/packages/json-api/tsconfig.json +++ b/packages/json-api/tsconfig.json @@ -43,4 +43,12 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../graph" }, + { "path": "../request" }, + { "path": "../request-utils" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/legacy-compat/package.json b/packages/legacy-compat/package.json index e8cd35dd1ac..ea47e288235 100644 --- a/packages/legacy-compat/package.json +++ b/packages/legacy-compat/package.json @@ -43,9 +43,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", diff --git a/packages/legacy-compat/tsconfig.json b/packages/legacy-compat/tsconfig.json index 2b4663c21e1..0bdb4f248af 100644 --- a/packages/legacy-compat/tsconfig.json +++ b/packages/legacy-compat/tsconfig.json @@ -42,4 +42,13 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../graph" }, + { "path": "../json-api" }, + { "path": "../request" }, + { "path": "../request-utils" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/model/package.json b/packages/model/package.json index 7ffa48fa90d..fe9dc205f5a 100644 --- a/packages/model/package.json +++ b/packages/model/package.json @@ -16,11 +16,11 @@ "scripts": { "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "move-dts": "bun ../../scripts/copy-declarations.mjs src", - "build:types": "tsc --build && pnpm move-dts", + "build:types": "tsc --build && bun run move-dts", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", diff --git a/packages/model/tsconfig.json b/packages/model/tsconfig.json index 8bd464e9ce8..1e61a4dd946 100644 --- a/packages/model/tsconfig.json +++ b/packages/model/tsconfig.json @@ -44,4 +44,14 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../graph" }, + { "path": "../json-api" }, + { "path": "../legacy-compat" }, + { "path": "../request" }, + { "path": "../request-utils" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/private-build-infra/package.json b/packages/private-build-infra/package.json index d71a8a6e103..df23f50b76b 100644 --- a/packages/private-build-infra/package.json +++ b/packages/private-build-infra/package.json @@ -11,7 +11,7 @@ "author": "", "directories": {}, "scripts": { - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependencies": { "@babel/core": "^7.23.2", diff --git a/packages/request-utils/package.json b/packages/request-utils/package.json index 36c78943a57..d1be39260f0 100644 --- a/packages/request-utils/package.json +++ b/packages/request-utils/package.json @@ -47,9 +47,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", diff --git a/packages/request-utils/tsconfig.json b/packages/request-utils/tsconfig.json index 7366f444721..3f1c091964a 100644 --- a/packages/request-utils/tsconfig.json +++ b/packages/request-utils/tsconfig.json @@ -44,5 +44,8 @@ "types": [ "ember-source/types" ] - } + }, + "references": [ + { "path": "../core-types" }, + ] } \ No newline at end of file diff --git a/packages/request/package.json b/packages/request/package.json index a1cd635bcf9..46ba3a84cf5 100644 --- a/packages/request/package.json +++ b/packages/request/package.json @@ -18,9 +18,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "files": [ "unstable-preview-types", diff --git a/packages/request/tsconfig.json b/packages/request/tsconfig.json index b67bd05e2ee..00d10b9c3ac 100644 --- a/packages/request/tsconfig.json +++ b/packages/request/tsconfig.json @@ -44,5 +44,8 @@ "paths": { "@ember-data/env": ["../../private-build-infra/virtual-packages/env.d.ts"], } - } + }, + "references": [ + { "path": "../core-types" }, + ] } \ No newline at end of file diff --git a/packages/rest/package.json b/packages/rest/package.json index 3081d228412..8ac2ad1a087 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -51,9 +51,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", diff --git a/packages/rest/tsconfig.json b/packages/rest/tsconfig.json index c72a4c033bf..b67568b7761 100644 --- a/packages/rest/tsconfig.json +++ b/packages/rest/tsconfig.json @@ -42,4 +42,11 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../request" }, + { "path": "../request-utils" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/schema-record/.eslintrc.cjs b/packages/schema-record/.eslintrc.cjs new file mode 100644 index 00000000000..a7c9b24a636 --- /dev/null +++ b/packages/schema-record/.eslintrc.cjs @@ -0,0 +1,26 @@ +const imports = require('@warp-drive/internal-config/eslint/imports.cjs'); +const parser = require('@warp-drive/internal-config/eslint/parser.cjs'); +const isolation = require('@warp-drive/internal-config/eslint/isolation.cjs'); +const ignore = require('@warp-drive/internal-config/eslint/ignore.cjs'); +const node = require('@warp-drive/internal-config/eslint/node.cjs'); +const base = require('@warp-drive/internal-config/eslint/base.cjs'); +const typescript = require('@warp-drive/internal-config/eslint/typescript.cjs'); + +module.exports = { + ...parser.defaults(), + + plugins: [...base.plugins(), ...imports.plugins()], + extends: [...base.extend()], + rules: Object.assign( + base.rules(), + imports.rules(), + isolation.rules({ + allowedImports: [], + }), + {} + ), + + ignorePatterns: ignore.ignoreRules(), + + overrides: [node.defaults(), typescript.defaults()], +}; diff --git a/packages/schema-record/package.json b/packages/schema-record/package.json index a555c706f32..0ea0fed7abd 100644 --- a/packages/schema-record/package.json +++ b/packages/schema-record/package.json @@ -14,11 +14,12 @@ "license": "MIT", "author": "", "scripts": { - "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client", - "start": "rollup --config --watch", + "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", + "build:runtime": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", + "build:types": "tsc --build", + "_build": "bun run build:runtime && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", @@ -36,6 +37,21 @@ "dependenciesMeta": { "@ember-data/private-build-infra": { "injected": true + }, + "@ember-data/request": { + "injected": true + }, + "@ember-data/store": { + "injected": true + }, + "@ember-data/tracking": { + "injected": true + }, + "@warp-drive/core-types": { + "injected": true + }, + "@ember/string": { + "injected": true } }, "dependencies": { @@ -56,16 +72,21 @@ "@babel/preset-env": "^7.23.2", "@babel/preset-typescript": "^7.23.2", "@babel/runtime": "^7.23.2", + "@ember-data/request": "workspace:5.5.0-alpha.11", + "@ember-data/store": "workspace:5.5.0-alpha.11", + "@ember-data/tracking": "workspace:5.5.0-alpha.11", "@embroider/addon-dev": "^4.1.1", "@glimmer/component": "^1.1.2", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-node-resolve": "^15.2.3", + "@warp-drive/core-types": "workspace:5.5.0-alpha.11", "@warp-drive/internal-config": "workspace:5.5.0-alpha.11", "ember-source": "~5.3.0", "rollup": "^4.1.4", "typescript": "^5.2.2", "walk-sync": "^3.0.0", - "webpack": "^5.89.0" + "webpack": "^5.89.0", + "@ember/string": "^3.1.1" }, "ember": { "edition": "octane" diff --git a/packages/schema-record/src/hooks.ts b/packages/schema-record/src/hooks.ts index 65220ce6303..26cd349c623 100644 --- a/packages/schema-record/src/hooks.ts +++ b/packages/schema-record/src/hooks.ts @@ -1,8 +1,13 @@ import type Store from '@ember-data/store'; -import type { StableRecordIdentifier } from "@warp-drive/core-types"; +import type { StableRecordIdentifier } from '@warp-drive/core-types'; + import { Destroy, SchemaRecord } from './record'; -export function instantiateRecord(store: Store, identifier: StableRecordIdentifier, createArgs?: Record): SchemaRecord { +export function instantiateRecord( + store: Store, + identifier: StableRecordIdentifier, + createArgs?: Record +): SchemaRecord { if (createArgs) { const editable = new SchemaRecord(store, identifier, true); Object.assign(editable, createArgs); diff --git a/packages/schema-record/src/record.ts b/packages/schema-record/src/record.ts index cef35fd8789..feb5c39dd36 100644 --- a/packages/schema-record/src/record.ts +++ b/packages/schema-record/src/record.ts @@ -1,13 +1,16 @@ +import { DEBUG } from '@ember-data/env'; +import type { Future } from '@ember-data/request'; import type Store from '@ember-data/store'; -import type { StableRecordIdentifier } from "@warp-drive/core-types"; +import type { StoreRequestInput } from '@ember-data/store/-private/cache-handler'; +import type { NotificationType } from '@ember-data/store/-private/managers/notification-manager'; +import { addToTransaction, defineSignal, entangleSignal, type Signal } from '@ember-data/tracking/-private'; +import type { StableRecordIdentifier } from '@warp-drive/core-types'; +import type { Cache } from '@warp-drive/core-types/cache'; +import type { ResourceRelationship as SingleResourceRelationship } from '@warp-drive/core-types/cache/relationship'; +import { Value } from '@warp-drive/core-types/json/raw'; +import type { Link, Links } from '@warp-drive/core-types/spec/raw'; + import type { FieldSchema, SchemaService } from './schema'; -import { Cache } from '@ember-data/store/-types/q/cache'; -import { Link, Links, SingleResourceRelationship } from '@warp-drive/core-types/spec/raw'; -import { StoreRequestInput } from '@ember-data/store/-private/cache-handler'; -import { Future } from '@ember-data/request'; -import { DEBUG } from '@ember-data/env'; -import { NotificationType } from '@ember-data/store/-private/managers/notification-manager'; -import { addToTransaction, entangleSignal, defineSignal } from '@ember-data/tracking/-private'; export const Destroy = Symbol('Destroy'); export const RecordStore = Symbol('Store'); @@ -16,7 +19,14 @@ export const Editable = Symbol('Editable'); export const Parent = Symbol('Parent'); export const Checkout = Symbol('Checkout'); -function computeAttribute(schema: SchemaService, cache: Cache, record: SchemaRecord, identifier: StableRecordIdentifier, field: FieldSchema, prop: string): unknown { +function computeAttribute( + schema: SchemaService, + cache: Cache, + record: SchemaRecord, + identifier: StableRecordIdentifier, + field: FieldSchema, + prop: string +): unknown { const rawValue = cache.getAttr(identifier, prop); if (field.type === null) { return rawValue; @@ -28,7 +38,13 @@ function computeAttribute(schema: SchemaService, cache: Cache, record: SchemaRec return transform.hydrate(rawValue, field.options ?? null, record); } -function computeDerivation(schema: SchemaService, record: SchemaRecord, identifier: StableRecordIdentifier, field: FieldSchema, prop: string): unknown { +function computeDerivation( + schema: SchemaService, + record: SchemaRecord, + identifier: StableRecordIdentifier, + field: FieldSchema, + prop: string +): unknown { if (field.type === null) { throw new Error(`The schema for ${identifier.type}.${String(prop)} is missing the type of the derivation`); } @@ -52,11 +68,19 @@ class ResourceRelationship { declare links: Links; declare meta: Record; - constructor(store: Store, cache: Cache, parent: SchemaRecord, identifier: StableRecordIdentifier, field: FieldSchema, name: string) { + constructor( + store: Store, + cache: Cache, + parent: SchemaRecord, + identifier: StableRecordIdentifier, + field: FieldSchema, + name: string + ) { const rawValue = cache.getRelationship(identifier, name) as SingleResourceRelationship; // TODO setup true lids for relationship documents - // @ts-expect-error we need to put lid on the relationship + // @ts-expect-error we need to give relationship documents a lid + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment this.lid = rawValue.lid ?? rawValue.links?.self ?? `relationship:${identifier.lid}.${name}`; this.data = rawValue.data ? store.peekRecord(rawValue.data) : null; this.name = name; @@ -77,12 +101,19 @@ class ResourceRelationship { const url = options?.url ?? getHref(this.links.related) ?? getHref(this.links.self) ?? null; if (!url) { - throw new Error(`Cannot ${options?.method ?? 'fetch'} ${this[Parent][Identifier].type}.${String(this.name)} because it has no related link`); + throw new Error( + `Cannot ${options?.method ?? 'fetch'} ${this[Parent][Identifier].type}.${String( + this.name + )} because it has no related link` + ); } - const request = Object.assign({ - url, - method: 'GET', - }, options); + const request = Object.assign( + { + url, + method: 'GET', + }, + options + ); return this[RecordStore].request(request); } @@ -102,7 +133,14 @@ function getHref(link?: Link | null): string | null { return link.href; } -function computeResource(store: Store, cache: Cache, parent: SchemaRecord, identifier: StableRecordIdentifier, field: FieldSchema, prop: string): ResourceRelationship { +function computeResource( + store: Store, + cache: Cache, + parent: SchemaRecord, + identifier: StableRecordIdentifier, + field: FieldSchema, + prop: string +): ResourceRelationship { if (field.kind !== 'resource') { throw new Error(`The schema for ${identifier.type}.${String(prop)} is not a resource relationship`); } @@ -125,22 +163,25 @@ export class SchemaRecord { const cache = store.cache; const fields = schema.fields(identifier); - const signals = new Map(); - this.___notifications = store.notifications.subscribe(identifier, (_: StableRecordIdentifier, type: NotificationType, key?: string) => { - switch (type) { - case 'attributes': - if (key) { - const signal = signals.get(key); - if (signal) { - addToTransaction(signal); + const signals: Map = new Map(); + this.___notifications = store.notifications.subscribe( + identifier, + (_: StableRecordIdentifier, type: NotificationType, key?: string) => { + switch (type) { + case 'attributes': + if (key) { + const signal = signals.get(key); + if (signal) { + addToTransaction(signal); + } } - } - break; + break; + } } - }); + ); return new Proxy(this, { - get(target, prop, receiver) { + get(target: SchemaRecord, prop: string | number | symbol, receiver: typeof Proxy) { if (prop === Destroy) { return target[Destroy]; } @@ -166,13 +207,12 @@ export class SchemaRecord { return computeResource(store, cache, target, identifier, field, prop as string); case 'derived': - return computeDerivation(schema, receiver, identifier, field, prop as string); + return computeDerivation(schema, receiver as unknown as SchemaRecord, identifier, field, prop as string); default: throw new Error(`Field '${String(prop)}' on '${identifier.type}' has the unknown kind '${field.kind}'`); } - }, - set(target, prop, value) { + set(target: SchemaRecord, prop: string | number | symbol, value: unknown) { if (!target[Editable]) { throw new Error(`Cannot set ${String(prop)} on ${identifier.type} because the record is not editable`); } @@ -184,7 +224,7 @@ export class SchemaRecord { if (field.kind === 'attribute') { if (field.type === null) { - cache.setAttr(identifier, prop as string, value); + cache.setAttr(identifier, prop as string, value as Value); return true; } const transform = schema.transforms.get(field.type); diff --git a/packages/schema-record/src/schema.ts b/packages/schema-record/src/schema.ts index f9a543f0741..820ed787ea0 100644 --- a/packages/schema-record/src/schema.ts +++ b/packages/schema-record/src/schema.ts @@ -1,6 +1,8 @@ -import type { StableRecordIdentifier } from "@warp-drive/core-types"; +import type { StableRecordIdentifier } from '@warp-drive/core-types'; +import { Value } from '@warp-drive/core-types/json/raw'; import type { AttributeSchema, RelationshipSchema } from '@warp-drive/core-types/schema'; -import type { SchemaRecord } from "./record"; + +import type { SchemaRecord } from './record'; export const Destroy = Symbol('Destroy'); export const RecordStore = Symbol('Store'); @@ -20,11 +22,11 @@ type FieldSpec = { relationships: Record; // new support fields: Map; -} +}; -export type Transform = { +export type Transform = { serialize(value: PT, options: Record | null, record: SchemaRecord): T; - hydrate(value: T, options: Record | null, record: SchemaRecord): PT; + hydrate(value: T | undefined, options: Record | null, record: SchemaRecord): PT; defaultValue?(options: Record | null, identifier: StableRecordIdentifier): T; }; @@ -32,7 +34,7 @@ export type Derivation = (record: R, options: Record | nu export class SchemaService { declare schemas: Map; - declare transforms: Map; + declare transforms: Map>; declare derivations: Map>; constructor() { @@ -41,7 +43,7 @@ export class SchemaService { this.derivations = new Map(); } - registerTransform(type: string, transform: Transform): void { + registerTransform(type: string, transform: Transform): void { this.transforms.set(type, transform); } diff --git a/packages/schema-record/tsconfig.json b/packages/schema-record/tsconfig.json new file mode 100644 index 00000000000..3f991627005 --- /dev/null +++ b/packages/schema-record/tsconfig.json @@ -0,0 +1,49 @@ +{ + "include": [ + "src/**/*" + ], + "baseUrl": ".", + "compilerOptions": { + "lib": ["DOM", "ESNext"], + "module": "esnext", + "target": "esnext", + "moduleResolution": "bundler", + "moduleDetection": "force", + "strict": true, + "downlevelIteration": true, + "skipLibCheck": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "allowJs": true, + "noEmit": false, + "experimentalDecorators": true, + + // Enable faster builds + // but causes us to not rebuild properly + "composite": true, + "incremental": true, + "rootDir": "src", + + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "declarationDir": "unstable-preview-types", + "inlineSourceMap": true, + "inlineSources": true, + "types": [], + + "paths": { + "@ember-data/deprecations": ["../private-build-infra/virtual-packages/deprecations.d.ts"], + "@ember-data/packages": ["../private-build-infra/virtual-packages/packages.d.ts"], + "@ember-data/canary-features": ["../private-build-infra/virtual-packages/canary-features.d.ts"], + "@ember-data/debugging": ["../private-build-infra/virtual-packages/debugging.d.ts"], + "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], + } + }, + "references": [ + { "path": "../request" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] +} diff --git a/packages/schema/package.json b/packages/schema/package.json index d3b38d93623..ab936e78aa9 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -23,9 +23,9 @@ "scripts": { "build:parse": "bun build src/parse.ts --compile --outfile parse", "build:scaffold": "bun build src/scaffold.ts --compile --outfile scaffold", - "build": "pnpm run build:parse && pnpm run build:scaffold", + "build": "bun run build:parse && bun run build:scaffold", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "files": [ "README.md", diff --git a/packages/serializer/package.json b/packages/serializer/package.json index 66b8adf034e..96134f7d9f3 100644 --- a/packages/serializer/package.json +++ b/packages/serializer/package.json @@ -17,9 +17,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:types": "tsc --build", "build:client": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", - "_build": "pnpm build:client && pnpm build:types", + "_build": "bun run build:client && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.js", diff --git a/packages/serializer/tsconfig.json b/packages/serializer/tsconfig.json index 7d13b1bb2f8..f518084f738 100644 --- a/packages/serializer/tsconfig.json +++ b/packages/serializer/tsconfig.json @@ -43,4 +43,10 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../request" }, + { "path": "../store" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/store/package.json b/packages/store/package.json index 073e51c4ec0..619b16aeffe 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -35,9 +35,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:runtime": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "build:types": "tsc --build", - "_build": "pnpm build:runtime && pnpm build:types", + "_build": "bun run build:runtime && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependencies": { "@ember-data/private-build-infra": "workspace:5.5.0-alpha.11", diff --git a/packages/store/src/-private/managers/cache-manager.ts b/packages/store/src/-private/managers/cache-manager.ts index 960338a021e..75ed545c286 100644 --- a/packages/store/src/-private/managers/cache-manager.ts +++ b/packages/store/src/-private/managers/cache-manager.ts @@ -352,7 +352,7 @@ export class CacheManager implements Cache { * @param propertyName * @returns {unknown} */ - getAttr(identifier: StableRecordIdentifier, propertyName: string): unknown { + getAttr(identifier: StableRecordIdentifier, propertyName: string): Value | undefined { return this.#cache.getAttr(identifier, propertyName); } diff --git a/packages/store/tsconfig.json b/packages/store/tsconfig.json index 3df657b7ed7..d4230878282 100644 --- a/packages/store/tsconfig.json +++ b/packages/store/tsconfig.json @@ -43,4 +43,9 @@ "@ember-data/env": ["../private-build-infra/virtual-packages/env.d.ts"], } }, + "references": [ + { "path": "../request" }, + { "path": "../tracking" }, + { "path": "../core-types" }, + ] } diff --git a/packages/tracking/package.json b/packages/tracking/package.json index 5a3ab38f614..88bcb70b183 100644 --- a/packages/tracking/package.json +++ b/packages/tracking/package.json @@ -59,9 +59,9 @@ "lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs", "build:runtime": "rollup --config && babel ./addon --out-dir addon --plugins=../private-build-infra/src/transforms/babel-plugin-transform-ext.js", "build:types": "tsc --build", - "_build": "pnpm build:runtime && pnpm build:types", + "_build": "bun run build:runtime && bun run build:types", "prepack": "pnpm build", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "ember-addon": { "main": "addon-main.cjs", diff --git a/packages/tracking/src/-private.ts b/packages/tracking/src/-private.ts index a64501f11b5..f01f186c199 100644 --- a/packages/tracking/src/-private.ts +++ b/packages/tracking/src/-private.ts @@ -259,11 +259,11 @@ export function memoTransact(method: T): (...args: unknown[] export const Signals = Symbol('Signals'); -export function defineSignal(obj: T, key: K, v?: unknown) { +export function defineSignal(obj: T, key: string, v?: unknown) { Object.defineProperty(obj, key, { enumerable: true, configurable: false, - get(this: T & { [Signals]: Map }) { + get(this: T & { [Signals]: Map }) { const signals = (this[Signals] = this[Signals] || new Map()); const existing = signals.has(key); const _signal = entangleSignal(signals, this, key); @@ -272,7 +272,7 @@ export function defineSignal(obj: } return _signal.lastValue; }, - set(this: T & { [Signals]: Map }, value: unknown) { + set(this: T & { [Signals]: Map }, value: unknown) { const signals = (this[Signals] = this[Signals] || new Map()); let _signal = signals.get(key); if (!_signal) { @@ -306,7 +306,7 @@ export function createArrayTags(obj: T, signal: Signal) { } } -export function createSignal(obj: T, key: K): Signal { +export function createSignal(obj: T, key: string): Signal { const _signal: Signal = { key, tag: tagForProperty(obj, key), @@ -330,11 +330,7 @@ export function createSignal(obj: return _signal; } -export function entangleSignal( - signals: Map, - obj: T, - key: K -): Signal { +export function entangleSignal(signals: Map, obj: T, key: string): Signal { let _signal = signals.get(key); if (!_signal) { _signal = createSignal(obj, key); @@ -348,7 +344,7 @@ interface Signaler { [Signals]: Map; } -export function getSignal(obj: T, key: K, initialState: boolean): Signal { +export function getSignal(obj: T, key: string, initialState: boolean): Signal { const signals = ((obj as Signaler)[Signals] = (obj as Signaler)[Signals] || new Map()); let _signal = signals.get(key); if (!_signal) { @@ -359,7 +355,7 @@ export function getSignal(obj: T, return _signal; } -export function peekSignal(obj: T, key: K): Signal | undefined { +export function peekSignal(obj: T, key: string): Signal | undefined { const signals = (obj as Signaler)[Signals]; if (signals) { return signals.get(key); diff --git a/packages/tracking/tsconfig.json b/packages/tracking/tsconfig.json index 0dc116f1b58..84ee5085577 100644 --- a/packages/tracking/tsconfig.json +++ b/packages/tracking/tsconfig.json @@ -40,5 +40,5 @@ "@ember-data/debugging": ["./node_modules/@ember-data/private-build-infra/virtual-packages/debugging.d.ts"], "@ember-data/env": ["./node_modules/@ember-data/private-build-infra/virtual-packages/env.d.ts"], } - } + }, } diff --git a/packages/unpublished-eslint-rules/package.json b/packages/unpublished-eslint-rules/package.json index 9d1bae9c8c0..5288e4fe4a1 100644 --- a/packages/unpublished-eslint-rules/package.json +++ b/packages/unpublished-eslint-rules/package.json @@ -15,6 +15,6 @@ "pnpm-sync-dependencies-meta-injected": "0.0.10" }, "scripts": { - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" } } diff --git a/packages/unpublished-test-infra/package.json b/packages/unpublished-test-infra/package.json index 3d1a16bbbb9..8706ba42404 100644 --- a/packages/unpublished-test-infra/package.json +++ b/packages/unpublished-test-infra/package.json @@ -19,7 +19,7 @@ }, "scripts": { "test:infra": "ember test", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "peerDependencies": { "qunit": "^2.20.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac96e958c6e..b7cbe6cbb80 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1692,6 +1692,18 @@ importers: '@babel/runtime': specifier: ^7.23.2 version: 7.23.2 + '@ember-data/request': + specifier: workspace:5.5.0-alpha.11 + version: file:packages/request(@babel/core@7.23.2)(@warp-drive/core-types@5.5.0-alpha.11) + '@ember-data/store': + specifier: workspace:5.5.0-alpha.11 + version: file:packages/store(@babel/core@7.23.2)(@ember-data/request@5.5.0-alpha.11)(@ember-data/tracking@5.5.0-alpha.11)(@ember/string@3.1.1)(@warp-drive/core-types@5.5.0-alpha.11) + '@ember-data/tracking': + specifier: workspace:5.5.0-alpha.11 + version: file:packages/tracking(@babel/core@7.23.2)(ember-source@5.3.0) + '@ember/string': + specifier: 3.1.1 + version: 3.1.1(@babel/core@7.23.2) '@embroider/addon-dev': specifier: ^4.1.1 version: 4.1.1(rollup@4.1.4) @@ -1704,6 +1716,9 @@ importers: '@rollup/plugin-node-resolve': specifier: ^15.2.3 version: 15.2.3(rollup@4.1.4) + '@warp-drive/core-types': + specifier: workspace:5.5.0-alpha.11 + version: file:packages/core-types(@babel/core@7.23.2) '@warp-drive/internal-config': specifier: workspace:5.5.0-alpha.11 version: link:../../config @@ -1725,6 +1740,16 @@ importers: dependenciesMeta: '@ember-data/private-build-infra': injected: true + '@ember-data/request': + injected: true + '@ember-data/store': + injected: true + '@ember-data/tracking': + injected: true + '@ember/string': + injected: true + '@warp-drive/core-types': + injected: true packages/serializer: dependencies: @@ -3645,7 +3670,7 @@ importers: version: file:packages/graph(@babel/core@7.23.2)(@ember-data/store@5.5.0-alpha.11)(@warp-drive/core-types@5.5.0-alpha.11) '@ember-data/json-api': specifier: workspace:5.5.0-alpha.11 - version: file:packages/json-api(@babel/core@7.23.2)(@ember-data/graph@5.5.0-alpha.11)(@ember-data/request-utils@packages+request-utils)(@ember-data/store@5.5.0-alpha.11)(@warp-drive/core-types@5.5.0-alpha.11)(ember-inflector@4.0.2) + version: file:packages/json-api(@babel/core@7.23.2)(@ember-data/graph@5.5.0-alpha.11)(@ember-data/request-utils@5.5.0-alpha.11)(@ember-data/store@5.5.0-alpha.11)(@warp-drive/core-types@5.5.0-alpha.11)(ember-inflector@4.0.2) '@ember-data/legacy-compat': specifier: workspace:5.5.0-alpha.11 version: file:packages/legacy-compat(@babel/core@7.23.2)(@ember-data/graph@5.5.0-alpha.11)(@ember-data/json-api@5.5.0-alpha.11)(@ember-data/request@5.5.0-alpha.11)(@ember-data/store@5.5.0-alpha.11)(@warp-drive/core-types@5.5.0-alpha.11) @@ -3660,7 +3685,7 @@ importers: version: file:packages/request(@babel/core@7.23.2)(@warp-drive/core-types@5.5.0-alpha.11) '@ember-data/request-utils': specifier: workspace:5.5.0-alpha.11 - version: link:../../packages/request-utils + version: file:packages/request-utils(@babel/core@7.23.2)(@warp-drive/core-types@5.5.0-alpha.11) '@ember-data/serializer': specifier: workspace:5.5.0-alpha.11 version: file:packages/serializer(@babel/core@7.23.2)(@ember/string@3.1.1)(@warp-drive/core-types@5.5.0-alpha.11)(ember-inflector@4.0.2) @@ -3840,6 +3865,8 @@ importers: injected: true '@ember-data/request': injected: true + '@ember-data/request-utils': + injected: true '@ember-data/serializer': injected: true '@ember-data/store': @@ -18429,7 +18456,7 @@ packages: file:config: resolution: {directory: config, type: directory} name: '@warp-drive/internal-config' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} dependencies: '@babel/core': 7.23.2(supports-color@8.1.1) '@babel/eslint-parser': 7.22.15(@babel/core@7.23.2)(eslint@8.52.0) @@ -18455,7 +18482,7 @@ packages: resolution: {directory: packages/-ember-data, type: directory} id: file:packages/-ember-data name: ember-data - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember/string': 3.1.1 dependencies: @@ -18496,7 +18523,7 @@ packages: resolution: {directory: packages/active-record, type: directory} id: file:packages/active-record name: '@ember-data/active-record' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/request-utils': workspace:5.5.0-alpha.11 '@ember-data/store': ^4.12.0 || ^5.0.0 @@ -18520,7 +18547,7 @@ packages: resolution: {directory: packages/adapter, type: directory} id: file:packages/adapter name: '@ember-data/adapter' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/legacy-compat': workspace:5.5.0-alpha.11 '@ember-data/store': workspace:5.5.0-alpha.11 @@ -18545,7 +18572,7 @@ packages: resolution: {directory: packages/core-types, type: directory} id: file:packages/core-types name: '@warp-drive/core-types' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} dependencies: '@ember-data/private-build-infra': file:packages/private-build-infra ember-cli-babel: 8.2.0(@babel/core@7.23.2) @@ -18559,7 +18586,7 @@ packages: resolution: {directory: packages/debug, type: directory} id: file:packages/debug name: '@ember-data/debug' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/store': workspace:5.5.0-alpha.11 '@ember/string': 3.1.1 @@ -18586,7 +18613,7 @@ packages: resolution: {directory: packages/diagnostic, type: directory} id: file:packages/diagnostic name: '@warp-drive/diagnostic' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember/test-helpers': '>= 3.2.0' '@embroider/addon-shim': '>= 1.8.6' @@ -18613,7 +18640,7 @@ packages: resolution: {directory: packages/graph, type: directory} id: file:packages/graph name: '@ember-data/graph' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/store': workspace:5.5.0-alpha.11 '@warp-drive/core-types': workspace:5.5.0-alpha.11 @@ -18634,7 +18661,7 @@ packages: resolution: {directory: packages/holodeck, type: directory} id: file:packages/holodeck name: '@warp-drive/holodeck' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} hasBin: true peerDependencies: '@ember-data/request': workspace:5.5.0-alpha.11 @@ -18657,7 +18684,7 @@ packages: resolution: {directory: packages/json-api, type: directory} id: file:packages/json-api name: '@ember-data/json-api' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/graph': workspace:5.5.0-alpha.11 '@ember-data/request-utils': workspace:5.5.0-alpha.11 @@ -18683,42 +18710,11 @@ packages: - '@glint/template' - supports-color - file:packages/json-api(@babel/core@7.23.2)(@ember-data/graph@5.5.0-alpha.11)(@ember-data/request-utils@packages+request-utils)(@ember-data/store@5.5.0-alpha.11)(@warp-drive/core-types@5.5.0-alpha.11)(ember-inflector@4.0.2): - resolution: {directory: packages/json-api, type: directory} - id: file:packages/json-api - name: '@ember-data/json-api' - engines: {node: '>= 18.18.2'} - peerDependencies: - '@ember-data/graph': workspace:5.5.0-alpha.11 - '@ember-data/request-utils': workspace:5.5.0-alpha.11 - '@ember-data/store': workspace:5.5.0-alpha.11 - '@warp-drive/core-types': workspace:5.5.0-alpha.11 - ember-inflector: ^4.0.2 - peerDependenciesMeta: - '@ember-data/request-utils': - optional: true - dependencies: - '@ember-data/graph': file:packages/graph(@babel/core@7.23.2)(@ember-data/store@5.5.0-alpha.11)(@warp-drive/core-types@5.5.0-alpha.11) - '@ember-data/private-build-infra': file:packages/private-build-infra - '@ember-data/request-utils': link:packages/request-utils - '@ember-data/store': file:packages/store(@babel/core@7.23.2)(@ember-data/request@5.5.0-alpha.11)(@ember-data/tracking@5.5.0-alpha.11)(@ember/string@3.1.1)(@warp-drive/core-types@5.5.0-alpha.11) - '@ember/edition-utils': 1.2.0 - '@embroider/macros': 1.13.2(@babel/core@7.23.2) - '@warp-drive/core-types': file:packages/core-types(@babel/core@7.23.2) - ember-cli-babel: 8.2.0(@babel/core@7.23.2) - ember-inflector: 4.0.2(@babel/core@7.23.2) - pnpm-sync-dependencies-meta-injected: 0.0.10 - transitivePeerDependencies: - - '@babel/core' - - '@glint/template' - - supports-color - dev: true - file:packages/legacy-compat(@babel/core@7.23.2)(@ember-data/graph@5.5.0-alpha.11)(@ember-data/json-api@5.5.0-alpha.11)(@ember-data/request@5.5.0-alpha.11)(@ember-data/store@5.5.0-alpha.11)(@warp-drive/core-types@5.5.0-alpha.11): resolution: {directory: packages/legacy-compat, type: directory} id: file:packages/legacy-compat name: '@ember-data/legacy-compat' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/graph': workspace:5.5.0-alpha.11 '@ember-data/json-api': workspace:5.5.0-alpha.11 @@ -18749,7 +18745,7 @@ packages: resolution: {directory: packages/model, type: directory} id: file:packages/model name: '@ember-data/model' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/debug': workspace:5.5.0-alpha.11 '@ember-data/graph': workspace:5.5.0-alpha.11 @@ -18793,7 +18789,7 @@ packages: file:packages/private-build-infra: resolution: {directory: packages/private-build-infra, type: directory} name: '@ember-data/private-build-infra' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} dependencies: '@babel/core': 7.23.2(supports-color@8.1.1) '@babel/plugin-transform-block-scoping': 7.23.0(@babel/core@7.23.2) @@ -18826,7 +18822,7 @@ packages: resolution: {directory: packages/request, type: directory} id: file:packages/request name: '@ember-data/request' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@warp-drive/core-types': workspace:5.5.0-alpha.11 dependencies: @@ -18845,7 +18841,7 @@ packages: resolution: {directory: packages/request-utils, type: directory} id: file:packages/request-utils name: '@ember-data/request-utils' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@warp-drive/core-types': workspace:5.5.0-alpha.11 dependencies: @@ -18860,7 +18856,7 @@ packages: resolution: {directory: packages/rest, type: directory} id: file:packages/rest name: '@ember-data/rest' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/request-utils': workspace:5.5.0-alpha.11 '@ember-data/store': ^4.12.0 || ^5.0.0 @@ -18884,7 +18880,7 @@ packages: resolution: {directory: packages/schema-record, type: directory} id: file:packages/schema-record name: '@warp-drive/schema-record' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} dependencies: '@ember-data/private-build-infra': file:packages/private-build-infra '@ember/edition-utils': 1.2.0 @@ -18901,7 +18897,7 @@ packages: resolution: {directory: packages/serializer, type: directory} id: file:packages/serializer name: '@ember-data/serializer' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember/string': 3.1.1 '@warp-drive/core-types': workspace:5.5.0-alpha.11 @@ -18924,7 +18920,7 @@ packages: resolution: {directory: packages/store, type: directory} id: file:packages/store name: '@ember-data/store' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: '@ember-data/request': workspace:5.5.0-alpha.11 '@ember-data/tracking': workspace:5.5.0-alpha.11 @@ -18948,7 +18944,7 @@ packages: resolution: {directory: packages/tracking, type: directory} id: file:packages/tracking name: '@ember-data/tracking' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} dependencies: '@ember-data/private-build-infra': file:packages/private-build-infra '@embroider/macros': 1.13.2(@babel/core@7.23.2) @@ -18965,7 +18961,7 @@ packages: resolution: {directory: packages/unpublished-test-infra, type: directory} id: file:packages/unpublished-test-infra name: '@ember-data/unpublished-test-infra' - engines: {node: '>= 18.18.2'} + engines: {node: '>= 20.8.1'} peerDependencies: qunit: 2.19.4 peerDependenciesMeta: diff --git a/scripts/validate-deps.js b/scripts/validate-deps.js index 925b9540e34..4086c84ae7d 100644 --- a/scripts/validate-deps.js +++ b/scripts/validate-deps.js @@ -75,7 +75,7 @@ pkgs.forEach((pkg) => { if (!pkg.scripts['_syncPnpm']) { console.log(`Missing _syncPnpm script for ${pkg.name}`); edited = true; - pkg.scripts['_syncPnpm'] = "pnpm sync-dependencies-meta-injected"; + pkg.scripts['_syncPnpm'] = "bun run sync-dependencies-meta-injected"; } if (pkg.scripts['prepare']) { console.log(`Removing prepare script for ${pkg.name}`); diff --git a/tests/blueprints/package.json b/tests/blueprints/package.json index 15795ae1a93..b4e5c19815d 100644 --- a/tests/blueprints/package.json +++ b/tests/blueprints/package.json @@ -12,7 +12,7 @@ "author": "", "scripts": { "test:blueprints": "mocha tests", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@ember-data/unpublished-test-infra": { diff --git a/tests/builders/package.json b/tests/builders/package.json index b0304d95c8d..936e3a605b5 100644 --- a/tests/builders/package.json +++ b/tests/builders/package.json @@ -18,7 +18,7 @@ "build:production": "pnpm build:tests -e production", "test": "bun ./diagnostic.js", "test:production": "bun ./diagnostic.js", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@ember-data/json-api": { diff --git a/tests/docs/package.json b/tests/docs/package.json index 54f7c8a778b..0d6e972a6a8 100644 --- a/tests/docs/package.json +++ b/tests/docs/package.json @@ -12,7 +12,7 @@ "author": "", "scripts": { "test:docs": "qunit ./index.js", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "devDependencies": { "qunit": "^2.20.0" diff --git a/tests/ember-data__adapter/package.json b/tests/ember-data__adapter/package.json index f7dc1f98e1d..150dee84797 100644 --- a/tests/ember-data__adapter/package.json +++ b/tests/ember-data__adapter/package.json @@ -19,7 +19,7 @@ "_build:production": "pnpm build:tests -e production", "test": "bun ./diagnostic.js", "_test:production": "bun ./diagnostic.js", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@ember-data/debug": { diff --git a/tests/ember-data__graph/package.json b/tests/ember-data__graph/package.json index 270d73151b3..a106796fb51 100644 --- a/tests/ember-data__graph/package.json +++ b/tests/ember-data__graph/package.json @@ -19,7 +19,7 @@ "build:production": "pnpm build:tests -e production", "test": "bun ./diagnostic.js", "test:production": "bun ./diagnostic.js", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@warp-drive/diagnostic": { diff --git a/tests/ember-data__json-api/package.json b/tests/ember-data__json-api/package.json index c7e45f1a12c..0c28e91e968 100644 --- a/tests/ember-data__json-api/package.json +++ b/tests/ember-data__json-api/package.json @@ -19,7 +19,7 @@ "build:production": "pnpm build:tests -e production", "test": "bun ./diagnostic.js", "test:production": "bun ./diagnostic.js", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@warp-drive/diagnostic": { diff --git a/tests/ember-data__model/package.json b/tests/ember-data__model/package.json index 7ff4608f11f..cfa41393955 100644 --- a/tests/ember-data__model/package.json +++ b/tests/ember-data__model/package.json @@ -17,7 +17,7 @@ "scripts": { "build:tests": "IS_TESTING=true EMBER_CLI_TEST_COMMAND=true ember build --output-path=dist-test --suppress-sizes", "test": "bun ./diagnostic.js", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@ember-data/adapter": { diff --git a/tests/ember-data__request/package.json b/tests/ember-data__request/package.json index 9f9ffceb7db..1a8205249c0 100644 --- a/tests/ember-data__request/package.json +++ b/tests/ember-data__request/package.json @@ -18,7 +18,7 @@ "_build:production": "pnpm build:tests -e production", "test": "bun ./diagnostic.js", "_test:production": "bun ./diagnostic.js", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@warp-drive/diagnostic": { diff --git a/tests/ember-data__serializer/package.json b/tests/ember-data__serializer/package.json index 6530270ba23..42714479210 100644 --- a/tests/ember-data__serializer/package.json +++ b/tests/ember-data__serializer/package.json @@ -20,7 +20,7 @@ "lint:old": "eslint --config ../../.eslintrc.js --ignore-path ../../.eslintignore .", "start": "ember serve", "test": "ember test --test-port=0 --path=dist-test", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@ember-data/adapter": { diff --git a/tests/embroider-basic-compat/package.json b/tests/embroider-basic-compat/package.json index 607502cfd44..017e9c12c88 100644 --- a/tests/embroider-basic-compat/package.json +++ b/tests/embroider-basic-compat/package.json @@ -20,7 +20,7 @@ "lint:old": "eslint --config ../../.eslintrc.js --ignore-path ../../.eslintignore .", "start": "ember serve", "test:embroider": "ember test --test-port=0", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependencies": { "@ember/string": "3.1.1", diff --git a/tests/fastboot/package.json b/tests/fastboot/package.json index a8ac1eae974..f6821c96653 100644 --- a/tests/fastboot/package.json +++ b/tests/fastboot/package.json @@ -20,7 +20,7 @@ "lint:old": "eslint --config ../../.eslintrc.js --ignore-path ../../.eslintignore .", "start": "ember serve", "test:fastboot": "ember test --test-port=0", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependencies": { "@ember-data/unpublished-test-infra": "workspace:5.5.0-alpha.11", diff --git a/tests/full-data-asset-size-app/package.json b/tests/full-data-asset-size-app/package.json index 7afb726df18..e04b78883f6 100644 --- a/tests/full-data-asset-size-app/package.json +++ b/tests/full-data-asset-size-app/package.json @@ -17,7 +17,7 @@ "scripts": { "build": "ember build", "start": "ember serve", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "ember-data": { diff --git a/tests/main/package.json b/tests/main/package.json index 6658f27945c..83bc2ceb353 100644 --- a/tests/main/package.json +++ b/tests/main/package.json @@ -23,7 +23,7 @@ "start": "holodeck run launch:tests", "test": "holodeck run examine", "test:production": "holodeck run examine", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "author": "", "license": "MIT", @@ -78,6 +78,9 @@ }, "ember-inflector": { "injected": true + }, + "@ember-data/request-utils": { + "injected": true } }, "devDependencies": { diff --git a/tests/performance/package.json b/tests/performance/package.json index 224ea316da1..d6582d844d3 100644 --- a/tests/performance/package.json +++ b/tests/performance/package.json @@ -17,7 +17,7 @@ "scripts": { "build": "ember build", "start": "ember serve", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependencies": { "@ember/string": "3.1.1", diff --git a/tests/recommended-json-api/package.json b/tests/recommended-json-api/package.json index d94e6751052..5803f997c65 100644 --- a/tests/recommended-json-api/package.json +++ b/tests/recommended-json-api/package.json @@ -18,7 +18,7 @@ "build": "ember build", "start": "ember test --port=0 --serve --no-launch", "test:examples": "ember test --test-port=0", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@ember-data/json-api": { diff --git a/tests/warp-drive__schema-record/package.json b/tests/warp-drive__schema-record/package.json index 1f844f217e5..3c0fa2393c8 100644 --- a/tests/warp-drive__schema-record/package.json +++ b/tests/warp-drive__schema-record/package.json @@ -18,7 +18,7 @@ "build:tests": "IS_TESTING=true EMBER_CLI_TEST_COMMAND=true ember build --output-path=dist-test --suppress-sizes", "start": "ember test --port=0 --serve --no-launch", "test": "ember test --test-port=0 --path=dist-test", - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" }, "dependenciesMeta": { "@warp-drive/schema-record": { diff --git a/tests/warp-drive__schema/package.json b/tests/warp-drive__schema/package.json index b211e32cc1e..07b999571de 100644 --- a/tests/warp-drive__schema/package.json +++ b/tests/warp-drive__schema/package.json @@ -15,6 +15,6 @@ "pnpm-sync-dependencies-meta-injected": "0.0.10" }, "scripts": { - "_syncPnpm": "pnpm sync-dependencies-meta-injected" + "_syncPnpm": "bun run sync-dependencies-meta-injected" } }