diff --git a/src/blueprints/ember-addon/__addonLocation__/.eslintignore b/src/blueprints/ember-addon/__addonLocation__/.eslintignore index e69140be..b0381f9e 100644 --- a/src/blueprints/ember-addon/__addonLocation__/.eslintignore +++ b/src/blueprints/ember-addon/__addonLocation__/.eslintignore @@ -2,6 +2,7 @@ /blueprints/*/files/ # compiled output +/declarations/ /dist/ # misc diff --git a/src/blueprints/ember-addon/__addonLocation__/__gitignore__ b/src/blueprints/ember-addon/__addonLocation__/__gitignore__ new file mode 100644 index 00000000..43cf961b --- /dev/null +++ b/src/blueprints/ember-addon/__addonLocation__/__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/src/blueprints/ember-addon/__addonLocation__/rollup.config.mjs b/src/blueprints/ember-addon/__addonLocation__/rollup.config.mjs index 14fbf03e..9ff7c91c 100644 --- a/src/blueprints/ember-addon/__addonLocation__/rollup.config.mjs +++ b/src/blueprints/ember-addon/__addonLocation__/rollup.config.mjs @@ -1,12 +1,16 @@ -<% if (options.packages.addon.hasTypeScript) { %>import typescript from 'rollup-plugin-ts';<% } else { %>import { babel } from '@rollup/plugin-babel';<% } %> -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'<% if (options.packages.addon.hasTypeScript) { %>, '.ts'<% } %>]; + export default { // This provides defaults that work well alongside `publicEntrypoints` below. // You can augment this if you need to. @@ -27,13 +31,7 @@ export default { // package names. addon.dependencies(), -<% if (options.packages.addon.hasTypeScript) { %> // compile TypeScript to latest JavaScript, including Babel transpilation - typescript({ - transpiler: 'babel', - browserslist: false, - transpileOnly: false, - }), -<% } else { %> // This babel config should *not* apply presets or compile away ES modules. + // 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. // @@ -41,8 +39,14 @@ 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. addon.hbs(), diff --git a/src/blueprints/ember-addon/__gitignore__ b/src/blueprints/ember-addon/__gitignore__ index 2f6fd049..e622ec28 100644 --- a/src/blueprints/ember-addon/__gitignore__ +++ b/src/blueprints/ember-addon/__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/src/migration/ember-addon/steps/create-files-from-blueprints.ts b/src/migration/ember-addon/steps/create-files-from-blueprints.ts index 51151628..bb9c34b0 100644 --- a/src/migration/ember-addon/steps/create-files-from-blueprints.ts +++ b/src/migration/ember-addon/steps/create-files-from-blueprints.ts @@ -10,7 +10,7 @@ import { blueprintsRoot } from '../../../utils/blueprints.js'; function getFilesToSkip(options: Options): string[] { const { packageManager, packages } = options; - const files = new Set(); + const files = new Set(); if (!packages.addon.hasTypeScript) { files.add('__addonLocation__/unpublished-development-types/index.d.ts'); @@ -21,7 +21,7 @@ function getFilesToSkip(options: Options): string[] { files.add('pnpm-workspace.yaml'); } - return [...files] as string[]; + return Array.from(files); } function resolveBlueprintFilePath( diff --git a/src/migration/ember-addon/steps/create-options.ts b/src/migration/ember-addon/steps/create-options.ts index eae49b1f..52ec4b20 100644 --- a/src/migration/ember-addon/steps/create-options.ts +++ b/src/migration/ember-addon/steps/create-options.ts @@ -45,7 +45,7 @@ function analyzePackageManager(codemodOptions: CodemodOptions): PackageManager { ['yarn.lock', 'yarn'], ]); - const lockFiles = [...mapping.keys()]; + const lockFiles = Array.from(mapping.keys()); const filePaths = findFiles(unionize(lockFiles), { projectRoot, diff --git a/src/migration/ember-addon/steps/move-project-root-files.ts b/src/migration/ember-addon/steps/move-project-root-files.ts index 40973d36..d07df844 100644 --- a/src/migration/ember-addon/steps/move-project-root-files.ts +++ b/src/migration/ember-addon/steps/move-project-root-files.ts @@ -49,7 +49,7 @@ function moveToAddonAndTestApp(options: Options): void { files.add('tsconfig.json'); } - const filePaths = findFiles(unionize([...files]), { + const filePaths = findFiles(unionize(Array.from(files)), { projectRoot, }); diff --git a/src/migration/ember-addon/steps/update-addon-package-json.ts b/src/migration/ember-addon/steps/update-addon-package-json.ts index f5fc03f0..772122ef 100644 --- a/src/migration/ember-addon/steps/update-addon-package-json.ts +++ b/src/migration/ember-addon/steps/update-addon-package-json.ts @@ -62,21 +62,23 @@ function updateDevDependencies( '@babel/runtime', '@embroider/addon-dev', '@rollup/plugin-babel', + '@rollup/plugin-node-resolve', + 'concurrently', 'rollup', 'rollup-plugin-copy', ]); if (packages.addon.hasTypeScript) { packagesToInstall.add('@babel/preset-typescript'); - packagesToInstall.add('rollup-plugin-ts'); - packagesToInstall.delete('@rollup/plugin-babel'); } - [...packagesToInstall].sort().forEach((packageName) => { - const version = getVersion(packageName, options); + Array.from(packagesToInstall) + .sort() + .forEach((packageName) => { + const version = getVersion(packageName, options); - devDependencies.set(packageName, version); - }); + devDependencies.set(packageName, version); + }); packageJson['devDependencies'] = convertToObject(devDependencies); } @@ -120,12 +122,15 @@ function updateOtherFields( if (packages.addon.hasTypeScript) { packageJson['exports'] = { - '.': './dist/index.js', + '.': { + types: './declarations/index.d.ts', + default: './dist/index.js', + }, './*': { /* This object has an order dependency. The `default` key must appear last. */ - types: './dist/*.d.ts', + types: './declarations/*.d.ts', default: './dist/*.js', }, './addon-main.js': './addon-main.cjs', @@ -138,31 +143,69 @@ function updateOtherFields( }; } + const files = new Set(['addon-main.cjs', 'dist']); + if (hasPublicAssets) { - packageJson['files'] = ['addon-main.cjs', 'dist', 'public']; - } else { - packageJson['files'] = ['addon-main.cjs', 'dist']; + files.add('public'); } + if (packages.addon.hasTypeScript) { + files.add('declarations'); + } + + packageJson['files'] = Array.from(files).sort(); + if (packages.addon.hasTypeScript) { packageJson['typesVersions'] = { '*': { - '*': ['dist/*'], + '*': ['declarations/*'], }, }; } } -function updateScripts(packageJson: PackageJson): void { +function updateScripts(packageJson: PackageJson, options: Options): void { + const { packages } = options; + const scripts = convertToMap(packageJson['scripts']); - scripts.set('build', 'rollup --config'); - scripts.set('prepack', 'rollup --config'); - scripts.set('start', 'rollup --config --watch'); - scripts.set( - 'test', - "echo 'A v2 addon does not have tests, run tests in test-app'", - ); + if (packages.addon.hasTypeScript) { + scripts.set('build', 'concurrently "npm:build:*" --names "build:"'); + scripts.set('build:js', 'rollup --config'); + scripts.set( + 'build:types', + packages.addon.hasGlint ? 'glint --declaration' : 'tsc', + ); + + scripts.set( + 'lint:types', + packages.addon.hasGlint + ? 'glint' + : 'tsc --emitDeclarationOnly false --noEmit', + ); + + scripts.set('prepack', 'rollup --config'); + + scripts.set('start', 'concurrently "npm:start:*" --names "start:"'); + scripts.set('start:js', 'rollup --config --watch --no-watch.clearScreen'); + scripts.set( + 'start:types', + packages.addon.hasGlint ? 'glint --declaration --watch' : 'tsc --watch', + ); + + scripts.set( + 'test', + "echo 'A v2 addon does not have tests, run tests in test-app'", + ); + } else { + scripts.set('build', 'rollup --config'); + scripts.set('prepack', 'rollup --config'); + scripts.set('start', 'rollup --config --watch'); + scripts.set( + 'test', + "echo 'A v2 addon does not have tests, run tests in test-app'", + ); + } packageJson['scripts'] = convertToObject(scripts); } @@ -179,7 +222,7 @@ export function updateAddonPackageJson( updateDependencies(packageJson, options); updateDevDependencies(packageJson, options); - updateScripts(packageJson); + updateScripts(packageJson, options); updateOtherFields(packageJson, context, options); const destination = join(projectRoot, locations.addon, 'package.json'); diff --git a/src/migration/ember-addon/steps/update-addon-tsconfig-json.ts b/src/migration/ember-addon/steps/update-addon-tsconfig-json.ts index ecd69e28..025670f3 100644 --- a/src/migration/ember-addon/steps/update-addon-tsconfig-json.ts +++ b/src/migration/ember-addon/steps/update-addon-tsconfig-json.ts @@ -6,12 +6,26 @@ import { convertToMap, convertToObject } from '@codemod-utils/json'; import type { Options, TsConfigJson } from '../../../types/index.js'; import { sanitizeJson } from '../../../utils/json.js'; -function updateCompilerOptions(tsConfigJson: TsConfigJson): void { +function updateCompilerOptions( + tsConfigJson: TsConfigJson, + options: Options, +): void { + const { packages } = options; + const compilerOptions = convertToMap(tsConfigJson['compilerOptions']); compilerOptions.delete('baseUrl'); compilerOptions.delete('paths'); + if (packages.addon.hasGlint) { + compilerOptions.set('declarationDir', 'declarations'); + } else { + compilerOptions.set('declaration', true); + compilerOptions.set('declarationDir', 'declarations'); + compilerOptions.set('emitDeclarationOnly', true); + compilerOptions.set('noEmit', false); + } + tsConfigJson['compilerOptions'] = convertToObject(compilerOptions); } @@ -30,7 +44,7 @@ export function updateAddonTsConfigJson(options: Options): void { const oldFile = readFileSync(oldPath, 'utf8'); const tsConfigJson = JSON.parse(sanitizeJson(oldFile)); - updateCompilerOptions(tsConfigJson); + updateCompilerOptions(tsConfigJson, options); updateInclude(tsConfigJson); const newFile = JSON.stringify(tsConfigJson, null, 2) + '\n'; diff --git a/src/migration/ember-addon/steps/update-test-app-package-json.ts b/src/migration/ember-addon/steps/update-test-app-package-json.ts index 5de5d06e..ccec17fd 100644 --- a/src/migration/ember-addon/steps/update-test-app-package-json.ts +++ b/src/migration/ember-addon/steps/update-test-app-package-json.ts @@ -29,7 +29,7 @@ function moveDependenciesToDevDependencies( packagesToMove.add('ember-cli-typescript'); } - [...packagesToMove] + Array.from(packagesToMove) .filter((packageName) => dependencies.has(packageName)) .sort() .forEach((packageName) => { diff --git a/src/utils/blueprints/get-version.ts b/src/utils/blueprints/get-version.ts index 0c78e4b0..1c028e4c 100644 --- a/src/utils/blueprints/get-version.ts +++ b/src/utils/blueprints/get-version.ts @@ -11,13 +11,13 @@ const latestVersions = new Map([ ['@embroider/addon-dev', '3.1.1'], ['@embroider/addon-shim', '1.8.5'], ['@rollup/plugin-babel', '6.0.3'], + ['@rollup/plugin-node-resolve', '15.1.0'], ['concurrently', '8.2.0'], ['ember-auto-import', '2.6.3'], ['ember-cli-babel', '7.26.11'], ['ember-cli-htmlbars', '6.2.0'], ['rollup', '3.26.0'], ['rollup-plugin-copy', '3.4.0'], - ['rollup-plugin-ts', '3.2.0'], ]); export function getVersion(packageName: string, options: Options): string { 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',