Skip to content

Commit

Permalink
more progress
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Apr 13, 2024
1 parent a0add4e commit 8409c77
Show file tree
Hide file tree
Showing 66 changed files with 192 additions and 888 deletions.
2 changes: 1 addition & 1 deletion packages/-ember-data/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { external } from '@warp-drive/internal-config/rollup/external.js';

const addon = new Addon({
srcDir: 'src',
destDir: 'addon',
destDir: 'dist',
});

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/-ember-data/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// but causes us to not rebuild properly
"composite": true,
"incremental": true,
"rootDir": "addon",
"rootDir": "src",

"declaration": true,
"declarationMap": true,
Expand All @@ -31,7 +31,7 @@
"types": ["ember-source/types"],

"paths": {
"ember-data/version": ["./addon/version.d.ts"],
"ember-data/version": ["./dist/version.ts"],
"@ember-data/deprecations": ["../build-config/src/virtual/deprecations.ts"],
"@ember-data/canary-features": ["../build-config/src/virtual/canary-features.ts"],
"@ember-data/debugging": ["../build-config/src/virtual/debugging.ts"],
Expand Down
7 changes: 3 additions & 4 deletions packages/active-record/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"files": [
"addon-main.cjs",
"addon",
"dist",
"README.md",
"LICENSE.md",
"ember-data-logo-dark.svg",
Expand All @@ -70,14 +70,13 @@
"exports": {
"./*": {
"types": "./unstable-preview-types/*.d.ts",
"default": "./addon/*.js"
"default": "./dist/*.js"
}
},
"scripts": {
"lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives",
"build:types": "tsc --build",
"build:client": "rollup --config",
"_build": "bun run build:client && bun run build:types",
"_build": "bun run build:client",
"prepack": "bun run _build",
"_syncPnpm": "bun run sync-dependencies-meta-injected"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/active-record/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { external } from '@warp-drive/internal-config/rollup/external.js';

const addon = new Addon({
srcDir: 'src',
destDir: 'addon',
destDir: 'dist',
});

export default {
Expand Down
6 changes: 3 additions & 3 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"unstable-preview-types",
"blueprints",
"addon-main.cjs",
"addon",
"dist",
"README.md",
"LICENSE.md",
"ember-data-logo-dark.svg",
Expand All @@ -38,11 +38,11 @@
"exports": {
".": {
"types": "./unstable-preview-types/index.d.ts",
"default": "./addon/index.js"
"default": "./dist/index.js"
},
"./*": {
"types": "./unstable-preview-types/*.d.ts",
"default": "./addon/*.js"
"default": "./dist/*.js"
}
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { external } from '@warp-drive/internal-config/rollup/external.js';

const addon = new Addon({
srcDir: 'src',
destDir: 'addon',
destDir: 'dist',
});

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/core-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
"exports": {
".": {
"types": "./unstable-preview-types/index.d.ts",
"default": "./addon/index.js"
"default": "./dist/index.js"
},
"./*": {
"types": "./unstable-preview-types/*.d.ts",
"default": "./addon/*.js"
"default": "./dist/*.js"
}
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
"node": ">= 18.20.1"
},
"ember-addon": {
"main": "index.js",
"type": "addon",
"version": 1
"main": "addon-main.cjs",
"type": "dist",
"version": 2
},
"volta": {
"extends": "../../package.json"
Expand Down
9 changes: 4 additions & 5 deletions packages/ember/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@
],
"scripts": {
"lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives",
"build:types": "glint --build",
"check:types": "glint",
"build:client": "rollup --config",
"_build": "bun run build:client && bun run build:types",
"_build": "bun run build:client",
"prepack": "bun run _build",
"_syncPnpm": "bun run sync-dependencies-meta-injected"
},
"files": [
"unstable-preview-types",
"addon-main.cjs",
"addon",
"dist",
"README.md",
"LICENSE.md",
"ember-data-logo-dark.svg",
Expand All @@ -35,11 +34,11 @@
"exports": {
".": {
"types": "./unstable-preview-types/index.d.ts",
"default": "./addon/index.js"
"default": "./dist/index.js"
},
"./*": {
"types": "./unstable-preview-types/*.d.ts",
"default": "./addon/*.js"
"default": "./dist/*.js"
}
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ember/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { external } from '@warp-drive/internal-config/rollup/external.js';

const addon = new Addon({
srcDir: 'src',
destDir: 'addon',
destDir: 'dist',
});

export default {
Expand Down
75 changes: 3 additions & 72 deletions packages/graph/addon-main.cjs
Original file line number Diff line number Diff line change
@@ -1,74 +1,5 @@
const getEnv = require('@ember-data/private-build-infra/src/utilities/get-env');
'use strict';

const pkg = require('./package.json');
const { addonV1Shim } = require('@embroider/addon-shim');

module.exports = {
name: pkg.name,

options: {
'@embroider/macros': {
setOwnConfig: {},
},
},

_emberDataConfig: null,
configureEmberData() {
if (this._emberDataConfig) {
return this._emberDataConfig;
}
const app = this._findHost();
const isProd = /production/.test(process.env.EMBER_ENV);
const hostOptions = app.options?.emberData || {};
const debugOptions = Object.assign(
{
LOG_PAYLOADS: false,
LOG_OPERATIONS: false,
LOG_MUTATIONS: false,
LOG_NOTIFICATIONS: false,
LOG_REQUESTS: false,
LOG_REQUEST_STATUS: false,
LOG_IDENTIFIERS: false,
LOG_GRAPH: false,
LOG_INSTANCE_CACHE: false,
},
hostOptions.debug || {}
);

const DEPRECATIONS = require('@ember-data/private-build-infra/src/deprecations')(hostOptions.compatWith || null);
const FEATURES = require('@ember-data/private-build-infra/src/features')(isProd);

// copy configs forward
const ownConfig = this.options['@embroider/macros'].setOwnConfig;
ownConfig.polyfillUUID = hostOptions.polyfillUUID ?? false;
ownConfig.compatWith = hostOptions.compatWith || null;
ownConfig.debug = debugOptions;
ownConfig.deprecations = Object.assign(DEPRECATIONS, ownConfig.deprecations || {}, hostOptions.deprecations || {});
ownConfig.features = Object.assign({}, FEATURES);
// ownConfig.includeDataAdapter = includeDataAdapter;
ownConfig.env = getEnv(ownConfig);

this._emberDataConfig = ownConfig;
return ownConfig;
},

included() {
this.configureEmberData();
return this._super.included.call(this, ...arguments);
},

treeForVendor() {
return;
},
treeForPublic() {
return;
},
treeForStyles() {
return;
},
treeForAddonStyles() {
return;
},
treeForApp() {
return;
},
};
module.exports = addonV1Shim(__dirname);
13 changes: 0 additions & 13 deletions packages/graph/babel.config.js

This file was deleted.

5 changes: 5 additions & 0 deletions packages/graph/babel.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { macros } from '@warp-drive/build-config/babel-macros';

export default {
plugins: [...macros(), ['@babel/plugin-transform-typescript', { allowDeclareFields: true }]],
};
11 changes: 5 additions & 6 deletions packages/graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@
"author": "Chris Thoburn <runspired@users.noreply.github.com>",
"scripts": {
"lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives",
"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": "bun run build:client && bun run build:types",
"build:client": "rollup --config",
"_build": "bun run build:client",
"prepack": "bun run _build",
"_syncPnpm": "bun run sync-dependencies-meta-injected"
},
"files": [
"unstable-preview-types",
"addon-main.cjs",
"addon",
"dist",
"README.md",
"LICENSE.md",
"ember-data-logo-dark.svg",
Expand All @@ -32,11 +31,11 @@
"exports": {
".": {
"types": "./unstable-preview-types/index.d.ts",
"default": "./addon/index.js"
"default": "./dist/index.js"
},
"./*": {
"types": "./unstable-preview-types/*.d.ts",
"default": "./addon/*.js"
"default": "./dist/*.js"
}
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/graph/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { external } from '@warp-drive/internal-config/rollup/external.js';

const addon = new Addon({
srcDir: 'src',
destDir: 'addon',
destDir: 'dist',
});

export default {
Expand Down
5 changes: 5 additions & 0 deletions packages/json-api/addon-main.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

const { addonV1Shim } = require('@embroider/addon-shim');

module.exports = addonV1Shim(__dirname);
74 changes: 0 additions & 74 deletions packages/json-api/addon-main.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/json-api/babel.config.js

This file was deleted.

Loading

0 comments on commit 8409c77

Please sign in to comment.