Skip to content

Commit beffdc1

Browse files
aklkvRobbieTheWagnermansona
authored
Convert to the new v2 addon format and add TS types (#352)
* feat: v2 addon * Fix lint/types * Add more try scenarios * Add @ember/string back * Update .try.mjs * Update .npmrc * Update .try.mjs * Update .try.mjs * Update .try.mjs * Update .try.mjs * Update .try.mjs * Update .try.mjs * Update .try.mjs * Update .try.mjs * Update .try.mjs * Update .try.mjs * Update package.json * Update package.json * fix minimum ember-cli version * fix 3.28 tests * Delete .npmrc * Tweak npmrc * Update .npmrc * Update .npmrc * Put back magic npmrc * Update .npmrc * Change some things --------- Co-authored-by: Robbie Wagner <[email protected]> Co-authored-by: Chris Manson <[email protected]>
1 parent 2b328d4 commit beffdc1

File tree

112 files changed

+3619
-4424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+3619
-4424
lines changed

.ember-cli

Lines changed: 0 additions & 7 deletions
This file was deleted.

.env.development

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file is committed to git and should not contain any secrets.
2+
#
3+
# Vite recommends using .env.local or .env.[mode].local if you need to manage secrets
4+
# SEE: https://vite.dev/guide/env-and-mode.html#env-files for more information.
5+
6+
7+
# Default NODE_ENV with vite build --mode=test is production
8+
NODE_ENV=development

.eslintignore

Lines changed: 0 additions & 14 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ updates:
1111
ignore:
1212
- dependency-name: ember-cli
1313
versions:
14-
- ">= 0"
14+
- ">= 0"

.github/workflows/ci.yml

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,46 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
test:
16-
name: "Tests"
15+
lint:
16+
name: "Lints"
1717
runs-on: ubuntu-latest
1818
timeout-minutes: 10
1919

2020
steps:
2121
- uses: actions/checkout@v4
2222
- uses: pnpm/action-setup@v4
23+
- uses: actions/setup-node@v4
2324
with:
24-
version: 10
25-
- name: Install Node
26-
uses: actions/setup-node@v4
27-
with:
28-
node-version: 20
25+
node-version-file: package.json
2926
cache: pnpm
3027
- name: Install Dependencies
3128
run: pnpm install --frozen-lockfile
3229
- name: Lint
3330
run: pnpm lint
31+
32+
test:
33+
name: "Tests"
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 10
36+
outputs:
37+
matrix: ${{ steps.set-matrix.outputs.matrix }}
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: pnpm/action-setup@v4
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version-file: package.json
45+
cache: pnpm
46+
- name: Install Dependencies
47+
run: pnpm install --frozen-lockfile
3448
- name: Run Tests
35-
run: pnpm test:ember
49+
run: pnpm test
50+
# For the Try Scenarios
51+
- id: set-matrix
52+
run: |
53+
echo "matrix=$(pnpm -s dlx @embroider/try list)" >> $GITHUB_OUTPUT
54+
3655
3756
floating:
3857
name: "Floating Dependencies"
@@ -42,49 +61,39 @@ jobs:
4261
steps:
4362
- uses: actions/checkout@v4
4463
- uses: pnpm/action-setup@v4
45-
with:
46-
version: 10
4764
- uses: actions/setup-node@v4
4865
with:
49-
node-version: 20
66+
node-version-file: package.json
5067
cache: pnpm
5168
- name: Install Dependencies
5269
run: pnpm install --no-lockfile
5370
- name: Run Tests
54-
run: pnpm test:ember
71+
run: pnpm test
5572

5673
try-scenarios:
57-
name: ${{ matrix.try-scenario }}
74+
name: ${{ matrix.name }}
5875
runs-on: ubuntu-latest
5976
needs: "test"
6077
timeout-minutes: 10
61-
6278
strategy:
6379
fail-fast: false
64-
matrix:
65-
try-scenario:
66-
- ember-lts-3.28
67-
- ember-lts-4.4
68-
- ember-lts-4.8
69-
- ember-lts-4.12
70-
- ember-lts-5.4
71-
- ember-release
72-
- ember-beta
73-
- ember-canary
74-
- embroider-safe
75-
- embroider-optimized
80+
matrix: ${{fromJson(needs.test.outputs.matrix)}}
7681

7782
steps:
7883
- uses: actions/checkout@v4
7984
- uses: pnpm/action-setup@v4
85+
- uses: actions/setup-node@v4
8086
with:
81-
version: 10
82-
- name: Install Node
83-
uses: actions/setup-node@v4
84-
with:
85-
node-version: 20
87+
node-version-file: package.json
8688
cache: pnpm
89+
- name: Apply Scenario
90+
run: |
91+
pnpm dlx @embroider/try apply ${{ matrix.name }}
92+
8793
- name: Install Dependencies
88-
run: pnpm install --frozen-lockfile
94+
run: pnpm install --no-lockfile
8995
- name: Run Tests
90-
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
96+
run: |
97+
pnpm test
98+
99+
env: ${{ matrix.env }}

.github/workflows/plan-release.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,19 @@ jobs:
5656
version: 10
5757
- uses: actions/setup-node@v4
5858
with:
59-
node-version: 20
59+
node-version-file: package.json
6060
cache: pnpm
6161
- run: pnpm install --frozen-lockfile
6262
- name: "Generate Explanation and Prep Changelogs"
6363
id: explanation
6464
run: |
6565
set +e
6666
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
67-
6867
if [ $? -ne 0 ]; then
6968
release_plan_output=$(cat release-plan-stderr.txt)
7069
else
7170
release_plan_output=$(jq .description .release-plan.json -r)
7271
rm release-plan-stderr.txt
73-
7472
if [ $(jq '.solution | length' .release-plan.json) -eq 1 ]; then
7573
new_version=$(jq -r '.solution[].newVersion' .release-plan.json)
7674
echo "new_version=v$new_version" >> $GITHUB_OUTPUT
@@ -90,7 +88,5 @@ jobs:
9088
title: Prepare Release ${{ steps.explanation.outputs.new_version }}
9189
body: |
9290
This PR is a preview of the release that [release-plan](https://github.com/embroider-build/release-plan) has prepared. To release you should just merge this PR 👍
93-
9491
-----------------------------------------
95-
9692
${{ steps.explanation.outputs.text }}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
version: 10
3434
- uses: actions/setup-node@v4
3535
with:
36-
node-version: 20
36+
node-version-file: package.json
3737
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
3838
registry-url: 'https://registry.npmjs.org'
3939
cache: pnpm

.github/workflows/push-dist.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Because this library needs to be built,
2+
# we can't easily point package.json files at the git repo for easy cross-repo testing.
3+
#
4+
# This workflow brings back that capability by placing the compiled assets on a "dist" branch
5+
# (configurable via the "branch" option below)
6+
name: Push dist
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- master
13+
14+
jobs:
15+
push-dist:
16+
name: Push dist
17+
permissions:
18+
contents: write
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: pnpm/action-setup@v4
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 18
28+
cache: pnpm
29+
- name: Install Dependencies
30+
run: pnpm install --frozen-lockfile
31+
- uses: kategengler/[email protected]
32+
with:
33+
branch: dist
34+
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
# compiled output
2-
/dist/
3-
/declarations/
2+
dist/
3+
dist-tests/
4+
declarations/
45

5-
# dependencies
6-
/node_modules/
6+
# from scenarios
7+
tmp/
8+
config/optional-features.json
9+
ember-cli-build.js
710

8-
# misc
9-
/.env*
10-
/.pnp*
11-
/.eslintcache
12-
/coverage/
13-
/npm-debug.log*
14-
/testem.log
15-
/yarn-error.log
11+
# npm/pnpm/yarn pack output
12+
*.tgz
1613

17-
# ember-try
18-
/.node_modules.ember-try/
19-
/npm-shrinkwrap.json.ember-try
20-
/package.json.ember-try
21-
/package-lock.json.ember-try
22-
/yarn.lock.ember-try
23-
24-
# broccoli-debug
25-
/DEBUG/
14+
# deps & caches
15+
node_modules/
16+
.eslintcache
17+
.prettiercache

0 commit comments

Comments
 (0)