Skip to content

Commit

Permalink
switch @embroider/router's build to use @rollup/plugin-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Jul 2, 2023
1 parent 326562b commit 3d9a7a0
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 176 deletions.
5 changes: 1 addition & 4 deletions packages/router/babel.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"presets": [["@babel/preset-typescript"]],
"plugins": [
"@embroider/addon-dev/template-colocation-plugin",
["@babel/plugin-proposal-decorators", { "legacy": true }],
"@babel/plugin-proposal-class-properties"
"@babel/plugin-transform-typescript",
]
}
10 changes: 4 additions & 6 deletions packages/router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
},
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/preset-typescript": "^7.18.6",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.17.0",
"@babel/plugin-syntax-decorators": "^7.17.0",
"@babel/plugin-transform-typescript": "^7.8.7",
"@embroider/addon-dev": "workspace:^",
"@embroider/macros": "workspace:*",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-typescript": "^11.1.2",
"@tsconfig/ember": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
Expand All @@ -54,8 +53,7 @@
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.5.1",
"rollup": "^3.23.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-ts": "^3.2.0",
"tslib": "^2.6.0",
"typescript": "^4.9.0"
},
"peerDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/router/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typescript from 'rollup-plugin-ts';
import copy from 'rollup-plugin-copy';
import typescript from '@rollup/plugin-typescript';
import { Addon } from '@embroider/addon-dev/rollup';
import { babel } from '@rollup/plugin-babel';

const addon = new Addon({
srcDir: 'src',
Expand All @@ -17,18 +17,18 @@ export default {
// addon. Anything not listed here may get optimized away.
addon.publicEntrypoints(['index.js']),

// Follow the V2 Addon rules about dependencies. Your code can import from
// Follow the V2 Addon rules about depecdndencies. Your code can import from
// `dependencies` and `peerDependencies` as well as standard Ember-provided
// package names.
addon.dependencies(),

// compile TypeScript to latest JavaScript, including Babel transpilation
typescript({
transpiler: 'babel',
browserslist: false,
transpileOnly: true,
noForceEmit: true,
}),

babel({ extensions: ['.ts'], babelHelpers: 'inline' }),

// Ensure that standalone .hbs files are properly integrated as Javascript.
addon.hbs(),

Expand Down
5 changes: 4 additions & 1 deletion packages/router/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extends": "@tsconfig/ember/tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"typeRoots": ["types"]
"typeRoots": ["types"],
"emitDeclarationOnly": true,
"noEmit": false,
"declarationDir": "dist"
}
}
Loading

0 comments on commit 3d9a7a0

Please sign in to comment.