Skip to content

Commit 51bb724

Browse files
Merge pull request #499 from emberjs/v2-addon
convert to a v2 addon using ember init
2 parents 26011df + 265e398 commit 51bb724

Some content is hidden

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

80 files changed

+16466
-18601
lines changed

.ember-cli

-15
This file was deleted.

.github/workflows/ci.yml

+28-45
Original file line numberDiff line numberDiff line change
@@ -18,62 +18,42 @@ jobs:
1818
timeout-minutes: 10
1919

2020
steps:
21-
- uses: actions/checkout@v3
22-
- name: Install Node
23-
uses: actions/setup-node@v3
21+
- uses: actions/checkout@v4
22+
- uses: pnpm/action-setup@v4
23+
- uses: actions/setup-node@v4
2424
with:
25-
node-version: 14.x
26-
cache: npm
25+
node-version: 18
26+
cache: pnpm
2727
- name: Install Dependencies
28-
run: npm ci
28+
run: pnpm install --frozen-lockfile
2929
- name: Lint
30-
run: npm run lint
30+
run: pnpm lint
3131
- name: Run Tests
32-
run: npm run test:ember
32+
run: pnpm test
3333

3434
floating:
3535
name: "Floating Dependencies"
3636
runs-on: ubuntu-latest
3737
timeout-minutes: 10
3838

3939
steps:
40-
- uses: actions/checkout@v3
41-
- uses: actions/setup-node@v3
40+
- uses: actions/checkout@v4
41+
- uses: pnpm/action-setup@v3
4242
with:
43-
node-version: 14.x
44-
cache: npm
43+
version: 8
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: 18
47+
cache: pnpm
4548
- name: Install Dependencies
46-
run: npm install --no-shrinkwrap
49+
run: pnpm install --no-lockfile
4750
- name: Run Tests
48-
run: npm run test:ember
49-
50-
test-os:
51-
name: Tests Full Matrix ${{ matrix.os }} Node version ${{ matrix.node }}
52-
runs-on: ${{ matrix.os }}
53-
54-
strategy:
55-
fail-fast: false
56-
matrix:
57-
node: ['10', '12', '14']
58-
os: [ubuntu-latest, windows-latest]
59-
60-
steps:
61-
- name: Checkout code
62-
uses: actions/checkout@v2
63-
- name: Install Node
64-
uses: actions/setup-node@v3
65-
with:
66-
node-version: ${{ matrix.node }}
67-
cache: npm
68-
- name: Install dependencies
69-
run: npm i
70-
- name: Test
71-
run: npm run test:ember
51+
run: pnpm test
7252

7353
try-scenarios:
7454
name: ${{ matrix.try-scenario }}
7555
runs-on: ubuntu-latest
76-
needs: "test"
56+
needs: 'test'
7757
timeout-minutes: 10
7858

7959
strategy:
@@ -86,20 +66,23 @@ jobs:
8666
- ember-lts-3.28
8767
- ember-lts-4.4
8868
- ember-lts-4.8
69+
- ember-lts-4.12
70+
- ember-lts-5.4
8971
- ember-release
9072
- ember-beta
9173
- ember-canary
9274
- embroider-safe
9375
- embroider-optimized
9476

9577
steps:
96-
- uses: actions/checkout@v3
97-
- name: Install Node
98-
uses: actions/setup-node@v3
78+
- uses: actions/checkout@v4
79+
- uses: pnpm/action-setup@v4
80+
- uses: actions/setup-node@v4
9981
with:
100-
node-version: 14.x
101-
cache: npm
82+
node-version: 18
83+
cache: pnpm
10284
- name: Install Dependencies
103-
run: npm ci
85+
run: pnpm install --frozen-lockfile
10486
- name: Run Tests
105-
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
87+
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }} --skip-cleanup
88+
working-directory: test-app

.github/workflows/plan-release.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,13 @@ jobs:
5454
- uses: actions/setup-node@v4
5555
with:
5656
node-version: 18
57-
58-
- run: npm ci
59-
57+
- uses: pnpm/action-setup@v4
58+
- run: pnpm install --frozen-lockfile
6059
- name: "Generate Explanation and Prep Changelogs"
6160
id: explanation
6261
run: |
6362
set +e
64-
65-
npx release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
66-
63+
pnpm release-plan prepare 2> >(tee -a release-plan-stderr.txt >&2)
6764
6865
if [ $? -ne 0 ]; then
6966
echo 'text<<EOF' >> $GITHUB_OUTPUT

