diff --git a/my-addon-2/.editorconfig b/my-addon-2/.editorconfig new file mode 100644 index 00000000..c35a0024 --- /dev/null +++ b/my-addon-2/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.hbs] +insert_final_newline = false + +[*.{diff,md}] +trim_trailing_whitespace = false diff --git a/my-addon-2/.env.development b/my-addon-2/.env.development new file mode 100644 index 00000000..8380c3a6 --- /dev/null +++ b/my-addon-2/.env.development @@ -0,0 +1,8 @@ +# This file is committed to git and should not contain any secrets. +# +# Vite recommends using .env.local or .env.[mode].local if you need to manage secrets +# SEE: https://vite.dev/guide/env-and-mode.html#env-files for more information. + + +# Default NODE_ENV with vite build --mode=test is production +NODE_ENV=development diff --git a/my-addon-2/.github/workflows/ci.yml b/my-addon-2/.github/workflows/ci.yml new file mode 100644 index 00000000..1961de91 --- /dev/null +++ b/my-addon-2/.github/workflows/ci.yml @@ -0,0 +1,99 @@ +name: CI + +on: + push: + branches: + - main + - master + pull_request: {} + +concurrency: + group: ci-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: "Lints" + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - name: Install Dependencies + run: pnpm install --frozen-lockfile + - name: Lint + run: pnpm lint + + test: + name: "Tests" + runs-on: ubuntu-latest + timeout-minutes: 10 + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - name: Install Dependencies + run: pnpm install --frozen-lockfile + - name: Run Tests + run: pnpm test + # For the Try Scenarios + - id: set-matrix + run: | + echo "matrix=$(pnpm -s dlx @embroider/try list)" >> $GITHUB_OUTPUT + + + floating: + name: "Floating Dependencies" + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - name: Install Dependencies + run: pnpm install --no-lockfile + - name: Run Tests + run: pnpm test + + try-scenarios: + name: ${{ matrix.name }} + runs-on: ubuntu-latest + needs: "test" + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: ${{fromJson(needs.test.outputs.matrix)}} + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - name: Apply Scenario + run: | + pnpm dlx @embroider/try apply ${{ matrix.name }} + + - name: Install Dependencies + run: pnpm install --no-lockfile + - name: Run Tests + run: | + pnpm test + + env: ${{ matrix.env }} diff --git a/my-addon-2/.github/workflows/push-dist.yml b/my-addon-2/.github/workflows/push-dist.yml new file mode 100644 index 00000000..bdfa5b5d --- /dev/null +++ b/my-addon-2/.github/workflows/push-dist.yml @@ -0,0 +1,34 @@ +# Because this library needs to be built, +# we can't easily point package.json files at the git repo for easy cross-repo testing. +# +# This workflow brings back that capability by placing the compiled assets on a "dist" branch +# (configurable via the "branch" option below) +name: Push dist + +on: + push: + branches: + - main + - master + +jobs: + push-dist: + name: Push dist + permissions: + contents: write + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - name: Install Dependencies + run: pnpm install --frozen-lockfile + - uses: kategengler/put-built-npm-package-contents-on-branch@v2.0.0 + with: + branch: dist + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/my-addon-2/.gitignore b/my-addon-2/.gitignore new file mode 100644 index 00000000..cb265947 --- /dev/null +++ b/my-addon-2/.gitignore @@ -0,0 +1,17 @@ +# compiled output +dist/ +dist-tests/ +declarations/ + +# from scenarios +tmp/ +config/optional-features.json +ember-cli-build.cjs + +# npm/pnpm/yarn pack output +*.tgz + +# deps & caches +node_modules/ +.eslintcache +.prettiercache diff --git a/my-addon-2/.prettierignore b/my-addon-2/.prettierignore new file mode 100644 index 00000000..b5f539be --- /dev/null +++ b/my-addon-2/.prettierignore @@ -0,0 +1,16 @@ +# unconventional js +/blueprints/*/files/ + +# compiled output +/dist/ +/dist-*/ +/declarations/ + +# misc +/coverage/ +pnpm-lock.yaml +config/ember-cli-update.json +*.yaml +*.yml +*.md +*.html diff --git a/my-addon-2/.prettierrc.mjs b/my-addon-2/.prettierrc.mjs new file mode 100644 index 00000000..9cc6b3db --- /dev/null +++ b/my-addon-2/.prettierrc.mjs @@ -0,0 +1,12 @@ +export default { + plugins: ['prettier-plugin-ember-template-tag'], + overrides: [ + { + files: '*.{js,gjs,ts,gts,mjs,mts,cjs,cts}', + options: { + singleQuote: true, + templateSingleQuote: false, + }, + }, + ], +}; diff --git a/my-addon-2/.template-lintrc.mjs b/my-addon-2/.template-lintrc.mjs new file mode 100644 index 00000000..8b6625cd --- /dev/null +++ b/my-addon-2/.template-lintrc.mjs @@ -0,0 +1,4 @@ +export default { + extends: 'recommended', + checkHbsTemplateLiterals: false, +}; diff --git a/my-addon-2/.try.mjs b/my-addon-2/.try.mjs new file mode 100644 index 00000000..61b4553c --- /dev/null +++ b/my-addon-2/.try.mjs @@ -0,0 +1,87 @@ +// When building your addon for older Ember versions you need to have the required files +const compatFiles = { + 'ember-cli-build.cjs': `const EmberApp = require('ember-cli/lib/broccoli/ember-app'); +const { compatBuild } = require('@embroider/compat'); +module.exports = async function (defaults) { + const { buildOnce } = await import('@embroider/vite'); + let app = new EmberApp(defaults); + return compatBuild(app, buildOnce); +};`, + 'config/optional-features.json': JSON.stringify({ + 'application-template-wrapper': false, + 'default-async-observers': true, + 'jquery-integration': false, + 'template-only-glimmer-components': true, + 'no-implicit-route-model': true, + }), +}; + +const compatDeps = { + '@embroider/compat': '^4.0.3', + 'ember-cli': '^5.12.0', + 'ember-auto-import': '^2.10.0', + '@ember/optional-features': '^2.2.0', +}; + +export default { + scenarios: [ + { + name: 'ember-lts-5.8', + npm: { + devDependencies: { + 'ember-source': '~5.8.0', + ...compatDeps, + }, + }, + env: { + ENABLE_COMPAT_BUILD: true, + }, + files: compatFiles, + }, + { + name: 'ember-lts-5.12', + npm: { + devDependencies: { + 'ember-source': '~5.12.0', + ...compatDeps, + }, + }, + env: { + ENABLE_COMPAT_BUILD: true, + }, + files: compatFiles, + }, + { + name: 'ember-lts-6.4', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@~6.4.0', + }, + }, + }, + { + name: 'ember-latest', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@latest', + }, + }, + }, + { + name: 'ember-beta', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@beta', + }, + }, + }, + { + name: 'ember-alpha', + npm: { + devDependencies: { + 'ember-source': 'npm:ember-source@alpha', + }, + }, + }, + ], +}; diff --git a/my-addon-2/CONTRIBUTING.md b/my-addon-2/CONTRIBUTING.md new file mode 100644 index 00000000..8addbc37 --- /dev/null +++ b/my-addon-2/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# How To Contribute + +## Installation + +- `git clone ` +- `cd my-addon-2` +- `pnpm install` + +## Linting + +- `pnpm lint` +- `pnpm lint:fix` + +## Building the addon + +- `pnpm build` + +## Running tests + +- `pnpm test` – Runs the test suite on the current Ember version +- `pnpm test:watch` – Runs the test suite in "watch mode" + +## Running the test application + +- `pnpm start` +- Visit the test application at [http://localhost:4200](http://localhost:4200). + +For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/). diff --git a/my-addon-2/LICENSE.md b/my-addon-2/LICENSE.md new file mode 100644 index 00000000..d354012c --- /dev/null +++ b/my-addon-2/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2026 + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/my-addon-2/README.md b/my-addon-2/README.md new file mode 100644 index 00000000..476501d4 --- /dev/null +++ b/my-addon-2/README.md @@ -0,0 +1,26 @@ +# my-addon-2 + +[Short description of the addon.] + +## Compatibility + +- Ember.js v5.8 or above +- Embroider or ember-auto-import v2 + +## Installation + +``` +ember install my-addon-2 +``` + +## Usage + +[Longer description of how to use the addon in apps.] + +## Contributing + +See the [Contributing](CONTRIBUTING.md) guide for details. + +## License + +This project is licensed under the [MIT License](LICENSE.md). diff --git a/my-addon-2/addon-main.cjs b/my-addon-2/addon-main.cjs new file mode 100644 index 00000000..f868d6b9 --- /dev/null +++ b/my-addon-2/addon-main.cjs @@ -0,0 +1,4 @@ +'use strict'; + +const { addonV1Shim } = require('@embroider/addon-shim'); +module.exports = addonV1Shim(__dirname); diff --git a/my-addon-2/babel.config.cjs b/my-addon-2/babel.config.cjs new file mode 100644 index 00000000..fe72f41b --- /dev/null +++ b/my-addon-2/babel.config.cjs @@ -0,0 +1,50 @@ +/** + * This babel.config is not used for publishing. + * It's only for the local editing experience + * (and linting) + */ +const { buildMacros } = require('@embroider/macros/babel'); + +const { + babelCompatSupport, + templateCompatSupport, +} = require('@embroider/compat/babel'); + +const macros = buildMacros(); + +// For scenario testing +const isCompat = Boolean(process.env.ENABLE_COMPAT_BUILD); + +module.exports = { + plugins: [ + [ + '@babel/plugin-transform-typescript', + { + allExtensions: true, + allowDeclareFields: true, + onlyRemoveTypeImports: true, + }, + ], + [ + 'babel-plugin-ember-template-compilation', + { + transforms: [ + ...(isCompat ? templateCompatSupport() : macros.templateMacros), + ], + }, + ], + [ + 'module:decorator-transforms', + { + runtime: { + import: require.resolve('decorator-transforms/runtime-esm'), + }, + }, + ], + ...(isCompat ? babelCompatSupport() : macros.babelMacros), + ], + + generatorOpts: { + compact: false, + }, +}; diff --git a/my-addon-2/babel.publish.config.cjs b/my-addon-2/babel.publish.config.cjs new file mode 100644 index 00000000..85ffa1d6 --- /dev/null +++ b/my-addon-2/babel.publish.config.cjs @@ -0,0 +1,36 @@ +/** + * This babel.config is only used for publishing. + * + * For local dev experience, see the babel.config + */ +module.exports = { + plugins: [ + [ + '@babel/plugin-transform-typescript', + { + allExtensions: true, + allowDeclareFields: true, + onlyRemoveTypeImports: true, + }, + ], + [ + 'babel-plugin-ember-template-compilation', + { + targetFormat: 'hbs', + transforms: [], + }, + ], + [ + 'module:decorator-transforms', + { + runtime: { + import: 'decorator-transforms/runtime-esm', + }, + }, + ], + ], + + generatorOpts: { + compact: false, + }, +}; diff --git a/my-addon-2/config/ember-cli-update.json b/my-addon-2/config/ember-cli-update.json new file mode 100644 index 00000000..7aa646e5 --- /dev/null +++ b/my-addon-2/config/ember-cli-update.json @@ -0,0 +1,21 @@ +{ + "schemaVersion": "1.0.0", + "projectName": "my-addon-2", + "packages": [ + { + "name": "@ember/addon-blueprint", + "version": "0.16.1", + "blueprints": [ + { + "name": "@ember/addon-blueprint", + "isBaseBlueprint": true, + "options": [ + "--ci-provider=github", + "--pnpm", + "--typescript" + ] + } + ] + } + ] +} diff --git a/my-addon-2/demo-app/app.gts b/my-addon-2/demo-app/app.gts new file mode 100644 index 00000000..d7f1916f --- /dev/null +++ b/my-addon-2/demo-app/app.gts @@ -0,0 +1,38 @@ +import EmberApp from 'ember-strict-application-resolver'; +import EmberRouter from '@ember/routing/router'; +import PageTitleService from 'ember-page-title/services/page-title'; + +class Router extends EmberRouter { + location = 'history'; + rootURL = '/'; +} + +export class App extends EmberApp { + /** + * Any services or anything from the addon that needs to be in the app-tree registry + * will need to be manually specified here. + * + * Techniques to avoid needing this: + * - private services + * - require the consuming app import and configure themselves + * (which is what we're emulating here) + */ + modules = { + './router': Router, + './services/page-title': PageTitleService, + /** + * NOTE: this glob will import everything matching the glob, + * and includes non-services in the services directory. + */ + ...import.meta.glob('./services/**/*', { eager: true }), + /** + * These imports are not magic, but we do require that all entries in the + * modules object match a ./[type]/[name] pattern. + * + * See: https://rfcs.emberjs.com/id/1132-default-strict-resolver + */ + ...import.meta.glob('./templates/**/*', { eager: true }), + }; +} + +Router.map(function () {}); diff --git a/my-addon-2/demo-app/styles.css b/my-addon-2/demo-app/styles.css new file mode 100644 index 00000000..fe5e87f4 --- /dev/null +++ b/my-addon-2/demo-app/styles.css @@ -0,0 +1,6 @@ +/** +* See: https://vite.dev/guide/features.html#css +* for features beyond normal CSS that are available to you. +* +* This CSS is meant for the demo-app only, and will not be included in the published assets for this library. +*/ diff --git a/my-addon-2/demo-app/templates/application.gts b/my-addon-2/demo-app/templates/application.gts new file mode 100644 index 00000000..515f232c --- /dev/null +++ b/my-addon-2/demo-app/templates/application.gts @@ -0,0 +1,16 @@ +import { pageTitle } from 'ember-page-title'; +import MyAddon2 from '#src/index.ts'; + +const greeting = 'hello'; + +const myAddon2 = new MyAddon2(); + + diff --git a/my-addon-2/eslint.config.mjs b/my-addon-2/eslint.config.mjs new file mode 100644 index 00000000..d4b289b6 --- /dev/null +++ b/my-addon-2/eslint.config.mjs @@ -0,0 +1,129 @@ +/** + * Debugging: + * https://eslint.org/docs/latest/use/configure/debug + * ---------------------------------------------------- + * + * Print a file's calculated configuration + * + * npx eslint --print-config path/to/file.js + * + * Inspecting the config + * + * npx eslint --inspect-config + * + */ +import babelParser from '@babel/eslint-parser'; +import js from '@eslint/js'; +import { defineConfig, globalIgnores } from 'eslint/config'; +import prettier from 'eslint-config-prettier'; +import ember from 'eslint-plugin-ember/recommended'; +import importPlugin from 'eslint-plugin-import'; +import n from 'eslint-plugin-n'; +import globals from 'globals'; +import ts from 'typescript-eslint'; + +const esmParserOptions = { + ecmaFeatures: { modules: true }, + ecmaVersion: 'latest', +}; + +const tsParserOptions = { + projectService: true, + tsconfigRootDir: import.meta.dirname, +}; + +export default defineConfig([ + globalIgnores(['dist/', 'dist-*/', 'declarations/', 'coverage/', '!**/.*']), + js.configs.recommended, + prettier, + ember.configs.base, + ember.configs.gjs, + ember.configs.gts, + /** + * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options + */ + { + linterOptions: { + reportUnusedDisableDirectives: 'error', + }, + }, + { + files: ['**/*.js'], + languageOptions: { + parser: babelParser, + }, + }, + { + files: ['**/*.{js,gjs}'], + languageOptions: { + parserOptions: esmParserOptions, + globals: { + ...globals.browser, + }, + }, + }, + { + files: ['**/*.{ts,gts}'], + languageOptions: { + parser: ember.parser, + parserOptions: tsParserOptions, + globals: { + ...globals.browser, + }, + }, + extends: [ + ...ts.configs.recommendedTypeChecked, + // https://github.com/ember-cli/ember-addon-blueprint/issues/119 + { + ...ts.configs.eslintRecommended, + files: undefined, + }, + ember.configs.gts, + ], + }, + { + files: ['src/**/*'], + plugins: { + import: importPlugin, + }, + rules: { + // require relative imports use full extensions + 'import/extensions': ['error', 'always', { ignorePackages: true }], + }, + }, + /** + * CJS node files + */ + { + files: ['**/*.cjs'], + plugins: { + n, + }, + + languageOptions: { + sourceType: 'script', + ecmaVersion: 'latest', + globals: { + ...globals.node, + }, + }, + }, + /** + * ESM node files + */ + { + files: ['**/*.mjs'], + plugins: { + n, + }, + + languageOptions: { + sourceType: 'module', + ecmaVersion: 'latest', + parserOptions: esmParserOptions, + globals: { + ...globals.node, + }, + }, + }, +]); diff --git a/my-addon-2/index.html b/my-addon-2/index.html new file mode 100644 index 00000000..d48c7fff --- /dev/null +++ b/my-addon-2/index.html @@ -0,0 +1,24 @@ + + + + + + + Demo App + + + + + + + + + + + + + diff --git a/my-addon-2/package.json b/my-addon-2/package.json new file mode 100644 index 00000000..57a8d044 --- /dev/null +++ b/my-addon-2/package.json @@ -0,0 +1,104 @@ +{ + "name": "my-addon-2", + "version": "0.0.0", + "description": "The default blueprint for Embroider v2 addons.", + "keywords": [ + "ember-addon" + ], + "repository": "", + "license": "MIT", + "author": "", + "imports": { + "#src/*": "./src/*" + }, + "exports": { + ".": { + "types": "./declarations/index.d.ts", + "default": "./dist/index.js" + }, + "./addon-main.js": "./addon-main.cjs", + "./*.css": "./dist/*.css", + "./*": { + "types": "./declarations/*.d.ts", + "default": "./dist/*.js" + } + }, + "files": [ + "addon-main.cjs", + "declarations", + "dist", + "src" + ], + "scripts": { + "build": "rollup --config", + "format": "prettier . --cache --write", + "lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\" --prefixColors auto", + "lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" --prefixColors auto && pnpm run format", + "lint:format": "prettier . --cache --check", + "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern", + "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern", + "lint:js": "eslint . --cache", + "lint:js:fix": "eslint . --fix", + "lint:types": "ember-tsc --noEmit", + "prepack": "rollup --config", + "start": "vite dev", + "test": "vite build --mode=development --out-dir dist-tests && testem --file testem.cjs ci --port 0" + }, + "dependencies": { + "@embroider/addon-shim": "^1.8.9", + "decorator-transforms": "^2.2.2" + }, + "devDependencies": { + "@babel/core": "^7.25.2", + "@babel/eslint-parser": "^7.25.1", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/runtime": "^7.25.6", + "@ember/app-tsconfig": "^1.0.0", + "@ember/library-tsconfig": "^1.0.0", + "@ember/test-helpers": "^5.2.1", + "@ember/test-waiters": "^4.1.1", + "@embroider/addon-dev": "^8.1.0", + "@embroider/compat": "^4.1.0", + "@embroider/core": "^4.1.0", + "@embroider/macros": "^1.18.0", + "@embroider/vite": "^1.1.5", + "@eslint/js": "^9.17.0", + "@glimmer/component": "^2.0.0", + "@glint/ember-tsc": "^1.0.3", + "@glint/template": "^1.6.1", + "@glint/tsserver-plugin": "^2.0.0", + "@rollup/plugin-babel": "^6.0.4", + "@types/qunit": "^2.19.12", + "babel-plugin-ember-template-compilation": "^2.2.5", + "concurrently": "^9.0.1", + "ember-basic-dropdown": "workspace:*", + "ember-page-title": "^9.0.3", + "ember-qunit": "^9.0.2", + "ember-source": "^6.7.0", + "ember-strict-application-resolver": "^0.1.0", + "ember-template-lint": "^7.9.0", + "eslint": "^9.17.0", + "eslint-config-prettier": "^10.1.5", + "eslint-plugin-ember": "^12.3.3", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-n": "^17.15.1", + "globals": "^16.1.0", + "prettier": "^3.4.2", + "prettier-plugin-ember-template-tag": "^2.0.4", + "qunit": "^2.24.1", + "qunit-dom": "^3.4.0", + "rollup": "^4.22.5", + "testem": "^3.15.1", + "typescript": "~5.8.3", + "typescript-eslint": "^8.19.1", + "vite": "^7.1.9" + }, + "ember": { + "edition": "octane" + }, + "ember-addon": { + "version": 2, + "type": "addon", + "main": "addon-main.cjs" + } +} diff --git a/my-addon-2/rollup.config.mjs b/my-addon-2/rollup.config.mjs new file mode 100644 index 00000000..c7974714 --- /dev/null +++ b/my-addon-2/rollup.config.mjs @@ -0,0 +1,76 @@ +import { babel } from '@rollup/plugin-babel'; +import { Addon } from '@embroider/addon-dev/rollup'; +import { fileURLToPath } from 'node:url'; +import { resolve, dirname } from 'node:path'; + +const addon = new Addon({ + srcDir: 'src', + destDir: 'dist', +}); + +const rootDirectory = dirname(fileURLToPath(import.meta.url)); +const babelConfig = resolve(rootDirectory, './babel.publish.config.cjs'); +const tsConfig = resolve(rootDirectory, './tsconfig.publish.json'); + +export default { + // This provides defaults that work well alongside `publicEntrypoints` below. + // You can augment this if you need to. + output: addon.output(), + + plugins: [ + // These are the modules that users should be able to import from your + // addon. Anything not listed here may get optimized away. + // By default all your JavaScript modules (**/*.js) will be importable. + // But you are encouraged to tweak this to only cover the modules that make + // up your addon's public API. Also make sure your package.json#exports + // is aligned to the config here. + // See https://github.com/embroider-build/embroider/blob/main/docs/v2-faq.md#how-can-i-define-the-public-exports-of-my-addon + addon.publicEntrypoints(['**/*.js', 'index.js', 'template-registry.js']), + + // These are the modules that should get reexported into the traditional + // "app" tree. Things in here should also be in publicEntrypoints above, but + // not everything in publicEntrypoints necessarily needs to go here. + addon.appReexports([ + 'components/**/*.js', + 'helpers/**/*.js', + 'modifiers/**/*.js', + 'services/**/*.js', + ]), + + // Follow the V2 Addon rules about dependencies. Your code can import from + // `dependencies` and `peerDependencies` as well as standard Ember-provided + // package names. + addon.dependencies(), + + // 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({ + extensions: ['.js', '.gjs', '.ts', '.gts'], + babelHelpers: 'bundled', + configFile: babelConfig, + }), + + // Ensure that standalone .hbs files are properly integrated as Javascript. + addon.hbs(), + + // Ensure that .gjs files are properly integrated as Javascript + addon.gjs(), + + // Emit .d.ts declaration files + addon.declarations( + 'declarations', + `pnpm ember-tsc --declaration --project ${tsConfig}`, + ), + + // addons are allowed to contain imports of .css files, which we want rollup + // to leave alone and keep in the published output. + addon.keepAssets(['**/*.css']), + + // Remove leftover build artifacts when starting a new build. + addon.clean(), + ], +}; diff --git a/my-addon-2/src/index.ts b/my-addon-2/src/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/my-addon-2/src/template-registry.ts b/my-addon-2/src/template-registry.ts new file mode 100644 index 00000000..7e1a8b04 --- /dev/null +++ b/my-addon-2/src/template-registry.ts @@ -0,0 +1,10 @@ +// Easily allow apps, which are not yet using strict mode templates, to consume your Glint types, by importing this file. +// Add all your components, helpers and modifiers to the template registry here, so apps don't have to do this. +// See https://typed-ember.gitbook.io/glint/environments/ember/authoring-addons + +// import type MyComponent from './components/my-component'; + +// Uncomment this once entries have been added! 👇 +// export default interface Registry { +// MyComponent: typeof MyComponent +// } diff --git a/my-addon-2/testem.cjs b/my-addon-2/testem.cjs new file mode 100644 index 00000000..9c064583 --- /dev/null +++ b/my-addon-2/testem.cjs @@ -0,0 +1,26 @@ +'use strict'; + +if (typeof module !== 'undefined') { + module.exports = { + test_page: 'tests/index.html?hidepassed', + cwd: 'dist-tests', + disable_watching: true, + launch_in_ci: ['Chrome'], + launch_in_dev: ['Chrome'], + browser_start_timeout: 120, + browser_args: { + Chrome: { + ci: [ + // --no-sandbox is needed when running Chrome inside a container + process.env.CI ? '--no-sandbox' : null, + '--headless=new', + '--disable-dev-shm-usage', + '--disable-software-rasterizer', + '--mute-audio', + '--remote-debugging-port=0', + '--window-size=1440,900', + ].filter(Boolean), + }, + }, + }; +} diff --git a/my-addon-2/tests/components/basic-dropdown-test.gts b/my-addon-2/tests/components/basic-dropdown-test.gts new file mode 100644 index 00000000..8154f69c --- /dev/null +++ b/my-addon-2/tests/components/basic-dropdown-test.gts @@ -0,0 +1,26 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'ember-qunit'; +import { + render, +} from '@ember/test-helpers'; +import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown'; + +module('Integration | Component | basic-dropdown', function (hooks) { + setupRenderingTest(hooks); + + test('Test', async function (assert) { + await render( + , + ); + + assert + // @ts-expect-error Property 'element' does not exist on type 'TestContext'. + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + .dom('#dropdown-unique-id-container', this.element) + .hasText(/ember\d+/, 'It yields the uniqueId'); + }); +}); diff --git a/my-addon-2/tests/index.html b/my-addon-2/tests/index.html new file mode 100644 index 00000000..aca75cf4 --- /dev/null +++ b/my-addon-2/tests/index.html @@ -0,0 +1,28 @@ + + + + + my-addon-2 Tests + + + + +
+
+
+
+
+
+ + + + + + + diff --git a/my-addon-2/tests/test-helper.ts b/my-addon-2/tests/test-helper.ts new file mode 100644 index 00000000..9339835e --- /dev/null +++ b/my-addon-2/tests/test-helper.ts @@ -0,0 +1,42 @@ +import EmberApp from 'ember-strict-application-resolver'; +import EmberRouter from '@ember/routing/router'; +import * as QUnit from 'qunit'; +import { setApplication } from '@ember/test-helpers'; +import { setup } from 'qunit-dom'; +import { start as qunitStart, setupEmberOnerrorValidation } from 'ember-qunit'; +// @ts-expect-error Could not find a declaration file for module '@embroider/macros/src/addon/runtime'. +import { getGlobalConfig } from '@embroider/macros/src/addon/runtime'; + +class Router extends EmberRouter { + location = 'none'; + rootURL = '/'; +} + +class TestApp extends EmberApp { + modules = { + './router': Router, + // add any custom services here + // import.meta.glob('./services/*', { eager: true }), + }; +} + +Router.map(function () {}); + +export function start() { + //eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call + const theMacrosGlobal = getGlobalConfig(); + //eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + theMacrosGlobal['@embroider/macros'] ||= {}; + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + theMacrosGlobal['@embroider/macros'].isTesting ||= true; + + setApplication( + TestApp.create({ + autoboot: false, + rootElement: '#ember-testing', + }), + ); + setup(QUnit.assert); + setupEmberOnerrorValidation(); + qunitStart(); +} diff --git a/my-addon-2/tsconfig.json b/my-addon-2/tsconfig.json new file mode 100644 index 00000000..4162dc6f --- /dev/null +++ b/my-addon-2/tsconfig.json @@ -0,0 +1,23 @@ +/** + * This tsconfig is not used for publishing. + * It's only for the local editing experience + * (and linting) + */ +{ + "extends": "@ember/app-tsconfig", + "include": [ + "src/**/*", + "tests/**/*", + "unpublished-development-types/**/*", + "demo-app/**/*" + ], + "compilerOptions": { + "rootDir": ".", + "types": [ + "ember-source/types", + "vite/client", + "@embroider/core/virtual", + "@glint/ember-tsc/types" + ] + } +} diff --git a/my-addon-2/tsconfig.publish.json b/my-addon-2/tsconfig.publish.json new file mode 100644 index 00000000..b72e6991 --- /dev/null +++ b/my-addon-2/tsconfig.publish.json @@ -0,0 +1,27 @@ +/** + * This tsconfig is only used for publishing. + * + * For local dev experience, see the tsconfig.json + */ +{ + "extends": "@ember/library-tsconfig", + "include": ["./src/**/*", "./unpublished-development-types/**/*"], + "compilerOptions": { + "allowJs": true, + "declarationDir": "declarations", + + /** + https://www.typescriptlang.org/tsconfig#rootDir + "Default: The longest common path of all non-declaration input files." + + Because we want our declarations' structure to match our rollup output, + we need this "rootDir" to match the "srcDir" in the rollup.config.mjs. + + This way, we can have simpler `package.json#exports` that matches + imports to files on disk + */ + "rootDir": "./src", + + "types": ["ember-source/types", "@glint/ember-tsc/types"] + } +} diff --git a/my-addon-2/unpublished-development-types/index.d.ts b/my-addon-2/unpublished-development-types/index.d.ts new file mode 100644 index 00000000..e69de29b diff --git a/my-addon-2/vite.config.mjs b/my-addon-2/vite.config.mjs new file mode 100644 index 00000000..3bb3990c --- /dev/null +++ b/my-addon-2/vite.config.mjs @@ -0,0 +1,24 @@ +import { defineConfig } from 'vite'; +import { extensions, ember, classicEmberSupport } from '@embroider/vite'; +import { babel } from '@rollup/plugin-babel'; + +// For scenario testing +const isCompat = Boolean(process.env.ENABLE_COMPAT_BUILD); + +export default defineConfig({ + plugins: [ + ...(isCompat ? [classicEmberSupport()] : []), + ember(), + babel({ + babelHelpers: 'inline', + extensions, + }), + ], + build: { + rollupOptions: { + input: { + tests: 'tests/index.html', + }, + }, + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 088d3d53..4d80b18e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -368,6 +368,145 @@ importers: specifier: ^7.3.0 version: 7.3.0(@types/node@25.0.3)(jiti@2.6.1)(sass-embedded@1.97.1)(sass@1.97.1)(terser@5.44.1) + my-addon-2: + dependencies: + '@embroider/addon-shim': + specifier: ^1.8.9 + version: 1.10.2 + decorator-transforms: + specifier: ^2.2.2 + version: 2.3.0(@babel/core@7.28.5) + devDependencies: + '@babel/core': + specifier: ^7.25.2 + version: 7.28.5 + '@babel/eslint-parser': + specifier: ^7.25.1 + version: 7.28.5(@babel/core@7.28.5)(eslint@9.39.2(jiti@2.6.1)) + '@babel/plugin-transform-typescript': + specifier: ^7.25.2 + version: 7.28.5(@babel/core@7.28.5) + '@babel/runtime': + specifier: ^7.25.6 + version: 7.28.4 + '@ember/app-tsconfig': + specifier: ^1.0.0 + version: 1.0.3 + '@ember/library-tsconfig': + specifier: ^1.0.0 + version: 1.1.3 + '@ember/test-helpers': + specifier: ^5.2.1 + version: 5.4.1(@babel/core@7.28.5)(@glint/template@1.7.3) + '@ember/test-waiters': + specifier: ^4.1.1 + version: 4.1.1(@glint/template@1.7.3) + '@embroider/addon-dev': + specifier: ^8.1.0 + version: 8.1.2(@glint/template@1.7.3)(rollup@4.54.0) + '@embroider/compat': + specifier: ^4.1.0 + version: 4.1.11(@embroider/core@4.4.1(@glint/template@1.7.3))(@glint/template@1.7.3) + '@embroider/core': + specifier: ^4.1.0 + version: 4.4.1(@glint/template@1.7.3) + '@embroider/macros': + specifier: ^1.18.0 + version: 1.19.5(@glint/template@1.7.3) + '@embroider/vite': + specifier: ^1.1.5 + version: 1.4.4(@embroider/core@4.4.1(@glint/template@1.7.3))(@glint/template@1.7.3)(rollup@4.54.0)(vite@7.3.0(@types/node@25.0.3)(jiti@2.6.1)(sass-embedded@1.97.1)(sass@1.97.1)(terser@5.44.1)) + '@eslint/js': + specifier: ^9.17.0 + version: 9.39.2 + '@glimmer/component': + specifier: ^2.0.0 + version: 2.0.0 + '@glint/ember-tsc': + specifier: ^1.0.3 + version: 1.0.8(typescript@5.8.3) + '@glint/template': + specifier: ^1.6.1 + version: 1.7.3 + '@glint/tsserver-plugin': + specifier: ^2.0.0 + version: 2.0.8 + '@rollup/plugin-babel': + specifier: ^6.0.4 + version: 6.1.0(@babel/core@7.28.5)(rollup@4.54.0) + '@types/qunit': + specifier: ^2.19.12 + version: 2.19.13 + babel-plugin-ember-template-compilation: + specifier: ^2.2.5 + version: 2.4.1 + concurrently: + specifier: ^9.0.1 + version: 9.2.1 + ember-basic-dropdown: + specifier: workspace:* + version: link:.. + ember-page-title: + specifier: ^9.0.3 + version: 9.0.3 + ember-qunit: + specifier: ^9.0.2 + version: 9.0.4(@ember/test-helpers@5.4.1(@babel/core@7.28.5)(@glint/template@1.7.3))(@glint/template@1.7.3)(qunit@2.24.3) + ember-source: + specifier: ^6.7.0 + version: 6.9.0(@glimmer/component@2.0.0)(rsvp@4.8.5) + ember-strict-application-resolver: + specifier: ^0.1.0 + version: 0.1.1(@babel/core@7.28.5) + ember-template-lint: + specifier: ^7.9.0 + version: 7.9.3 + eslint: + specifier: ^9.17.0 + version: 9.39.2(jiti@2.6.1) + eslint-config-prettier: + specifier: ^10.1.5 + version: 10.1.8(eslint@9.39.2(jiti@2.6.1)) + eslint-plugin-ember: + specifier: ^12.3.3 + version: 12.7.5(@babel/core@7.28.5)(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + eslint-plugin-import: + specifier: ^2.31.0 + version: 2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.2(jiti@2.6.1)) + eslint-plugin-n: + specifier: ^17.15.1 + version: 17.23.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + globals: + specifier: ^16.1.0 + version: 16.5.0 + prettier: + specifier: ^3.4.2 + version: 3.7.4 + prettier-plugin-ember-template-tag: + specifier: ^2.0.4 + version: 2.1.2(prettier@3.7.4) + qunit: + specifier: ^2.24.1 + version: 2.24.3 + qunit-dom: + specifier: ^3.4.0 + version: 3.5.0 + rollup: + specifier: ^4.22.5 + version: 4.54.0 + testem: + specifier: ^3.15.1 + version: 3.17.0(handlebars@4.7.8)(underscore@1.13.7) + typescript: + specifier: ~5.8.3 + version: 5.8.3 + typescript-eslint: + specifier: ^8.19.1 + version: 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + vite: + specifier: ^7.1.9 + version: 7.3.0(@types/node@25.0.3)(jiti@2.6.1)(sass-embedded@1.97.1)(sass@1.97.1)(terser@5.44.1) + packages: '@asamuzakjp/css-color@3.2.0': @@ -1033,6 +1172,9 @@ packages: '@ember/edition-utils@1.2.0': resolution: {integrity: sha512-VmVq/8saCaPdesQmftPqbFtxJWrzxNGSQ+e8x8LLe3Hjm36pJ04Q8LeORGZkAeOhldoUX9seLGmSaHeXkIqoog==} + '@ember/library-tsconfig@1.1.3': + resolution: {integrity: sha512-4cKJ38VEcm4mYmontK9BCpQgm5GPLgAeXqd6PqTHD8eKN0GTeegxdX4SsSUN/8emmULq/9H/Oh6fp3vM2mFqkA==} + '@ember/library-tsconfig@2.0.0': resolution: {integrity: sha512-DTGt9TYZ3bhObUviQXx4C0v46oWM7HsRrUTbgONw2QBhJVHlmXA89uXenlvuqVrCQkA0g5kz7wwyOlcjIZ8h0w==} @@ -7202,6 +7344,11 @@ packages: typescript-memoize@1.1.1: resolution: {integrity: sha512-GQ90TcKpIH4XxYTI2F98yEQYZgjNMOGPpOgdjIBhaLaWji5HPWlRnZ4AeA1hfBxtY7bCGDJsqDDHk/KaHOl5bA==} + typescript@5.8.3: + resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + engines: {node: '>=14.17'} + hasBin: true + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -8534,6 +8681,8 @@ snapshots: '@ember/edition-utils@1.2.0': {} + '@ember/library-tsconfig@1.1.3': {} + '@ember/library-tsconfig@2.0.0': {} '@ember/optional-features@2.3.0': @@ -9068,6 +9217,33 @@ snapshots: transitivePeerDependencies: - supports-color + '@glint/ember-tsc@1.0.8(typescript@5.8.3)': + dependencies: + '@glimmer/syntax': 0.95.0 + '@glint/template': 1.7.3 + '@volar/kit': 2.4.23(typescript@5.8.3) + '@volar/language-core': 2.4.23 + '@volar/language-server': 2.4.23 + '@volar/language-service': 2.4.23 + '@volar/source-map': 2.4.23 + '@volar/test-utils': 2.4.23 + '@volar/typescript': 2.4.23 + computeds: 0.0.1 + content-tag: 3.1.3 + escape-string-regexp: 4.0.0 + semver: 7.7.3 + silent-error: 1.1.1 + typescript: 5.8.3 + uuid: 8.3.2 + volar-service-html: 0.0.64(@volar/language-service@2.4.23) + volar-service-typescript: 0.0.65(@volar/language-service@2.4.23) + vscode-languageserver-protocol: 3.17.5 + vscode-languageserver-textdocument: 1.0.12 + vscode-uri: 3.1.0 + yargs: 17.7.2 + transitivePeerDependencies: + - supports-color + '@glint/ember-tsc@1.0.8(typescript@5.9.3)': dependencies: '@glimmer/syntax': 0.95.0 @@ -9742,6 +9918,22 @@ snapshots: '@types/unist@3.0.3': {} + '@typescript-eslint/eslint-plugin@8.50.1(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3)': + dependencies: + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/scope-manager': 8.50.1 + '@typescript-eslint/type-utils': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/utils': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.50.1 + eslint: 9.39.2(jiti@2.6.1) + ignore: 7.0.5 + natural-compare: 1.4.0 + ts-api-utils: 2.1.0(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/eslint-plugin@8.50.1(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: '@eslint-community/regexpp': 4.12.2 @@ -9758,6 +9950,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3)': + dependencies: + '@typescript-eslint/scope-manager': 8.50.1 + '@typescript-eslint/types': 8.50.1 + '@typescript-eslint/typescript-estree': 8.50.1(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.50.1 + debug: 4.4.3 + eslint: 9.39.2(jiti@2.6.1) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: '@typescript-eslint/scope-manager': 8.50.1 @@ -9770,6 +9974,15 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/project-service@8.50.1(typescript@5.8.3)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.50.1(typescript@5.8.3) + '@typescript-eslint/types': 8.50.1 + debug: 4.4.3 + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/project-service@8.50.1(typescript@5.9.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.50.1(typescript@5.9.3) @@ -9784,10 +9997,26 @@ snapshots: '@typescript-eslint/types': 8.50.1 '@typescript-eslint/visitor-keys': 8.50.1 + '@typescript-eslint/tsconfig-utils@8.50.1(typescript@5.8.3)': + dependencies: + typescript: 5.8.3 + '@typescript-eslint/tsconfig-utils@8.50.1(typescript@5.9.3)': dependencies: typescript: 5.9.3 + '@typescript-eslint/type-utils@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3)': + dependencies: + '@typescript-eslint/types': 8.50.1 + '@typescript-eslint/typescript-estree': 8.50.1(typescript@5.8.3) + '@typescript-eslint/utils': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + debug: 4.4.3 + eslint: 9.39.2(jiti@2.6.1) + ts-api-utils: 2.1.0(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/type-utils@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: '@typescript-eslint/types': 8.50.1 @@ -9802,6 +10031,21 @@ snapshots: '@typescript-eslint/types@8.50.1': {} + '@typescript-eslint/typescript-estree@8.50.1(typescript@5.8.3)': + dependencies: + '@typescript-eslint/project-service': 8.50.1(typescript@5.8.3) + '@typescript-eslint/tsconfig-utils': 8.50.1(typescript@5.8.3) + '@typescript-eslint/types': 8.50.1 + '@typescript-eslint/visitor-keys': 8.50.1 + debug: 4.4.3 + minimatch: 9.0.5 + semver: 7.7.3 + tinyglobby: 0.2.15 + ts-api-utils: 2.1.0(typescript@5.8.3) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/typescript-estree@8.50.1(typescript@5.9.3)': dependencies: '@typescript-eslint/project-service': 8.50.1(typescript@5.9.3) @@ -9817,6 +10061,17 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/utils@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3)': + dependencies: + '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) + '@typescript-eslint/scope-manager': 8.50.1 + '@typescript-eslint/types': 8.50.1 + '@typescript-eslint/typescript-estree': 8.50.1(typescript@5.8.3) + eslint: 9.39.2(jiti@2.6.1) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/utils@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)': dependencies: '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) @@ -9835,6 +10090,15 @@ snapshots: '@ungap/structured-clone@1.3.0': {} + '@volar/kit@2.4.23(typescript@5.8.3)': + dependencies: + '@volar/language-service': 2.4.23 + '@volar/typescript': 2.4.23 + typesafe-path: 0.2.2 + typescript: 5.8.3 + vscode-languageserver-textdocument: 1.0.12 + vscode-uri: 3.1.0 + '@volar/kit@2.4.23(typescript@5.9.3)': dependencies: '@volar/language-service': 2.4.23 @@ -11627,6 +11891,23 @@ snapshots: transitivePeerDependencies: - supports-color + ember-eslint-parser@0.5.13(@babel/core@7.28.5)(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3): + dependencies: + '@babel/core': 7.28.5 + '@babel/eslint-parser': 7.28.5(@babel/core@7.28.5)(eslint@9.39.2(jiti@2.6.1)) + '@glimmer/syntax': 0.95.0 + '@typescript-eslint/tsconfig-utils': 8.50.1(typescript@5.8.3) + content-tag: 2.0.3 + eslint-scope: 7.2.2 + html-tags: 3.3.1 + mathml-tag-names: 2.1.3 + svg-tags: 1.0.0 + optionalDependencies: + '@typescript-eslint/parser': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + transitivePeerDependencies: + - eslint + - typescript + ember-eslint-parser@0.5.13(@babel/core@7.28.5)(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3): dependencies: '@babel/core': 7.28.5 @@ -11994,6 +12275,16 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2(jiti@2.6.1)): + dependencies: + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + eslint: 9.39.2(jiti@2.6.1) + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2(jiti@2.6.1)): dependencies: debug: 3.2.7 @@ -12004,6 +12295,25 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-plugin-ember@12.7.5(@babel/core@7.28.5)(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3): + dependencies: + '@ember-data/rfc395-data': 0.0.4 + css-tree: 3.1.0 + ember-eslint-parser: 0.5.13(@babel/core@7.28.5)(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + ember-rfc176-data: 0.3.18 + eslint: 9.39.2(jiti@2.6.1) + eslint-utils: 3.0.0(eslint@9.39.2(jiti@2.6.1)) + estraverse: 5.3.0 + lodash.camelcase: 4.3.0 + lodash.kebabcase: 4.1.1 + requireindex: 1.2.0 + snake-case: 3.0.4 + optionalDependencies: + '@typescript-eslint/parser': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + transitivePeerDependencies: + - '@babel/core' + - typescript + eslint-plugin-ember@12.7.5(@babel/core@7.28.5)(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3): dependencies: '@ember-data/rfc395-data': 0.0.4 @@ -12030,6 +12340,35 @@ snapshots: eslint: 9.39.2(jiti@2.6.1) eslint-compat-utils: 0.5.1(eslint@9.39.2(jiti@2.6.1)) + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.2(jiti@2.6.1)): + dependencies: + '@rtsao/scc': 1.1.0 + array-includes: 3.1.9 + array.prototype.findlastindex: 1.2.6 + array.prototype.flat: 1.3.3 + array.prototype.flatmap: 1.3.3 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 9.39.2(jiti@2.6.1) + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.2(jiti@2.6.1)) + hasown: 2.0.2 + is-core-module: 2.16.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.1 + semver: 6.3.1 + string.prototype.trimend: 1.0.9 + tsconfig-paths: 3.15.0 + optionalDependencies: + '@typescript-eslint/parser': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1)): dependencies: '@rtsao/scc': 1.1.0 @@ -12059,6 +12398,21 @@ snapshots: - eslint-import-resolver-webpack - supports-color + eslint-plugin-n@17.23.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3): + dependencies: + '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) + enhanced-resolve: 5.18.4 + eslint: 9.39.2(jiti@2.6.1) + eslint-plugin-es-x: 7.8.0(eslint@9.39.2(jiti@2.6.1)) + get-tsconfig: 4.13.0 + globals: 15.15.0 + globrex: 0.1.2 + ignore: 5.3.2 + semver: 7.7.3 + ts-declaration-location: 1.0.7(typescript@5.8.3) + transitivePeerDependencies: + - typescript + eslint-plugin-n@17.23.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3): dependencies: '@eslint-community/eslint-utils': 4.9.0(eslint@9.39.2(jiti@2.6.1)) @@ -16076,10 +16430,19 @@ snapshots: trim-lines@3.0.1: {} + ts-api-utils@2.1.0(typescript@5.8.3): + dependencies: + typescript: 5.8.3 + ts-api-utils@2.1.0(typescript@5.9.3): dependencies: typescript: 5.9.3 + ts-declaration-location@1.0.7(typescript@5.8.3): + dependencies: + picomatch: 4.0.3 + typescript: 5.8.3 + ts-declaration-location@1.0.7(typescript@5.9.3): dependencies: picomatch: 4.0.3 @@ -16156,6 +16519,17 @@ snapshots: dependencies: semver: 7.7.3 + typescript-eslint@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3): + dependencies: + '@typescript-eslint/eslint-plugin': 8.50.1(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/parser': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.50.1(typescript@5.8.3) + '@typescript-eslint/utils': 8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.8.3) + eslint: 9.39.2(jiti@2.6.1) + typescript: 5.8.3 + transitivePeerDependencies: + - supports-color + typescript-eslint@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3): dependencies: '@typescript-eslint/eslint-plugin': 8.50.1(@typescript-eslint/parser@8.50.1(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3) @@ -16169,6 +16543,8 @@ snapshots: typescript-memoize@1.1.1: {} + typescript@5.8.3: {} + typescript@5.9.3: {} uc.micro@2.1.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index fa2cb848..298eb999 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -11,3 +11,4 @@ resolvePeersFromWorkspaceRoot: false packages: - . - docs + - my-addon-2 diff --git a/src/components/basic-dropdown.gts b/src/components/basic-dropdown.gts index 35e7f917..345332b0 100644 --- a/src/components/basic-dropdown.gts +++ b/src/components/basic-dropdown.gts @@ -215,6 +215,7 @@ export default class BasicDropdown< args: BasicDropdownArgs, ) { super(owner, args); + console.log(isTesting()); if (this.args.onInit) { this.args.onInit(this.publicAPI); }