Skip to content

Use NPM instead of Yarn #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 28, 2022
Merged
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
63 changes: 23 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,59 @@ on:
pull_request:

env:
NODE_VERSION: 12
NODE_VERSION: 14
PERCY_PARALLEL_NONCE: ${{ github.run_id }}-${{ github.run_number }}
PERCY_PARALLEL_TOTAL: 1

jobs:
lint:
name: Lint files
runs-on: ubuntu-latest
timeout-minutes: 3
timeout-minutes: 5
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js 14
uses: volta-cli/action@v4
- name: Check lockfile version
uses: mansona/npm-lockfile-version@v1

- name: Get Yarn cache path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache Yarn cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-${{ env.NODE_VERSION }}-
cache: 'npm'
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@9

- name: Install dependencies
run: yarn install --frozen-lockfile
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: npm ci

- name: Lint
run: yarn lint
run: npm run lint


test-app:
name: Test app
runs-on: ubuntu-latest
timeout-minutes: 7
timeout-minutes: 10
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v2

- name: Use Node.js 14
uses: volta-cli/action@v4
uses: actions/checkout@v3

- name: Get Yarn cache path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache Yarn cache and node_modules
id: cache-dependencies
uses: actions/cache@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
key: ${{ runner.os }}-14-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-14-
cache: 'npm'
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@9

- name: Install dependencies
run: yarn install --frozen-lockfile
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: npm ci

- name: Test
env:
PERCY_PARALLEL_NONCE: ${{ env.PERCY_PARALLEL_NONCE }}
PERCY_PARALLEL_TOTAL: ${{ env.PERCY_PARALLEL_TOTAL }}
PERCY_TOKEN: 5ad6687f6b1ad3dec2b964f94d3d59ff3880baccf1492c0663e85c1ce79c1a52
run: yarn run percy exec -- yarn test:ember
run: npx percy exec -- npm run test:ember
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ terraform.tfstate.backup
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log

public/json-docs/
public/rev-index/
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ clone the latest ember.js api docs from github
cd to the cloned ember-api-docs directory
- cd ember-api-docs

ensure Node.js and yarn are installed
ensure Node.js and npm are installed

follow these commands to build ember.js
- yarn install
- yarn run build
- npm install
- npm build
```

## Development steps

1. Follow the setup steps listed above under [Building Ember.js API](#building-emberjs-api-docs).

2. To start the development server, run `yarn start`.
2. To start the development server, run `npm start`.

3. To run all tests run `yarn test`
3. To run all tests run `npm test`

4. To run the app with fastboot cli like our server deployment run the following commands,
```
Expand All @@ -106,7 +106,7 @@ We love pull requests. Here's a quick guide:
1. Fork the repo.

2. Run the tests. We only take pull requests with passing tests, and it's great
to know that you have a clean slate: `yarn install && yarn test`.
to know that you have a clean slate: `npm install && npm test`.

3. Add a test for your change. Only refactoring and documentation changes
require no new tests. If you are adding functionality or fixing a bug, we need
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ locally yourself.
```
git clone https://github.com/ember-learn/ember-api-docs.git
cd ember-api-docs
yarn install
npm install
ember serve
```
View at http://localhost:4200
Expand All @@ -53,9 +53,9 @@ To run a11y tests, run `test_a11y=yes ember serve`

## Linting

* `yarn run lint:hbs`
* `yarn run lint:js`
* `yarn run lint:js -- --fix`
* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`

## Staging and Deployment

Expand Down
1 change: 0 additions & 1 deletion config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"codemodsSource": "ember-app-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--yarn",
"--no-welcome"
]
}
Expand Down
Loading