Skip to content

Commit

Permalink
more addon conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Apr 13, 2024
1 parent 8409c77 commit f4f1c90
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 94 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const macros = require('@warp-drive/build-config/babel-macros');
import { macros } from '@warp-drive/build-config/babel-macros';

module.exports = {
export default {
plugins: [
...macros,
...macros(),
['@babel/plugin-transform-runtime', { loose: true }],
[
'@babel/plugin-transform-typescript',
Expand Down
8 changes: 0 additions & 8 deletions packages/active-record/babel.config.json

This file was deleted.

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

export default {
plugins: [
...macros(),
[
'@babel/plugin-transform-typescript',
{ allExtensions: true, onlyRemoveTypeImports: true, allowDeclareFields: true },
],
],
};
10 changes: 2 additions & 8 deletions packages/active-record/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
},
"scripts": {
"lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives",
"build:client": "rollup --config",
"_build": "bun run build:client",
"_build": "rollup --config",
"prepack": "bun run _build",
"_syncPnpm": "bun run sync-dependencies-meta-injected"
},
Expand All @@ -86,10 +85,7 @@
"version": 2
},
"devDependencies": {
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.4",
"@babel/plugin-proposal-decorators": "^7.24.1",
"@babel/plugin-transform-class-properties": "^7.24.1",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/plugin-transform-typescript": "^7.24.4",
"@babel/preset-env": "^7.24.4",
Expand All @@ -102,15 +98,13 @@
"@ember/string": "^3.1.1",
"@embroider/addon-dev": "^4.3.1",
"@glimmer/component": "^1.1.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"@warp-drive/core-types": "workspace:0.0.0-alpha.39",
"@warp-drive/internal-config": "workspace:5.4.0-alpha.53",
"ember-inflector": "^4.0.2",
"ember-source": "~5.7.0",
"rollup": "^4.14.1",
"rollup-plugin-ts": "^3.4.5",
"typescript": "^5.4.5",
"walk-sync": "^3.0.0",
"pnpm-sync-dependencies-meta-injected": "0.0.10"
},
"ember": {
Expand Down
13 changes: 7 additions & 6 deletions packages/active-record/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Addon } from '@embroider/addon-dev/rollup';
import babel from '@rollup/plugin-babel';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import ts from 'rollup-plugin-ts';
import babelConfig from './babel.config.mjs';

import { external } from '@warp-drive/internal-config/rollup/external.js';

Expand All @@ -21,10 +21,11 @@ export default {
// addon. Anything not listed here may get optimized away.
addon.publicEntrypoints(['request.js']),

nodeResolve({ extensions: ['.ts'] }),
babel({
extensions: ['.ts'],
babelHelpers: 'runtime', // we should consider "external",
ts({
transpiler: 'babel',
babelConfig,
// transpileOnly: true,
browserslist: false,
}),

// Remove leftover build artifacts when starting a new build.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const macros = require('@warp-drive/build-config/babel-macros');
import { macros } from '@warp-drive/build-config/babel-macros';

module.exports = {
export default {
plugins: [
...macros,
...macros(),
['@babel/plugin-transform-runtime', { loose: true }],
[
'@babel/plugin-transform-typescript',
Expand Down
10 changes: 3 additions & 7 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"directories": {},
"scripts": {
"lint": "eslint . --quiet --cache --cache-strategy=content --ext .js,.ts,.mjs,.cjs --report-unused-disable-directives",
"build:client": "rollup --config",
"_build": "bun run build:client",
"_build": "rollup --config",
"prepack": "bun run _build",
"_syncPnpm": "bun run sync-dependencies-meta-injected"
},
Expand Down Expand Up @@ -90,7 +89,6 @@
"ember-cli-test-info": "^1.0.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.4",
"@babel/plugin-transform-runtime": "^7.24.3",
"@babel/plugin-transform-typescript": "^7.24.4",
Expand All @@ -107,18 +105,16 @@
"@ember/string": "^3.1.1",
"@embroider/addon-dev": "^4.3.1",
"@glimmer/component": "^1.1.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"decorator-transforms": "1.1.0",
"@types/jquery": "^3.5.29",
"@warp-drive/core-types": "workspace:0.0.0-alpha.39",
"@warp-drive/internal-config": "workspace:5.4.0-alpha.53",
"@warp-drive/build-config": "workspace:0.0.0-alpha.1",
"ember-inflector": "^4.0.2",
"ember-source": "~5.7.0",
"rollup": "^4.14.1",
"rollup-plugin-ts": "^3.4.5",
"typescript": "^5.4.5",
"walk-sync": "^3.0.0",
"webpack": "^5.91.0",
"pnpm-sync-dependencies-meta-injected": "0.0.10"
},
"engines": {
Expand Down
13 changes: 7 additions & 6 deletions packages/adapter/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Addon } from '@embroider/addon-dev/rollup';
import babel from '@rollup/plugin-babel';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import ts from 'rollup-plugin-ts';
import babelConfig from './babel.config.mjs';

import { external } from '@warp-drive/internal-config/rollup/external.js';

Expand Down Expand Up @@ -29,10 +29,11 @@ export default {
// addon. Anything not listed here may get optimized away.
addon.publicEntrypoints(['index.js', 'error.js', 'json-api.js', 'rest.js', '-private.js']),

nodeResolve({ extensions: ['.ts', '.js'] }),
babel({
extensions: ['.ts', '.js'],
babelHelpers: 'runtime', // we should consider "external",
ts({
transpiler: 'babel',
babelConfig,
transpileOnly: true,
browserslist: false,
}),

// Remove leftover build artifacts when starting a new build.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
plugins: [['@babel/plugin-transform-typescript', { allowDeclareFields: true }]],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
import { macros } from '@warp-drive/build-config/babel-macros';

export default {
plugins: [
...macros(),
['@babel/plugin-transform-runtime', { loose: true }],
[
'@babel/plugin-transform-typescript',
Expand Down
8 changes: 0 additions & 8 deletions packages/request-utils/babel.config.json

This file was deleted.

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

export default {
plugins: [
...macros(),
[
'@babel/plugin-transform-typescript',
{ allExtensions: true, onlyRemoveTypeImports: true, allowDeclareFields: true },
],
],
};
8 changes: 0 additions & 8 deletions packages/rest/babel.config.json

This file was deleted.

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

export default {
plugins: [
...macros(),
[
'@babel/plugin-transform-typescript',
{ allExtensions: true, onlyRemoveTypeImports: true, allowDeclareFields: true },
],
],
};
46 changes: 11 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f4f1c90

Please sign in to comment.