Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9be50a7
Install pnpm using instructions from https://pnpm.io/installation
bantic Jan 10, 2025
ae5450b
add preinstall script to prevent non-pnpm usage
bantic Jan 10, 2025
c16d4c6
add pnpm workspace yaml
bantic Jan 10, 2025
a410946
package.json: remove workspace since pnpm is used instead
bantic Jan 10, 2025
464f69c
run pnpm import
bantic Jan 10, 2025
ba467d3
remove yarn.lock
bantic Jan 10, 2025
14384e1
change specifiers to use workspace: prefix
bantic Jan 10, 2025
a5aaef6
mv rollup config to .mjs ext
bantic Jan 10, 2025
9d865b6
Switch to pnpm for ci
bantic Jan 10, 2025
a0e7677
continue-on-error for lint steps
bantic Jan 10, 2025
4f874fc
add missing ember-template-lint devdep to addon pkg
bantic Jan 10, 2025
ef35b9d
add missing eslint/js devdep to test-app
bantic Jan 10, 2025
5940b7d
Revert "continue-on-error for lint steps"
bantic Jan 10, 2025
7b1889d
test-app: empty app.css file to avoid build-time warning about missin…
bantic Jan 13, 2025
dd9ce8b
addon: package.json add test script that explains tests are elsewhere
bantic Jan 13, 2025
e149125
use broccoli-side-watch to sync test/doc-app rebuilds
bantic Jan 13, 2025
b9aeec7
addon: upgrade eslint 8 -> 9
bantic Jan 13, 2025
93e845f
for side-watch, lookup name from package.json
bantic Jan 13, 2025
e2cd9ae
update contributing.md
bantic Jan 13, 2025
8bcf805
addon: use ember-template-lint-plugin-prettier to run prettier on hbs…
bantic Jan 13, 2025
420bb4a
addon: add missing "globals" pkg for eslint
bantic Jan 13, 2025
a93972f
use volta in cli
bantic Jan 13, 2025
d689ce4
add volta pin
bantic Jan 13, 2025
1629547
workflow: remove temp print of pnpm,node version
bantic Jan 13, 2025
1fdab2a
workflow: enable pnpm caching
bantic Jan 13, 2025
0920b7b
minor update to contrib doc
bantic Jan 13, 2025
58f900c
workflow: enable pnpm caching, fix
bantic Jan 13, 2025
07a23fa
workflow: enable pnpm caching for all jobs
bantic Jan 13, 2025
8154080
workflow: dedupe the volta env by moving it to the workflow level rat…
bantic Jan 13, 2025
d542b77
corepack use pnpm@10
bantic Jan 13, 2025
53f93e6
workflow: drop volta pnpm env var
bantic Jan 13, 2025
6b99aed
add setup-pnpm action
bantic Jan 13, 2025
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
48 changes: 29 additions & 19 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,57 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
VOLTA_FEATURE_PNPM: 1

steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets up node, using the node version from package.json#volta.node

- id: pnpm-cache-path
run: echo "pnpm_cache_path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: node-cache
with:
path: "**/node_modules"
key: ${{ runner.os }}-ci-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache-path.outputs.pnpm_cache_path }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install Dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
run: pnpm install
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified that the cache is working correctly by reviewing a recent run:

image

- name: Lint Addon
working-directory: addon
run: yarn run lint
run: pnpm run lint
- name: Lint Test App
working-directory: test-app
run: yarn run lint
run: pnpm run lint
- name: Lint Docs App
working-directory: docs-app
run: yarn run lint
run: pnpm run lint

