Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions my-addon-2/.editorconfig
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions my-addon-2/.env.development
Original file line number Diff line number Diff line change
@@ -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
99 changes: 99 additions & 0 deletions my-addon-2/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}
34 changes: 34 additions & 0 deletions my-addon-2/.github/workflows/push-dist.yml
Original file line number Diff line number Diff line change
@@ -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 }}
17 changes: 17 additions & 0 deletions my-addon-2/.gitignore
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions my-addon-2/.prettierignore
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions my-addon-2/.prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -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,
},
},
],
};
4 changes: 4 additions & 0 deletions my-addon-2/.template-lintrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
extends: 'recommended',
checkHbsTemplateLiterals: false,
};
87 changes: 87 additions & 0 deletions my-addon-2/.try.mjs
Original file line number Diff line number Diff line change
@@ -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',
},
},
},
],
};
28 changes: 28 additions & 0 deletions my-addon-2/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# How To Contribute

## Installation

- `git clone <repository-url>`
- `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/).
9 changes: 9 additions & 0 deletions my-addon-2/LICENSE.md
Original file line number Diff line number Diff line change
@@ -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.
26 changes: 26 additions & 0 deletions my-addon-2/README.md
Original file line number Diff line number Diff line change
@@ -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).
4 changes: 4 additions & 0 deletions my-addon-2/addon-main.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
'use strict';

const { addonV1Shim } = require('@embroider/addon-shim');
module.exports = addonV1Shim(__dirname);
Loading
Loading