Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use babel to do TS transformation instead of TSC to use babel legacy decorators #1

Merged
merged 2 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/ember-fast-marquee/babel.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"presets": [["@babel/preset-typescript"]],
"plugins": ["@embroider/addon-dev/template-colocation-plugin"]
"presets": [["@babel/preset-env"], ["@babel/preset-typescript"]],
"plugins": [
"@embroider/addon-dev/template-colocation-plugin",
["@babel/plugin-proposal-decorators", { "legacy": true }]
]
}
9 changes: 6 additions & 3 deletions packages/ember-fast-marquee/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
"dist"
],
"scripts": {
"build": "rollup --config",
"build": "rollup --config && tsc --emitDeclarationOnly ",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
"lint:hbs:fix": "ember-template-lint . --fix",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"start": "rollup --config --watch",
"start": "npm-run-all --aggregate-output --continue-on-error --parallel \"start:*\"",
"start:rollUpWatch": "rollup --config --watch",
"start:tscEmit": "tsc --emitDeclarationOnly --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'",
"prepare": "yarn build"
},
Expand All @@ -31,8 +33,9 @@
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.17.0",
"@babel/plugin-proposal-decorators": "^7.17.12",
"@babel/plugin-syntax-decorators": "^7.17.0",
"@babel/preset-env": "^7.18.0",
"@babel/preset-typescript": "^7.17.12",
"@embroider/addon-dev": "^1.0.0",
"@rollup/plugin-babel": "^5.3.0",
Expand Down
20 changes: 12 additions & 8 deletions packages/ember-fast-marquee/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import babel from '@rollup/plugin-babel';
import typescript from 'rollup-plugin-ts';
// import typescript from 'rollup-plugin-ts';
import autoprefixer from 'autoprefixer';
import postcss from 'rollup-plugin-postcss';
import { Addon } from '@embroider/addon-dev/rollup';
Expand Down Expand Up @@ -36,6 +36,13 @@ export default {
'modifiers/register-cleanup.js',
]),

// // compile TypeScript
// typescript({
// transpiler: 'babel',
// browserslist: false,
// transpileOnly: false,
// }),

// This babel config should *not* apply presets or compile away ES modules.
// It exists only to provide development niceties for you, like automatic
// template colocation.
Expand All @@ -44,13 +51,8 @@ export default {
// babel.config.json.
babel({
babelHelpers: 'bundled',
}),

// compile TypeScript
typescript({
transpiler: 'babel',
browserslist: false,
transpileOnly: false,
extensions: ['.js', '.ts'],
include: ['src/**/*'],
}),

// Follow the V2 Addon rules about dependencies. Your code can import from
Expand All @@ -61,6 +63,8 @@ export default {
// Ensure that standalone .hbs files are properly integrated as Javascript.
addon.hbs(),

addon.keepAssets(['**/*.d.ts']),

// Remove leftover build artifacts when starting a new build.
addon.clean(),
],
Expand Down
3 changes: 2 additions & 1 deletion packages/ember-fast-marquee/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"moduleResolution": "node",
"experimentalDecorators": true,
"strict": true,
"declaration": true
"declaration": true,
"outDir": "dist"
},
"include": ["src/**/*"]
}
52 changes: 6 additions & 46 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
"@babel/helper-plugin-utils" "^7.17.12"
"@babel/plugin-syntax-class-static-block" "^7.14.5"

"@babel/plugin-proposal-decorators@^7.13.5", "@babel/plugin-proposal-decorators@^7.16.7", "@babel/plugin-proposal-decorators@^7.17.0":
"@babel/plugin-proposal-decorators@^7.13.5", "@babel/plugin-proposal-decorators@^7.16.7", "@babel/plugin-proposal-decorators@^7.17.12":
version "7.17.12"
resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.17.12.tgz#26a6a605f271a6703abf97f8fafd1368834c131c"
integrity sha512-gL0qSSeIk/VRfTDgtQg/EtejENssN/r3p5gJsPie1UacwiHibprpr19Z0pcK3XKuqQvjGVxsQ37Tl1MGfXzonA==
Expand Down Expand Up @@ -845,7 +845,7 @@
core-js "^2.6.5"
regenerator-runtime "^0.13.4"

"@babel/preset-env@^7.10.2", "@babel/preset-env@^7.16.5", "@babel/preset-env@^7.16.7":
"@babel/preset-env@^7.10.2", "@babel/preset-env@^7.16.5", "@babel/preset-env@^7.16.7", "@babel/preset-env@^7.18.0":
version "7.18.0"
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.18.0.tgz#ec7e51f4c6e026816000b230ed7cf74a1530d91d"
integrity sha512-cP74OMs7ECLPeG1reiCQ/D/ypyOxgfm8uR6HRYV23vTJ7Lu1nbgj9DQDo/vH59gnn7GOAwtTDPPYV4aXzsMKHA==
Expand Down Expand Up @@ -1269,7 +1269,7 @@
minimatch "^3.0.4"
strip-json-comments "^3.1.1"