.github/workflows/publish.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ jobs:
4949
node-version: 18
5050
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
5151
registry-url: 'https://registry.npmjs.org'
52-
53-
- run: npm ci
52+
- uses: pnpm/action-setup@v4
53+
- run: pnpm install --frozen-lockfile
5454
- name: npm publish
55-
run: npx release-plan publish
56-
55+
run: pnpm release-plan publish
5756
env:
5857
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
5958
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/push-dist.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
runs-on: ubuntu-latest
18+
timeout-minutes: 10
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: pnpm/action-setup@v3
23+
with:
24+
version: 8
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/put-built-npm-package-contents-on-branch@v2.0.0
32+
with:
33+
branch: dist
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
working-directory: 'ember-inflector'

.gitignore

+10-20
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,22 @@
11
# See https://help.github.com/ignore-files/ for more about ignoring files.
22

3-
# compiled output
4-
/dist/
5-
/tmp/
6-
73
# dependencies
8-
/bower_components/
9-
/node_modules/
4+
node_modules/
105

116
# misc
12-
/.env*
13-
/.pnp*
14-
/.sass-cache
15-
/.eslintcache
16-
/connect.lock
17-
/coverage/
18-
/libpeerconnection.log
19-
/npm-debug.log*
20-
/testem.log
21-
/yarn-error.log
7+
.env*
8+
.pnp*
9+
.pnpm-debug.log
10+
.sass-cache
11+
.eslintcache
12+
coverage/
13+
npm-debug.log*
14+
yarn-error.log
2215

2316
# ember-try
2417
/.node_modules.ember-try/
25-
/bower.json.ember-try
26-
/npm-shrinkwrap.json.ember-try
2718
/package.json.ember-try
2819
/package-lock.json.ember-try
2920
/yarn.lock.ember-try
21+
/pnpm-lock.ember-try.yaml
3022

31-
# broccoli-debug
32-
/DEBUG/

.npmignore

-41
This file was deleted.

.prettierignore

+3-18
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
1-
# unconventional js
2-
/blueprints/*/files/
3-
/vendor/
4-
5-
# compiled output
6-
/dist/
7-
/tmp/
8-
9-
# dependencies
10-
/bower_components/
11-
/node_modules/
1+
# Prettier is also run from each package, so the ignores here
2+
# protect against files that may not be within a package
123

134
# misc
14-
/coverage/
155
!.*
16-
.eslintcache
176
.lint-todo/
187

198
# ember-try
209
/.node_modules.ember-try/
21-
/bower.json.ember-try
22-
/npm-shrinkwrap.json.ember-try
23-
/package.json.ember-try
24-
/package-lock.json.ember-try
25-
/yarn.lock.ember-try
10+
/pnpm-lock.ember-try.yaml

.prettierrc.cjs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
'use strict';
2+
3+
module.exports = {
4+
plugins: ['prettier-plugin-ember-template-tag'],
5+
singleQuote: true,
6+
};

.watchmanconfig

-3
This file was deleted.

CONTRIBUTING.md

+17-11
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,30 @@
22

33
## Installation
44

5-
* `git clone <repository-url>`
6-
* `cd ember-inflector`
7-
* `npm install`
5+
- `git clone <repository-url>`
6+
- `cd ember-inflector`
7+
- `pnpm install`
88

99
## Linting
1010

11-
* `npm run lint`
12-
* `npm run lint:fix`
11+
- `pnpm lint`
12+
- `pnpm lint:fix`
13+
14+
## Building the addon
15+
16+
- `cd ember-inflector`
17+
- `pnpm build`
1318

1419
## Running tests
1520

16-
* `ember test` – Runs the test suite on the current Ember version
17-
* `ember test --server` – Runs the test suite in "watch mode"
18-
* `ember try:each` – Runs the test suite against multiple Ember versions
21+
- `cd test-app`
22+
- `pnpm test` – Runs the test suite on the current Ember version
23+
- `pnpm test:watch` – Runs the test suite in "watch mode"
1924

20-
## Running the dummy application
25+
## Running the test application
2126

22-
* `ember serve`
23-
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
27+
- `cd test-app`
28+
- `pnpm start`
29+
- Visit the test application at [http://localhost:4200](http://localhost:4200).
2430

2531
For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ Ember Inflector is a library for inflecting words between plural and singular fo
55

66
## Compatibility
77

8-
* Ember.js v3.16 or above
9-
* Ember CLI v2.13 or above
10-
* Node.js v10 or above
11-
8+
- Ember.js v3.16 or above
9+
- Embroider or ember-auto-import v2
1210

1311
## Installation
1412

@@ -77,7 +75,6 @@ Specify a count with the word, with the pluralization being based on the number
7775

7876
See the [Contributing](CONTRIBUTING.md) guide for details.
7977

80-
8178
## License
8279

8380
This project is licensed under the [MIT License](LICENSE.md).

app/helpers/pluralize.js

-2
This file was deleted.

app/helpers/singularize.js

-2
This file was deleted.

0 commit comments

Comments
 (0)