diff --git a/tests/fixtures/ember-container-query-customizations/output/.gitignore b/tests/fixtures/ember-container-query-customizations/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/ember-container-query-customizations/output/.gitignore +++ b/tests/fixtures/ember-container-query-customizations/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.eslintignore b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.eslintignore +++ b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.gitignore b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.gitignore index 06aa141b..43cf961b 100644 --- a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.gitignore +++ b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/.gitignore @@ -1,34 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.DS_Store -/.sass-cache -/.eslintcache -/.stylelintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json index 75fc8bd6..9cba036a 100644 --- a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "glint --declaration", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -39,7 +41,9 @@ "lint:types": "glint", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "glint --declaration --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -86,21 +92,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/rollup.config.mjs b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/rollup.config.mjs index b10d9aac..cc2f7316 100644 --- a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/tsconfig.json b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/tsconfig.json index 7c5cc086..9471c288 100644 --- a/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/tsconfig.json +++ b/tests/fixtures/ember-container-query-customizations/output/packages/ember-container-query/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@tsconfig/ember/tsconfig.json", "compilerOptions": { + "declarationDir": "declarations", "skipLibCheck": true }, "include": [ diff --git a/tests/fixtures/ember-container-query-glint/output/.gitignore b/tests/fixtures/ember-container-query-glint/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/ember-container-query-glint/output/.gitignore +++ b/tests/fixtures/ember-container-query-glint/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-glint/output/ember-container-query/.eslintignore b/tests/fixtures/ember-container-query-glint/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/ember-container-query-glint/output/ember-container-query/.eslintignore +++ b/tests/fixtures/ember-container-query-glint/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/ember-container-query-glint/output/ember-container-query/.gitignore b/tests/fixtures/ember-container-query-glint/output/ember-container-query/.gitignore index 06aa141b..43cf961b 100644 --- a/tests/fixtures/ember-container-query-glint/output/ember-container-query/.gitignore +++ b/tests/fixtures/ember-container-query-glint/output/ember-container-query/.gitignore @@ -1,34 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.DS_Store -/.sass-cache -/.eslintcache -/.stylelintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-glint/output/ember-container-query/package.json b/tests/fixtures/ember-container-query-glint/output/ember-container-query/package.json index 75fc8bd6..9cba036a 100644 --- a/tests/fixtures/ember-container-query-glint/output/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-glint/output/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "glint --declaration", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -39,7 +41,9 @@ "lint:types": "glint", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "glint --declaration --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -86,21 +92,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/ember-container-query-glint/output/ember-container-query/rollup.config.mjs b/tests/fixtures/ember-container-query-glint/output/ember-container-query/rollup.config.mjs index b10d9aac..cc2f7316 100644 --- a/tests/fixtures/ember-container-query-glint/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/ember-container-query-glint/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/ember-container-query-glint/output/ember-container-query/tsconfig.json b/tests/fixtures/ember-container-query-glint/output/ember-container-query/tsconfig.json index 7c5cc086..9471c288 100644 --- a/tests/fixtures/ember-container-query-glint/output/ember-container-query/tsconfig.json +++ b/tests/fixtures/ember-container-query-glint/output/ember-container-query/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@tsconfig/ember/tsconfig.json", "compilerOptions": { + "declarationDir": "declarations", "skipLibCheck": true }, "include": [ diff --git a/tests/fixtures/ember-container-query-javascript/output/.gitignore b/tests/fixtures/ember-container-query-javascript/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/ember-container-query-javascript/output/.gitignore +++ b/tests/fixtures/ember-container-query-javascript/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.eslintignore b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.eslintignore +++ b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.gitignore b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.gitignore index 06aa141b..43cf961b 100644 --- a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.gitignore +++ b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/.gitignore @@ -1,34 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.DS_Store -/.sass-cache -/.eslintcache -/.stylelintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/package.json b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/package.json index 007fa96e..e01c285d 100644 --- a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/package.json @@ -66,6 +66,8 @@ "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", "rollup-plugin-copy": "^3.4.0" }, diff --git a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/rollup.config.mjs b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/rollup.config.mjs index feed3cbd..a40b4f5a 100644 --- a/tests/fixtures/ember-container-query-javascript/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/ember-container-query-javascript/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ +import { Addon } from '@embroider/addon-dev/rollup'; import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; import copy from 'rollup-plugin-copy'; -import { Addon } from '@embroider/addon-dev/rollup'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -35,6 +39,12 @@ export default { // babel.config.json. babel({ babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/ember-container-query-scoped/output/.gitignore b/tests/fixtures/ember-container-query-scoped/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/ember-container-query-scoped/output/.gitignore +++ b/tests/fixtures/ember-container-query-scoped/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.eslintignore b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.eslintignore +++ b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.gitignore b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.gitignore index 06aa141b..43cf961b 100644 --- a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.gitignore +++ b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/.gitignore @@ -1,34 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.DS_Store -/.sass-cache -/.eslintcache -/.stylelintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/package.json b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/package.json index b7cc3c9d..ef878a14 100644 --- a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "glint --declaration", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -39,7 +41,9 @@ "lint:types": "glint", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "glint --declaration --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -86,21 +92,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/rollup.config.mjs b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/rollup.config.mjs index b10d9aac..cc2f7316 100644 --- a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/tsconfig.json b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/tsconfig.json index 7c5cc086..9471c288 100644 --- a/tests/fixtures/ember-container-query-scoped/output/ember-container-query/tsconfig.json +++ b/tests/fixtures/ember-container-query-scoped/output/ember-container-query/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@tsconfig/ember/tsconfig.json", "compilerOptions": { + "declarationDir": "declarations", "skipLibCheck": true }, "include": [ diff --git a/tests/fixtures/ember-container-query-typescript/output/.gitignore b/tests/fixtures/ember-container-query-typescript/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/ember-container-query-typescript/output/.gitignore +++ b/tests/fixtures/ember-container-query-typescript/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.eslintignore b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.eslintignore +++ b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.gitignore b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.gitignore index 06aa141b..43cf961b 100644 --- a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.gitignore +++ b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/.gitignore @@ -1,34 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.DS_Store -/.sass-cache -/.eslintcache -/.stylelintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/package.json b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/package.json index 04afc7d2..294d522b 100644 --- a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/package.json +++ b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "tsc", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -36,10 +38,12 @@ "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache --ext=.js,.ts", "lint:js:fix": "eslint . --fix", - "lint:types": "tsc --noEmit", + "lint:types": "tsc --emitDeclarationOnly false --noEmit", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "tsc --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -86,21 +92,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/rollup.config.mjs b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/rollup.config.mjs index 83444b1b..dfe833b1 100644 --- a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/tsconfig.json b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/tsconfig.json index eb82074a..e0a155ac 100644 --- a/tests/fixtures/ember-container-query-typescript/output/ember-container-query/tsconfig.json +++ b/tests/fixtures/ember-container-query-typescript/output/ember-container-query/tsconfig.json @@ -1,6 +1,10 @@ { "extends": "@tsconfig/ember/tsconfig.json", "compilerOptions": { + "declaration": true, + "declarationDir": "declarations", + "emitDeclarationOnly": true, + "noEmit": false, "skipLibCheck": true }, "include": [ diff --git a/tests/fixtures/new-v1-addon-customizations/output/.gitignore b/tests/fixtures/new-v1-addon-customizations/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/.gitignore +++ b/tests/fixtures/new-v1-addon-customizations/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.eslintignore b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.eslintignore +++ b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.gitignore b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.gitignore index f1e859b2..43cf961b 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.gitignore +++ b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/.gitignore @@ -1,32 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/.eslintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json index c826579b..56d96107 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/package.json @@ -13,17 +13,21 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", + "build:types": "tsc", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"", "lint:hbs": "ember-template-lint .", "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", - "lint:types": "tsc --noEmit", + "lint:types": "tsc --emitDeclarationOnly false --noEmit", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "tsc --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "ember try:each" @@ -39,9 +43,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "peerDependencies": { "ember-source": "^3.28.0 || ^4.0.0" @@ -59,21 +65,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/rollup.config.mjs b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/rollup.config.mjs index 13eb49d7..cb37a24d 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/rollup.config.mjs +++ b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/tsconfig.json b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/tsconfig.json index a16a9c5a..491f8fda 100644 --- a/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/tsconfig.json +++ b/tests/fixtures/new-v1-addon-customizations/output/packages/new-v1-addon/tsconfig.json @@ -1,6 +1,11 @@ { "extends": "@tsconfig/ember/tsconfig.json", - "compilerOptions": {}, + "compilerOptions": { + "declaration": true, + "declarationDir": "declarations", + "emitDeclarationOnly": true, + "noEmit": false + }, "include": [ "src/**/*", "unpublished-development-types/**/*" diff --git a/tests/fixtures/new-v1-addon-javascript/output/.gitignore b/tests/fixtures/new-v1-addon-javascript/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/new-v1-addon-javascript/output/.gitignore +++ b/tests/fixtures/new-v1-addon-javascript/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.eslintignore b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.eslintignore +++ b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.gitignore b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.gitignore index f1e859b2..43cf961b 100644 --- a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.gitignore +++ b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/.gitignore @@ -1,32 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/.eslintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/package.json index 4e534a95..df969ed6 100644 --- a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/package.json @@ -36,6 +36,8 @@ "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", "rollup-plugin-copy": "^3.4.0" }, diff --git a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/rollup.config.mjs b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/rollup.config.mjs index bdd94422..ba009298 100644 --- a/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/rollup.config.mjs +++ b/tests/fixtures/new-v1-addon-javascript/output/new-v1-addon/rollup.config.mjs @@ -1,12 +1,16 @@ +import { Addon } from '@embroider/addon-dev/rollup'; import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; import copy from 'rollup-plugin-copy'; -import { Addon } from '@embroider/addon-dev/rollup'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -35,6 +39,12 @@ export default { // babel.config.json. babel({ babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/new-v1-addon-npm/output/.gitignore b/tests/fixtures/new-v1-addon-npm/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/new-v1-addon-npm/output/.gitignore +++ b/tests/fixtures/new-v1-addon-npm/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.eslintignore b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.eslintignore +++ b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.gitignore b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.gitignore index f1e859b2..43cf961b 100644 --- a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.gitignore +++ b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/.gitignore @@ -1,32 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/.eslintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/package.json index 4e534a95..df969ed6 100644 --- a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/package.json @@ -36,6 +36,8 @@ "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", "rollup-plugin-copy": "^3.4.0" }, diff --git a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/rollup.config.mjs b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/rollup.config.mjs index bdd94422..ba009298 100644 --- a/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/rollup.config.mjs +++ b/tests/fixtures/new-v1-addon-npm/output/new-v1-addon/rollup.config.mjs @@ -1,12 +1,16 @@ +import { Addon } from '@embroider/addon-dev/rollup'; import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; import copy from 'rollup-plugin-copy'; -import { Addon } from '@embroider/addon-dev/rollup'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -35,6 +39,12 @@ export default { // babel.config.json. babel({ babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/new-v1-addon-pnpm/output/.gitignore b/tests/fixtures/new-v1-addon-pnpm/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/new-v1-addon-pnpm/output/.gitignore +++ b/tests/fixtures/new-v1-addon-pnpm/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.eslintignore b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.eslintignore +++ b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.gitignore b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.gitignore index f1e859b2..43cf961b 100644 --- a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.gitignore +++ b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/.gitignore @@ -1,32 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/.eslintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/package.json index 4e534a95..df969ed6 100644 --- a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/package.json @@ -36,6 +36,8 @@ "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", "rollup-plugin-copy": "^3.4.0" }, diff --git a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/rollup.config.mjs b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/rollup.config.mjs index bdd94422..ba009298 100644 --- a/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/rollup.config.mjs +++ b/tests/fixtures/new-v1-addon-pnpm/output/new-v1-addon/rollup.config.mjs @@ -1,12 +1,16 @@ +import { Addon } from '@embroider/addon-dev/rollup'; import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; import copy from 'rollup-plugin-copy'; -import { Addon } from '@embroider/addon-dev/rollup'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -35,6 +39,12 @@ export default { // babel.config.json. babel({ babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/new-v1-addon-typescript/output/.gitignore b/tests/fixtures/new-v1-addon-typescript/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/new-v1-addon-typescript/output/.gitignore +++ b/tests/fixtures/new-v1-addon-typescript/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.eslintignore b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.eslintignore +++ b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.gitignore b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.gitignore index f1e859b2..43cf961b 100644 --- a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.gitignore +++ b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/.gitignore @@ -1,32 +1,12 @@ -# See https://help.github.com/ignore-files/ for more about ignoring files. +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md # compiled output +/declarations/ /dist/ -/tmp/ # dependencies -/bower_components/ /node_modules/ - -# misc -/.env* -/.pnp* -/.sass-cache -/.eslintcache -/connect.lock -/coverage/ -/libpeerconnection.log -/npm-debug.log* -/testem.log -/yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/bower.json.ember-try -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/package.json b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/package.json index c826579b..56d96107 100644 --- a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/package.json +++ b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/package.json @@ -13,17 +13,21 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", + "build:types": "tsc", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"", "lint:hbs": "ember-template-lint .", "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache", "lint:js:fix": "eslint . --fix", - "lint:types": "tsc --noEmit", + "lint:types": "tsc --emitDeclarationOnly false --noEmit", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "tsc --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "ember try:each" @@ -39,9 +43,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "peerDependencies": { "ember-source": "^3.28.0 || ^4.0.0" @@ -59,21 +65,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/rollup.config.mjs b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/rollup.config.mjs index 13eb49d7..cb37a24d 100644 --- a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/rollup.config.mjs +++ b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/tsconfig.json b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/tsconfig.json index a16a9c5a..491f8fda 100644 --- a/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/tsconfig.json +++ b/tests/fixtures/new-v1-addon-typescript/output/new-v1-addon/tsconfig.json @@ -1,6 +1,11 @@ { "extends": "@tsconfig/ember/tsconfig.json", - "compilerOptions": {}, + "compilerOptions": { + "declaration": true, + "declarationDir": "declarations", + "emitDeclarationOnly": true, + "noEmit": false + }, "include": [ "src/**/*", "unpublished-development-types/**/*" diff --git a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/.gitignore +++ b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.eslintignore b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.eslintignore +++ b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.gitignore new file mode 100644 index 00000000..43cf961b --- /dev/null +++ b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/.gitignore @@ -0,0 +1,12 @@ +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md + +# compiled output +/declarations/ +/dist/ + +# dependencies +/node_modules/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/rollup.config.mjs b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/rollup.config.mjs index b10d9aac..cc2f7316 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/unpublished-development-types/index.d.ts b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/unpublished-development-types/index.d.ts index e1d93ad4..b7d610a3 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/unpublished-development-types/index.d.ts +++ b/tests/fixtures/steps/create-files-from-blueprints/customizations/output/packages/ember-container-query/unpublished-development-types/index.d.ts @@ -1,2 +1,13 @@ // Add any types here that you need for local development only. // These will *not* be published as part of your addon, so be careful that your published code does not rely on them! + +import '@glint/environment-ember-loose'; + +declare module '@glint/environment-ember-loose/registry' { + // Remove this once entries have been added! 👇 + // eslint-disable-next-line @typescript-eslint/no-empty-interface + export default interface Registry { + // Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates) + // See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons + } +} diff --git a/tests/fixtures/steps/create-files-from-blueprints/glint/output/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/glint/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/glint/output/.gitignore +++ b/tests/fixtures/steps/create-files-from-blueprints/glint/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.eslintignore b/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.eslintignore +++ b/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.gitignore new file mode 100644 index 00000000..43cf961b --- /dev/null +++ b/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/.gitignore @@ -0,0 +1,12 @@ +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md + +# compiled output +/declarations/ +/dist/ + +# dependencies +/node_modules/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/rollup.config.mjs b/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/rollup.config.mjs index b10d9aac..cc2f7316 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/steps/create-files-from-blueprints/glint/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/.gitignore +++ b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.eslintignore b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.eslintignore +++ b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.gitignore new file mode 100644 index 00000000..43cf961b --- /dev/null +++ b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/.gitignore @@ -0,0 +1,12 @@ +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md + +# compiled output +/declarations/ +/dist/ + +# dependencies +/node_modules/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/rollup.config.mjs b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/rollup.config.mjs index feed3cbd..a40b4f5a 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/steps/create-files-from-blueprints/javascript/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ +import { Addon } from '@embroider/addon-dev/rollup'; import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; import copy from 'rollup-plugin-copy'; -import { Addon } from '@embroider/addon-dev/rollup'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -35,6 +39,12 @@ export default { // babel.config.json. babel({ babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/steps/create-files-from-blueprints/npm/output/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/npm/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/npm/output/.gitignore +++ b/tests/fixtures/steps/create-files-from-blueprints/npm/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.eslintignore b/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.eslintignore +++ b/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.gitignore new file mode 100644 index 00000000..43cf961b --- /dev/null +++ b/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/.gitignore @@ -0,0 +1,12 @@ +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md + +# compiled output +/declarations/ +/dist/ + +# dependencies +/node_modules/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/rollup.config.mjs b/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/rollup.config.mjs index 83444b1b..dfe833b1 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/steps/create-files-from-blueprints/npm/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/.gitignore +++ b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.eslintignore b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.eslintignore +++ b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.gitignore new file mode 100644 index 00000000..43cf961b --- /dev/null +++ b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/.gitignore @@ -0,0 +1,12 @@ +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md + +# compiled output +/declarations/ +/dist/ + +# dependencies +/node_modules/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/rollup.config.mjs b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/rollup.config.mjs index 83444b1b..dfe833b1 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/steps/create-files-from-blueprints/pnpm/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/.gitignore +++ b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.eslintignore b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.eslintignore +++ b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.gitignore new file mode 100644 index 00000000..43cf961b --- /dev/null +++ b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/.gitignore @@ -0,0 +1,12 @@ +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md + +# compiled output +/declarations/ +/dist/ + +# dependencies +/node_modules/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/rollup.config.mjs b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/rollup.config.mjs index b10d9aac..cc2f7316 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/steps/create-files-from-blueprints/scoped/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/.gitignore index 2f6fd049..e622ec28 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/.gitignore +++ b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/.gitignore @@ -1,24 +1,11 @@ # compiled output -/dist/ +dist/ # dependencies -/node_modules/ +node_modules/ # misc /.env* -/.pnp* -/.eslintcache -/coverage/ +/.pnpm-debug.log /npm-debug.log* -/testem.log /yarn-error.log - -# ember-try -/.node_modules.ember-try/ -/npm-shrinkwrap.json.ember-try -/package.json.ember-try -/package-lock.json.ember-try -/yarn.lock.ember-try - -# broccoli-debug -/DEBUG/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.eslintignore b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.eslintignore index e69140be..b0381f9e 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.eslintignore +++ b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.gitignore b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.gitignore new file mode 100644 index 00000000..43cf961b --- /dev/null +++ b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/.gitignore @@ -0,0 +1,12 @@ +# The authoritative copies of these live in the monorepo root (because they're +# more useful on github that way), but the build copies them into here so they +# will also appear in published NPM packages. +/LICENSE.md +/README.md + +# compiled output +/declarations/ +/dist/ + +# dependencies +/node_modules/ diff --git a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/rollup.config.mjs b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/rollup.config.mjs index 83444b1b..dfe833b1 100644 --- a/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/rollup.config.mjs +++ b/tests/fixtures/steps/create-files-from-blueprints/typescript/output/ember-container-query/rollup.config.mjs @@ -1,12 +1,16 @@ -import typescript from 'rollup-plugin-ts'; -import copy from 'rollup-plugin-copy'; import { Addon } from '@embroider/addon-dev/rollup'; +import { babel } from '@rollup/plugin-babel'; +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import copy from 'rollup-plugin-copy'; const addon = new Addon({ srcDir: 'src', destDir: 'dist', }); +// Add extensions here, such as ts, gjs, etc that you may import +const extensions = ['.js', '.ts']; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,11 +31,20 @@ export default { // package names. addon.dependencies(), - // compile TypeScript to latest JavaScript, including Babel transpilation - 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. + // + // By default, this will load the actual babel config from the file + // babel.config.json. + babel({ + babelHelpers: 'bundled', + extensions, + }), + + // Allows rollup to resolve imports of files with the specified extensions + nodeResolve({ + extensions, }), // Ensure that standalone .hbs files are properly integrated as Javascript. diff --git a/tests/fixtures/steps/update-addon-package-json/customizations/input/packages/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/customizations/input/packages/ember-container-query/package.json index d0f35cf8..f92d327f 100644 --- a/tests/fixtures/steps/update-addon-package-json/customizations/input/packages/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/customizations/input/packages/ember-container-query/package.json @@ -36,7 +36,7 @@ "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache --ext=.js,.ts", "lint:js:fix": "eslint . --fix", - "lint:types": "tsc --noEmit", + "lint:types": "glint", "prepack": "ember ts:precompile", "postpack": "ember ts:clean", "start": "ember serve", @@ -67,8 +67,12 @@ "@ember/optional-features": "^2.0.0", "@ember/test-helpers": "^2.9.3", "@embroider/test-setup": "^2.0.2", + "@gavant/glint-template-types": "^0.3.0", "@glimmer/component": "^1.1.2", "@glimmer/tracking": "^1.1.2", + "@glint/core": "^v1.0.0-beta.2", + "@glint/environment-ember-loose": "^v1.0.0-beta.2", + "@glint/template": "^v1.0.0-beta.2", "@percy/cli": "^1.16.0", "@percy/ember": "^4.0.0", "@tsconfig/ember": "^2.0.0", diff --git a/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json index 04afc7d2..9cba036a 100644 --- a/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/customizations/output/packages/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "glint --declaration", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -36,10 +38,12 @@ "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache --ext=.js,.ts", "lint:js:fix": "eslint . --fix", - "lint:types": "tsc --noEmit", + "lint:types": "glint", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "glint --declaration --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -86,21 +92,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/steps/update-addon-package-json/glint/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/glint/output/ember-container-query/package.json index 75fc8bd6..9cba036a 100644 --- a/tests/fixtures/steps/update-addon-package-json/glint/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/glint/output/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "glint --declaration", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -39,7 +41,9 @@ "lint:types": "glint", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "glint --declaration --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -86,21 +92,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/steps/update-addon-package-json/javascript/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/javascript/output/ember-container-query/package.json index 007fa96e..e01c285d 100644 --- a/tests/fixtures/steps/update-addon-package-json/javascript/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/javascript/output/ember-container-query/package.json @@ -66,6 +66,8 @@ "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", "rollup-plugin-copy": "^3.4.0" }, diff --git a/tests/fixtures/steps/update-addon-package-json/public-assets/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/public-assets/output/ember-container-query/package.json index 0d02dbd4..712a0fb2 100644 --- a/tests/fixtures/steps/update-addon-package-json/public-assets/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/public-assets/output/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "tsc", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -36,10 +38,12 @@ "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache --ext=.js,.ts", "lint:js:fix": "eslint . --fix", - "lint:types": "tsc --noEmit", + "lint:types": "tsc --emitDeclarationOnly false --noEmit", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "tsc --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -90,22 +96,26 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist", "public" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/steps/update-addon-package-json/scoped/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/scoped/output/ember-container-query/package.json index b7cc3c9d..ef878a14 100644 --- a/tests/fixtures/steps/update-addon-package-json/scoped/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/scoped/output/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "glint --declaration", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -39,7 +41,9 @@ "lint:types": "glint", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "glint --declaration --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -86,21 +92,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/steps/update-addon-package-json/typescript/output/ember-container-query/package.json b/tests/fixtures/steps/update-addon-package-json/typescript/output/ember-container-query/package.json index 04afc7d2..294d522b 100644 --- a/tests/fixtures/steps/update-addon-package-json/typescript/output/ember-container-query/package.json +++ b/tests/fixtures/steps/update-addon-package-json/typescript/output/ember-container-query/package.json @@ -24,8 +24,10 @@ "test": "tests" }, "scripts": { - "build": "rollup --config", + "build": "concurrently \"npm:build:*\" --names \"build:\"", + "build:js": "rollup --config", "build:test": "ember build --environment=test", + "build:types": "tsc", "changelog": "lerna-changelog", "lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"", "lint:css": "stylelint \"tests/dummy/app/**/*.css\" --cache", @@ -36,10 +38,12 @@ "lint:hbs:fix": "ember-template-lint . --fix", "lint:js": "eslint . --cache --ext=.js,.ts", "lint:js:fix": "eslint . --fix", - "lint:types": "tsc --noEmit", + "lint:types": "tsc --emitDeclarationOnly false --noEmit", "postpack": "ember ts:clean", "prepack": "rollup --config", - "start": "rollup --config --watch", + "start": "concurrently \"npm:start:*\" --names \"start:\"", + "start:js": "rollup --config --watch --no-watch.clearScreen", + "start:types": "tsc --watch", "test": "echo 'A v2 addon does not have tests, run tests in test-app'", "test:ember": "ember test", "test:ember-compatibility": "./node_modules/.bin/ember try:one" @@ -69,9 +73,11 @@ "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", "@embroider/addon-dev": "^3.1.1", + "@rollup/plugin-babel": "^6.0.3", + "@rollup/plugin-node-resolve": "^15.1.0", + "concurrently": "^7.6.0", "rollup": "^3.26.0", - "rollup-plugin-copy": "^3.4.0", - "rollup-plugin-ts": "^3.2.0" + "rollup-plugin-copy": "^3.4.0" }, "engines": { "node": "14.* || 16.* || >= 18" @@ -86,21 +92,25 @@ "version": 2 }, "exports": { - ".": "./dist/index.js", + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, "./*": { - "types": "./dist/*.d.ts", + "types": "./declarations/*.d.ts", "default": "./dist/*.js" }, "./addon-main.js": "./addon-main.cjs" }, "files": [ "addon-main.cjs", + "declarations", "dist" ], "typesVersions": { "*": { "*": [ - "dist/*" + "declarations/*" ] } } diff --git a/tests/fixtures/steps/update-addon-tsconfig-json/customizations/output/packages/ember-container-query/tsconfig.json b/tests/fixtures/steps/update-addon-tsconfig-json/customizations/output/packages/ember-container-query/tsconfig.json index eb82074a..7e5b05d1 100644 --- a/tests/fixtures/steps/update-addon-tsconfig-json/customizations/output/packages/ember-container-query/tsconfig.json +++ b/tests/fixtures/steps/update-addon-tsconfig-json/customizations/output/packages/ember-container-query/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@tsconfig/ember/tsconfig.json", "compilerOptions": { + "declarationDir": "declarations", "skipLibCheck": true }, "include": [ diff --git a/tests/fixtures/steps/update-addon-tsconfig-json/glint/output/ember-container-query/tsconfig.json b/tests/fixtures/steps/update-addon-tsconfig-json/glint/output/ember-container-query/tsconfig.json index 7c5cc086..9471c288 100644 --- a/tests/fixtures/steps/update-addon-tsconfig-json/glint/output/ember-container-query/tsconfig.json +++ b/tests/fixtures/steps/update-addon-tsconfig-json/glint/output/ember-container-query/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@tsconfig/ember/tsconfig.json", "compilerOptions": { + "declarationDir": "declarations", "skipLibCheck": true }, "include": [ diff --git a/tests/fixtures/steps/update-addon-tsconfig-json/scoped/output/ember-container-query/tsconfig.json b/tests/fixtures/steps/update-addon-tsconfig-json/scoped/output/ember-container-query/tsconfig.json index 7c5cc086..9471c288 100644 --- a/tests/fixtures/steps/update-addon-tsconfig-json/scoped/output/ember-container-query/tsconfig.json +++ b/tests/fixtures/steps/update-addon-tsconfig-json/scoped/output/ember-container-query/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@tsconfig/ember/tsconfig.json", "compilerOptions": { + "declarationDir": "declarations", "skipLibCheck": true }, "include": [ diff --git a/tests/fixtures/steps/update-addon-tsconfig-json/typescript/output/ember-container-query/tsconfig.json b/tests/fixtures/steps/update-addon-tsconfig-json/typescript/output/ember-container-query/tsconfig.json index eb82074a..e0a155ac 100644 --- a/tests/fixtures/steps/update-addon-tsconfig-json/typescript/output/ember-container-query/tsconfig.json +++ b/tests/fixtures/steps/update-addon-tsconfig-json/typescript/output/ember-container-query/tsconfig.json @@ -1,6 +1,10 @@ { "extends": "@tsconfig/ember/tsconfig.json", "compilerOptions": { + "declaration": true, + "declarationDir": "declarations", + "emitDeclarationOnly": true, + "noEmit": false, "skipLibCheck": true }, "include": [ diff --git a/tests/helpers/shared-test-setups/customizations.ts b/tests/helpers/shared-test-setups/customizations.ts index 334914e4..3ae7c4e8 100644 --- a/tests/helpers/shared-test-setups/customizations.ts +++ b/tests/helpers/shared-test-setups/customizations.ts @@ -147,7 +147,7 @@ const options: Options = { ['typescript', '^4.9.4'], ['webpack', '^5.75.0'], ]), - hasGlint: false, + hasGlint: true, hasTypeScript: true, isV1Addon: true, name: 'ember-container-query',