Skip to content

Commit 777301b

Browse files
authored
Merge pull request #140 from rangle/nx-migrate
Change from yarn to npm, run nx migration, and fix the resulting issues.
2 parents bd109c8 + dc1774e commit 777301b

Some content is hidden

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

61 files changed

+44537
-21144
lines changed

.github/workflows/build-chromatic.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: actions/setup-node@v3
3434
with:
3535
node-version: ${{ matrix.node-version }}
36-
cache: 'yarn'
36+
cache: 'npm'
3737

3838
# Cache node_modules to speed up future builds
3939
# For more info see: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
@@ -44,30 +44,30 @@ jobs:
4444
cache-name: cache-node-modules
4545
with:
4646
path: node_modules
47-
key: ${{ runner.os }}-build-${{ env.cache.name }}-${{ github.head_ref }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
47+
key: ${{ runner.os }}-build-${{ env.cache.name }}-${{ github.head_ref }}-${{ hashFiles('**/package-lock.json', '**/package.json') }}
4848
restore-keys: |
4949
${{ runner.os }}-build-${{ env.cache.name }}-${{ github.head_ref }}-
5050
${{ runner.os }}-build-${{ env.cache.name }}-main-
5151
${{ runner.os }}-build-${{ env.cache.name }}-
5252
${{ runner.os }}-build-
5353
${{ runner.os }}-
5454
55-
# Only install dependencies if cached dependencies aren't found (applies when content of yarn.lock or any package.json changes)
55+
# Only install dependencies if cached dependencies aren't found (applies when content of package-lock.json or any package.json changes)
5656
- name: Install Dependencies
5757
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
58-
run: yarn install --frozen-lockfile
58+
run: npm ci
5959

6060
- name: Validate tokens
6161
id: validate-tokens
6262
run: |
6363
# Parse and Validate Design Tokens
64-
yarn tokens:ci
64+
npm run tokens:ci
6565
6666
- name: Build projects 🏗
6767
run: npx nx run demo:build --skip-nx-cache
6868

6969
- name: Lint
70-
run: yarn lint:ci
70+
run: npm run lint:ci
7171

7272
- name: Test
7373
run: npx nx affected --parallel=2 --target=test --coverage --skip-nx-cache

.github/workflows/build-storybook.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ jobs:
2424
path: |
2525
~/.npm
2626
~/.cache
27-
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
27+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
2828
restore-keys: |
2929
${{ runner.os }}-node-
3030
3131
- name: Use Node.js ${{ matrix.node-version }}
3232
uses: actions/setup-node@v3
3333
with:
3434
node-version: ${{ matrix.node-version }}
35-
cache: 'yarn'
35+
cache: 'npm'
3636

3737
- name: get-npm-version
3838
id: package-version
@@ -41,7 +41,7 @@ jobs:
4141
path: libs/foundations
4242

4343
- name: Install dependencies
44-
run: yarn install --frozen-lockfile
44+
run: npm ci
4545

4646
- name: Build storybook static site
4747
env:

.github/workflows/deployment-pr.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/setup-node@v3
2121
with:
2222
node-version: ${{ matrix.node-version }}
23-
cache: 'yarn'
23+
cache: 'npm'
2424

2525
# Cache node_modules to speed up future builds
2626
# For more info see: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
@@ -31,27 +31,27 @@ jobs:
3131
cache-name: cache-node-modules
3232
with:
3333
path: node_modules
34-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
34+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/package.json') }}
3535
restore-keys: |
3636
${{ runner.os }}-build-${{ env.cache-name }}-
3737
${{ runner.os }}-build-
3838
${{ runner.os }}-
39-
# Only install dependencies if cached dependencies aren't found (applies when content of yarn.lock or any package.json changes)
39+
# Only install dependencies if cached dependencies aren't found (applies when content of package-lock.json or any package.json changes)
4040
- name: Install Dependencies
4141
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
42-
run: yarn install --frozen-lockfile
42+
run: npm ci
4343

4444
- name: Validate tokens
4545
id: validate-tokens
4646
run: |
4747
# Parse and Validate Design Tokens
48-
yarn tokens:ci
48+
npm run tokens:ci
4949
5050
- name: Build Demo App
5151
run: npx nx run demo:build --skip-nx-cache
5252

5353
- name: Lint
54-
run: yarn lint:ci
54+
run: npm run lint:ci
5555

5656
- name: Configure AWS credentials for deployment
5757
uses: aws-actions/configure-aws-credentials@v2
@@ -62,7 +62,7 @@ jobs:
6262

6363
## Deploy remix demo app with SST
6464
- name: Deploy Demo App to AWS
65-
run: yarn sst deploy --stage radius-pr
65+
run: npx sst deploy --stage radius-pr
6666

6767
# Find existing Demo App comment
6868
- name: Find Existing Comment

.github/workflows/deployment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
path: |
2424
~/.npm
2525
~/.cache
26-
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
26+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
2727
restore-keys: |
2828
${{ runner.os }}-node-
2929
@@ -34,10 +34,10 @@ jobs:
3434
uses: actions/setup-node@v3
3535
with:
3636
node-version: ${{ matrix.node-version }}
37-
cache: 'yarn'
37+
cache: 'npm'
3838

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

4242
- name: Build Demo App
4343
run: npx nx run demo:build --skip-nx-cache
@@ -55,4 +55,4 @@ jobs:
5555

5656
## Deploy remix demo app with SST
5757
- name: Deploy Demo App to AWS
58-
run: yarn sst deploy --stage prod
58+
run: npx sst deploy --stage prod

.github/workflows/main-cache.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Update Main Cache
22

33
# This workflow is responsible for maintaining an updated cache of node_modules on the 'main' branch.
44
# It's triggered on every push to the 'main' branch. It checks out the code, sets up Node.js, and caches
5-
# the node_modules folder, using a key that is specific to the 'main' branch and the hash of the 'yarn.lock' file.
6-
# If the 'yarn.lock' file has not changed since the last push to 'main', the existing cache will be reused.
7-
# If the 'yarn.lock' file has changed, a new cache will be created. This ensures that the cache is always
8-
# up-to-date with the latest dependencies defined in 'yarn.lock'. This cache can then be used by workflows
5+
# the node_modules folder, using a key that is specific to the 'main' branch and the hash of the 'package-lock.json' file.
6+
# If the 'package-lock.json' file has not changed since the last push to 'main', the existing cache will be reused.
7+
# If the 'package-lock.json' file has changed, a new cache will be created. This ensures that the cache is always
8+
# up-to-date with the latest dependencies defined in 'package-lock.json'. This cache can then be used by workflows
99
# in pull requests to speed up the build process by reusing the installed dependencies.
1010

1111
on:
@@ -33,7 +33,7 @@ jobs:
3333
uses: actions/setup-node@v3
3434
with:
3535
node-version: ${{ matrix.node-version }}
36-
cache: 'yarn'
36+
cache: 'npm'
3737

3838
# Cache node_modules to speed up future builds
3939
- name: Cache node modules
@@ -43,12 +43,12 @@ jobs:
4343
cache-name: cache-node-modules
4444
with:
4545
path: node_modules
46-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
46+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json', '**/package.json') }}
4747
restore-keys: |
4848
${{ runner.os }}-build-${{ env.cache-name }}-
4949
${{ runner.os }}-build-
5050
${{ runner.os }}-
5151
5252
# Install dependencies to update the cache
5353
- name: Install Dependencies
54-
run: yarn install --frozen-lockfile
54+
run: npm ci

.github/workflows/merge-chromatic.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/setup-node@v3
3232
with:
3333
node-version: ${{ matrix.node-version }}
34-
cache: 'yarn'
34+
cache: 'npm'
3535

3636
# Cache node_modules to speed up future builds
3737
# For more info see: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
@@ -42,24 +42,24 @@ jobs:
4242
cache-name: cache-node-modules
4343
with:
4444
path: node_modules
45-
key: ${{ runner.os }}-build-${{ env.cache.name }}-${{ github.head_ref }}-${{ hashFiles('**/yarn.lock') }}
45+
key: ${{ runner.os }}-build-${{ env.cache.name }}-${{ github.head_ref }}-${{ hashFiles('**/package-lock.json') }}
4646
restore-keys: |
4747
${{ runner.os }}-build-${{ env.cache.name }}-${{ github.head_ref }}-
4848
${{ runner.os }}-build-${{ env.cache.name }}-main-
4949
${{ runner.os }}-build-${{ env.cache.name }}-
5050
${{ runner.os }}-build-
5151
${{ runner.os }}-
5252
53-
# Only install dependencies if cached dependencies aren't found (applies when content of yarn.lock changes)
53+
# Only install dependencies if cached dependencies aren't found (applies when content of package-lock.json changes)
5454
- name: Install Dependencies
5555
if: ${{ steps.cache-nodemodules.outputs.cache-hit != 'true' }}
56-
run: yarn install --frozen-lockfile
56+
run: npm ci
5757

5858
- name: Validate tokens
5959
id: validate-tokens
6060
run: |
6161
# Parse and Validate Design Tokens
62-
yarn tokens:ci
62+
npm run tokens:ci
6363
6464
- name: Build projects 🏗
6565
run: npx nx run demo:build --skip-nx-cache

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,5 @@ apps/demo/public/brand/*
5252

5353
# Environment Variables
5454
*.env
55+
56+
.nx/cache

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ nx.json
44
**/*.hbs
55
/dist
66
/coverage
7+
8+
/.nx/cache

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ Follow the steps below to set up the Radius Booster Design System Kit on your lo
1111

1212
Start by cloning the repository to your local machine using the following command:
1313

14-
``` bash
14+
```bash
1515
git clone https://github.com/rangle/radius-monorepo-react
1616
```
1717

1818
### 2. Install dependencies
1919

2020
Navigate to the cloned repository's root directory and install the required dependencies by running:
2121

22-
``` bash
23-
yarn install
22+
```bash
23+
npm install
2424
```
2525

2626
This command installs all the necessary packages and dependencies required for the project.
@@ -30,7 +30,7 @@ This command installs all the necessary packages and dependencies required for t
3030
Before you can start working with NX Cloud, you need to create an nx-cloud.env file in the root directory. This file
3131
should contain the NX Cloud authentication token key. Here's how to set it up:
3232

33-
``` bash
33+
```bash
3434
echo "NX_CLOUD_AUTH_TOKEN=<your-nx-cloud-token>" > nx-cloud.env
3535
```
3636

@@ -40,8 +40,8 @@ Replace <your-nx-cloud-token> with your actual NX Cloud token. This sets up NX C
4040

4141
To view and test the components, run the Storybook development server with the following command:
4242

43-
``` bash
44-
yarn storybook
43+
```bash
44+
npm run storybook
4545
```
4646

4747
This command launches the Storybook server, which provides an interactive, visual environment to explore and test the
@@ -51,8 +51,8 @@ components in isolation. You can access Storybook by opening a web browser and n
5151

5252
To see the components in action, you can run the demo app by executing the following command:
5353

54-
``` bash
55-
yarn demo
54+
```bash
55+
npm run demo
5656
```
5757

5858
This command starts the demo app, which showcases the various components and their usage within a real-world application
@@ -67,4 +67,4 @@ information.
6767

6868
If you encounter any issues or have questions, please create an issue on GitHub, and we'll do our best to help you out.
6969
We appreciate your feedback and are committed to improving the Radius Booster Design System Kit to better serve the
70-
development community.
70+
development community.

apps/demo/.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
public/build

0 commit comments

Comments
 (0)