Skip to content

Commit

Permalink
Merge pull request #618 from buschtoens/pnpm
Browse files Browse the repository at this point in the history
pnpm
  • Loading branch information
SergeAstapov authored Jul 9, 2024
2 parents 3a85985 + 6b4bcdc commit d4b02ea
Show file tree
Hide file tree
Showing 15 changed files with 11,857 additions and 13,875 deletions.
41 changes: 24 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,39 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache: pnpm
- name: Install Dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Lint
run: npm run lint
run: pnpm lint
- name: Run Tests
run: npm run test:ember
run: pnpm test

floating:
name: "Floating Dependencies"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache: pnpm
- name: Install Dependencies
run: npm install --no-shrinkwrap
run: pnpm install --no-lockfile
- name: Run Tests
run: npm run test:ember
run: pnpm test

try-scenarios:
name: ${{ matrix.try-scenario }}
Expand All @@ -66,13 +71,15 @@ jobs:
- embroider-optimized

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
cache: pnpm
- name: Install Dependencies
run: npm ci
run: pnpm install --frozen-lockfile
- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
33 changes: 33 additions & 0 deletions .github/workflows/push-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- uses: kategengler/[email protected]
with:
branch: dist
token: ${{ secrets.GITHUB_TOKEN }}
working-directory: 'ember-lazy-mount'
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
/.idea/

# dependencies
/node_modules/

# 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
9 changes: 9 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Docs: https://pnpm.io/npmrc
# https://github.com/emberjs/rfcs/pull/907

# we don't want addons to be bad citizens of the ecosystem
auto-install-peers=false

# we want true isolation,
# if a dependency is not declared, we want an error
resolve-peers-from-workspace-root=false
30 changes: 17 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,29 @@

## Installation

- `git clone <repository-url>`
- `cd my-addon`
- `npm install`
- `git clone [email protected]:buschtoens/ember-lazy-mount.git`
- `cd ember-lazy-mount`
- `pnpm install`

## Linting

- `npm run lint:hbs`
* `npm run lint:js`
- `npm run lint:js -- --fix`
Inside any of the packages you can run:

- `pnpm lint`
- `pnpm lint:fix`

## Running tests

- `npm run test` – Runs the test suite on the current Ember version
- `npm run test:ember -- --server` – Runs the test suite in "watch mode"
- `npm run test:ember-compatibility` – Runs the test suite against multiple Ember versions
- `cd ember-lazy-mount && pnpm start` – Builds the addon in "watch mode" so changes picked up by test app.
- `cd test-app && ember test` – Runs the test suite on the current Ember version
- `cd test-app && ember test --server` – Runs the test suite in "watch mode"
- `cd test-app && ember try:each` – Runs the test suite against multiple Ember versions

## Running the dummy application
During development, if you'd like test app to pick up changes in the addon, make sure to run both
`cd ember-lazy-mount && pnpm start` and `cd test-app && ember test --server` in different terminals.

- `npm run start`
- Visit the dummy application at [http://localhost:4200](http://localhost:4200).
## Running the test application

For more information on using ember-cli, visit [https://cli.emberjs.com/release/](https://cli.emberjs.com/release/).
- `cd test-app && ember serve`
- 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/).
18 changes: 7 additions & 11 deletions ember-lazy-mount/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,27 @@
"@babel/eslint-parser": "^7.24.7",
"@babel/plugin-proposal-decorators": "^7.24.7",
"@ember/optional-features": "^2.1.0",
"@glimmer/component": "^1.1.2",
"broccoli-asset-rev": "^3.0.0",
"concurrently": "^8.2.2",
"ember-cli": "~5.10.0",
"ember-cli-clean-css": "^3.0.0",
"ember-cli-dependency-checker": "^3.3.2",
"ember-cli-htmlbars-inline-precompile": "^3.0.2",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-sri": "^2.1.1",
"ember-cli-uglify": "^3.0.0",
"ember-load-initializers": "^2.1.2",
"ember-qunit": "^8.1.0",
"ember-resolver": "^11.0.1",
"ember-resolver": "^12.0.1",
"ember-source": "~5.10.0",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^5.13.0",
"ember-try": "^3.0.0",
"ember-template-lint": "^6.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^11.12.0",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-ember": "^12.1.1",
"eslint-plugin-n": "^17.9.0",
"eslint-plugin-prettier": "^5.1.3",
"loader.js": "^4.7.0",
"lodash.frompairs": "^4.0.1",
"prettier": "^3.3.2",
"qunit-dom": "^2.0.0",
"rsvp": "^4.8.5",
"qunit-dom": "^3.2.0",
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.1.0",
Expand Down
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
"test-engine"
],
"scripts": {
"build": "yarn workspace ember-lazy-mount run build",
"lint": "yarn workspaces run lint",
"lint:fix": "yarn workspaces run lint:fix",
"prepare": "yarn build",
"start": "concurrently 'yarn:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "yarn workspace ember-lazy-mount run start",
"start:test-app": "yarn workspace test-app run start",
"test": "yarn workspaces run test",
"test:ember": "yarn workspace test-app run test:ember"
"build": "concurrently 'pnpm:build:*'",
"build:js": "rollup --config",
"build:types": "glint --declaration",
"lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"prepack": "concurrently 'pnpm:build:*'",
"start": "concurrently 'pnpm: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'"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"packageManager": "[email protected]",
"volta": {
"node": "18.20.4"
},
"dependencies": {}
}
}
Loading

0 comments on commit d4b02ea

Please sign in to comment.