"@glimmer/component@^1.0.4", "@glimmer/component@^1.1.2":
"@glimmer/component@^1.0.4":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@glimmer/component/-/component-1.1.2.tgz#892ec0c9f0b6b3e41c112be502fde073cf24d17c"
integrity sha512-XyAsEEa4kWOPy+gIdMjJ8XlzA3qrGH55ZDv6nA16ibalCR17k74BI0CztxuRds+Rm6CtbUVgheCVlcCULuqD7A==
Expand Down Expand Up @@ -1334,7 +1334,7 @@
"@handlebars/parser" "~2.0.0"
simple-html-tokenizer "^0.5.11"

"@glimmer/tracking@^1.0.4", "@glimmer/tracking@^1.1.2":
"@glimmer/tracking@^1.0.4":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@glimmer/tracking/-/tracking-1.1.2.tgz#74e71be07b0a7066518d24044d2665d0cf8281eb"
integrity sha512-cyV32zsHh+CnftuRX84ALZpd2rpbDrhLhJnTXn9W//QpqdRZ5rdMsxSY9fOsj0CKEc706tmEU299oNnDc0d7tA==
Expand Down Expand Up @@ -5275,7 +5275,7 @@ ember-auto-import@^1.11.3:
walk-sync "^0.3.3"
webpack "^4.43.0"

ember-auto-import@^2.2.0, ember-auto-import@^2.2.4, ember-auto-import@^2.4.0, ember-auto-import@^2.4.1:
ember-auto-import@^2.2.0, ember-auto-import@^2.2.4, ember-auto-import@^2.4.1:
version "2.4.2"
resolved "https://registry.yarnpkg.com/ember-auto-import/-/ember-auto-import-2.4.2.tgz#d4d3bc6885a11cf124f606f5c37169bdf76e37ae"
integrity sha512-REh+1aJWpTkvN42a/ga41OuRpUsSW7UQfPr2wPtYx56o/xoSNhVBXejy7yV9ObrkN7gogz6fs2xZwih5cOwpYg==
Expand Down Expand Up @@ -5512,14 +5512,6 @@ ember-cli-test-loader@^3.0.0:
dependencies:
ember-cli-babel "^7.13.2"

ember-cli-typescript-blueprint-polyfill@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/ember-cli-typescript-blueprint-polyfill/-/ember-cli-typescript-blueprint-polyfill-0.1.0.tgz#5917646a996b452a3a6b3f306ab2a27e93ea2cc2"
integrity sha512-g0weUTOnHmPGqVZzkQTl3Nbk9fzEdFkEXydCs5mT1qBjXh8eQ6VlmjjGD5/998UXKuA0pLSCVVMbSp/linLzGA==
dependencies:
chalk "^4.0.0"
remove-types "^1.0.0"

[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ember-cli-typescript/-/ember-cli-typescript-3.0.0.tgz#3b838d1ce9e4d22a98e68da22ceac6dc0cfd9bfc"
Expand Down Expand Up @@ -5858,38 +5850,6 @@ ember-source-channel-url@^3.0.0:
dependencies:
node-fetch "^2.6.0"

ember-source@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-4.4.0.tgz#c2fbabcda11a00c8cbc890ef1ba5a565c2ceeebe"
integrity sha512-o4jJko/2IRfGsyfje51nNYMQj+OusJph4CIGF+Yk9pmvoS0TbzKHKWlnFiIygTcnUiMHkG18FL9Z0LSd/Kgl5w==
dependencies:
"@babel/helper-module-imports" "^7.16.7"
"@babel/plugin-transform-block-scoping" "^7.16.0"
"@ember/edition-utils" "^1.2.0"
"@glimmer/vm-babel-plugins" "0.83.1"
babel-plugin-debug-macros "^0.3.4"
babel-plugin-filter-imports "^4.0.0"
broccoli-concat "^4.2.5"
broccoli-debug "^0.6.4"
broccoli-file-creator "^2.1.1"
broccoli-funnel "^3.0.8"
broccoli-merge-trees "^4.2.0"
chalk "^4.0.0"
ember-auto-import "^2.4.0"
ember-cli-babel "^7.26.11"
ember-cli-get-component-path-option "^1.0.0"
ember-cli-is-package-missing "^1.0.0"
ember-cli-normalize-entity-name "^1.0.0"
ember-cli-path-utils "^1.0.0"
ember-cli-string-utils "^1.1.0"
ember-cli-typescript-blueprint-polyfill "^0.1.0"
ember-cli-version-checker "^5.1.2"
ember-router-generator "^2.0.0"
inflection "^1.13.2"
resolve "^1.22.0"
semver "^7.3.4"
silent-error "^1.1.1"

ember-source@~4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-4.3.0.tgz#f89bb2e223bebe1d22f6f16130d4b46be60e1d4f"
Expand Down Expand Up @@ -7915,7 +7875,7 @@ infer-owner@^1.0.3, infer-owner@^1.0.4:
resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467"
integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==

inflection@^1.13.1, inflection@^1.13.2, inflection@~1.13.1:
inflection@^1.13.1, inflection@~1.13.1:
version "1.13.2"
resolved "https://registry.yarnpkg.com/inflection/-/inflection-1.13.2.tgz#15e8c797c6c3dadf31aa658f8df8a4ea024798b0"
integrity sha512-cmZlljCRTBFouT8UzMzrGcVEvkv6D/wBdcdKG7J1QH5cXjtU75Dm+P27v9EKu/Y43UYyCJd1WC4zLebRrC8NBw==
Expand Down