Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 8302b55

Browse files
authored
Npm migration (#201)
* use package-lock * Migrate tooling to use npm * Fix some commands to use npx; add changelog
1 parent 0152f3d commit 8302b55

File tree

15 files changed

+35589
-10724
lines changed

15 files changed

+35589
-10724
lines changed

.changeset/three-pots-brush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/hydrogen-react': patch
3+
---
4+
5+
(Internal) Migrate from `yarn` to `npm`

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
- [ ] Read the [Contributing Guidelines](https://github.com/Shopify/hydrogen-react/blob/main/CONTRIBUTING.md)
1616
- [ ] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`)
17-
- [ ] Update docs in this repository according to your change, and run `yarn build-docs` in the `packages/react` folder.
18-
- [ ] Run `yarn changeset add` if this PR cause a version bump based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). If you have a breaking change, it will need to wait until the next major version release. Otherwise, use patch updates even for new features. Read [more about Hydrogen React's versioning](https://github.com/shopify/hydrogen-react/blob/main/readme.md#versioning).
17+
- [ ] Update docs in this repository according to your change, and run `npm run build-docs` in the `packages/react` folder.
18+
- [ ] Run `npx changeset add` if this PR cause a version bump based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). If you have a breaking change, it will need to wait until the next major version release. Otherwise, use patch updates even for new features. Read [more about Hydrogen React's versioning](https://github.com/shopify/hydrogen-react/blob/main/readme.md#versioning).

.github/workflows/changesets_reminder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ jobs:
1616
changelogRegex: "\\.changeset"
1717
message: |
1818
We detected some changes in `packages/*/package.json` or `packages/*/src`, and there are no updates in the `.changeset`.
19-
If the changes are user-facing and should cause a version bump, run `yarn changeset add` to track your changes and include them in the next release CHANGELOG.
19+
If the changes are user-facing and should cause a version bump, run `npx changeset add` to track your changes and include them in the next release CHANGELOG.
2020
If you are making simple updates to examples or documentation, you do not need to add a changeset. Please also read how [Hydrogen React does versioning](https://github.com/shopify/hydrogen-react/blob/main/readme.md#versioning).

.github/workflows/releases.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ jobs:
3131
uses: actions/setup-node@v3
3232
with:
3333
node-version-file: '.nvmrc'
34-
cache: 'yarn'
34+
cache: 'npm'
3535

3636
- name: Install the packages
37-
run: yarn install --frozen-lockfile --ignore-engines
37+
run: npm ci
3838

3939
- name: (latest) Create Release Pull Request or Publish
4040
if: env.latest == 'true'
4141
id: changesets
4242
uses: changesets/action@v1
4343
with:
44-
publish: yarn changeset publish
44+
publish: npx changeset publish
4545
commit: '[ci] release ${{ github.ref_name }}'
4646
title: '[ci] release ${{ github.ref_name }}'
4747
env:
@@ -53,7 +53,7 @@ jobs:
5353
id: changesets_legacy
5454
uses: changesets/action@v1
5555
with:
56-
publish: yarn changeset publish --tag legacy
56+
publish: npx changeset publish --tag legacy
5757
commit: '[ci] release ${{ github.ref_name }}'
5858
title: '[ci] release ${{ github.ref_name }}'
5959
env:

.github/workflows/test_and_lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ jobs:
3434
uses: actions/setup-node@v3
3535
with:
3636
node-version-file: '.nvmrc'
37-
cache: 'yarn'
37+
cache: 'npm'
3838

3939
- name: Install the packages
40-
run: yarn install --frozen-lockfile
40+
run: npm ci
4141

4242
- name: Run CI checks
43-
run: yarn ci:checks
43+
run: npm run ci:checks
4444

4545
- name: Build the code
46-
run: yarn build
46+
run: npm run build

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
There are two ways you can develop Hydrogen React components:
44

55
- Develop components in isolation (faster & easier):
6-
1. Run `yarn dev:story` in the `packages/react` directory to spin up an instance of [Ladle](https://ladle.dev/)
6+
1. Run `npm run dev:story` in the `packages/react` directory to spin up an instance of [Ladle](https://ladle.dev/)
77
2. Edit the component or the component's story `[ComponentName].stories.tsx`
88
- Develop components in a demo app (good for testing out the ecosystem support)
9-
1. Run `yarn dev`
9+
1. Run `npm run dev`
1010

1111
## Authoring Components
1212

@@ -46,7 +46,7 @@ Documentation lives in the `*.doc.ts` files, and uses a Shopify library called `
4646
After adding or updating docs, you'll need to:
4747

4848
1. `cd` into `packages/react` folder
49-
1. Run `yarn build-docs`
49+
1. Run `npm run build-docs`
5050

5151
Which will update the generated output, and then will be picked up by the Shopify website on a regular cadence.
5252

@@ -56,7 +56,7 @@ For most contributions, this should be enough information to work off of. Howeve
5656

5757
## Running CI Checks Locally
5858

59-
Every PR must pass certain CI checks in order to be merged; you can run these checks locally yourself by running `yarn ci:checks` from the root of the repo.
59+
Every PR must pass certain CI checks in order to be merged; you can run these checks locally yourself by running `npm run ci:checks` from the root of the repo.
6060

6161
## Package Exports Notes:
6262

0 commit comments

Comments
 (0)