test-docs:
name: Test Docs
runs-on: ubuntu-latest
env:
VOLTA_FEATURE_PNPM: 1
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
- id: pnpm-cache-path
run: echo "pnpm_cache_path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-ci-yarn-${{ hashFiles('**/yarn.lock') }}
- run: yarn --frozen-lockfile
path: ${{ steps.pnpm-cache-path.outputs.pnpm_cache_path }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install Dependencies
run: pnpm install
- working-directory: addon
run: yarn run build
run: pnpm run build
- name: Run Tests
working-directory: docs-app
run: yarn run test
run: pnpm run test

test:
name: Run Ember Tests
runs-on: ubuntu-latest
env:
VOLTA_FEATURE_PNPM: 1
strategy:
fail-fast: false
matrix:
Expand All @@ -74,15 +83,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
- id: pnpm-cache-path
run: echo "pnpm_cache_path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-ci-yarn-${{ hashFiles('**/yarn.lock') }}-${{ matrix.ember-version }}
restore-keys: |
${{ runner.os }}-ci-yarn-${{ hashFiles('**/yarn.lock') }}-
- run: yarn --frozen-lockfile
path: ${{ steps.pnpm-cache-path.outputs.pnpm_cache_path }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install Dependencies
run: pnpm install
- working-directory: addon
run: yarn run build
run: pnpm run build
- name: Run Tests
working-directory: test-app
run: ./node_modules/.bin/ember try:one ${{ matrix.ember-version }} --skip-cleanup
51 changes: 38 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,51 @@
# How To Contribute

This repo is a monorepo, for additional instructions, refer to the package.json files in the workspaces,
or refer to the Github Workflow that runs CI.

## Installation

* `git clone <repository-url>`
* `cd ember-json-viewer`
* `npm install`
- `git clone <repository-url>`
- `cd ember-json-viewer`
- `pnpm install`

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`
Each workspace has a `lint` run-script.
You can run them all via:

```
pnpm --filter '*' lint
```

## Running tests

* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions
In one terminal, start the addon build:

```
cd addon/ && pnpm start
```

In another terminal, start the test-app build:

```
cd test-app/ && pnpm start
```

Visit the tests in the browser at localhost:4200/tests.

Alternatively, run tests via CLI with: `cd test-app/ && pnpm test`

## Running the docs application

Start the addon build in another terminal window:

## Running the dummy application
```
cd addon/ && pnpm start
```

* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
Then start the docs app:

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
```
cd docs-app/ && pnpm start
```
14 changes: 0 additions & 14 deletions addon/.eslintignore

This file was deleted.

47 changes: 0 additions & 47 deletions addon/.eslintrc.js

This file was deleted.

3 changes: 2 additions & 1 deletion addon/.template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict';

module.exports = {
extends: 'recommended',
plugins: ['ember-template-lint-plugin-prettier'],
extends: ['recommended', 'ember-template-lint-plugin-prettier:recommended'],
rules: {
'no-triple-curlies': false,
'no-invalid-interactive': false,
Expand Down
115 changes: 115 additions & 0 deletions addon/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to upgrade eslint 8 to 9 for the addon/ dir, copied with minor changes from test-app's eslint config

* 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 globals from "globals";
import js from "@eslint/js";

import ember from "eslint-plugin-ember/recommended";
import prettier from "eslint-plugin-prettier/recommended";
import n from "eslint-plugin-n";

import babelParser from "@babel/eslint-parser";

const esmParserOptions = {
ecmaFeatures: { modules: true },
ecmaVersion: "latest",
requireConfigFile: false,
babelOptions: {
plugins: [
["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }],
],
},
};

export default [
js.configs.recommended,
prettier,
ember.configs.base,
ember.configs.gjs,
/**
* Ignores must be in their own object
* https://eslint.org/docs/latest/use/configure/ignore
*/
{
ignores: ["dist/", "node_modules/", "coverage/", "!**/.*"],
},
/**
* 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,
},
},
},
/**
* CJS node files
*/
{
files: [
"**/*.cjs",
"config/**/*.js",
"testem.js",
"testem*.js",
".prettierrc.js",
".stylelintrc.js",
".template-lintrc.js",
"ember-cli-build.js",
"addon-main.js",
],
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,
},
},
},
];
10 changes: 7 additions & 3 deletions addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"lint:js:fix": "eslint . --fix",
"build": "rollup --config",
"prepublishOnly": "rollup --config",
"start": "rollup --config --watch"
"start": "rollup --config --watch",
"test": "echo 'v2 addons do not have tests, run tests for the test-app instead'"
},
"dependencies": {
"@embroider/addon-shim": "^1.9.0",
Expand All @@ -45,14 +46,17 @@
"@babel/plugin-proposal-decorators": "^7.25.9",
"@babel/plugin-transform-class-properties": "^7.25.9",
"@embroider/addon-dev": "^7.1.1",
"@eslint/js": "^9.17.0",
"@rollup/plugin-babel": "^6.0.4",
"concurrently": "^9.1.0",
"eslint": "^8.0.0",
"ember-template-lint": "^6.0.0",
"ember-template-lint-plugin-prettier": "^5.0.0",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.3.3",
"eslint-plugin-n": "^17.15.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-qunit": "^8.1.2",
"globals": "^15.14.0",
"prettier": "^3.4.2",
"rollup": "^4.30.1"
},
Expand Down
Loading
Loading