Skip to content

Commit 0a0af71

Browse files
authored
Refactored package.json to support yarn instead of npm (#199)
* Replaced npm scripts by yarn, fixed issues in package.json * Upversioning some old dependencies * Bumped node version for test environment
1 parent 0849eae commit 0a0af71

24 files changed

+8363
-24834
lines changed

.github/workflows/develop-deployment.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
node-version: [17.x]
12+
node-version: [18.x]
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Use Node.js ${{ matrix.node-version }}
1616
uses: actions/setup-node@v1
1717
with:
1818
node-version: ${{ matrix.node-version }}
1919
- run: rm -rf docs
20-
- run: npm install
20+
- run: yarn install
2121
- name: Cypress run
2222
uses: cypress-io/github-action@v2
2323
with:
24-
build: npm run build
25-
start: npm run dev
24+
build: yarn run build
25+
start: yarn run dev
2626
wait-on: 'http://localhost:3000'
2727
deploy-docs:
2828
needs: build-test
@@ -39,15 +39,15 @@ jobs:
3939
runs-on: ubuntu-latest
4040
strategy:
4141
matrix:
42-
node-version: [17.x]
42+
node-version: [18.x]
4343
steps:
4444
- uses: actions/checkout@v2
4545
- name: Use Node.js ${{ matrix.node-version }}
4646
uses: actions/setup-node@v1
4747
with:
4848
node-version: ${{ matrix.node-version }}
49-
- run: npm install
50-
- run: npm run build
49+
- run: yarn install
50+
- run: yarn run build
5151
- name: Set AWS credentials
5252
uses: aws-actions/configure-aws-credentials@v1
5353
with:

.github/workflows/develop-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [17.x]
13+
node-version: [18.x]
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: Use Node.js ${{ matrix.node-version }}
1717
uses: actions/setup-node@v1
1818
with:
1919
node-version: ${{ matrix.node-version }}
20-
- run: npm install
20+
- run: yarn install
2121
- name: Cypress run
2222
uses: cypress-io/github-action@v2
2323
with:
24-
build: npm run build
25-
start: npm run dev
24+
build: yarn run build
25+
start: yarn run dev
2626
wait-on: 'http://localhost:3000'

.github/workflows/master-deployment.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,36 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [17.x]
13+
node-version: [18.x]
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: Use Node.js ${{ matrix.node-version }}
1717
uses: actions/setup-node@v1
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020
- run: rm -rf docs
21-
- run: npm install
21+
- run: yarn install
2222
- name: Cypress run
2323
uses: cypress-io/github-action@v2
2424
with:
25-
build: npm run build
26-
start: npm run dev
25+
build: yarn run build
26+
start: yarn run dev
2727
wait-on: 'http://localhost:3000'
2828
build-s3:
2929
needs: build-test
3030
runs-on: ubuntu-latest
3131
strategy:
3232
matrix:
33-
node-version: [17.x]
33+
node-version: [18.x]
3434
steps:
3535
- uses: actions/checkout@v2
3636
- name: Use Node.js ${{ matrix.node-version }}
3737
uses: actions/setup-node@v1
3838
with:
3939
node-version: ${{ matrix.node-version }}
4040
- run: rm -rf docs
41-
- run: npm install
42-
- run: npm run build
41+
- run: yarn install
42+
- run: yarn run build
4343
- name: Set AWS credentials
4444
uses: aws-actions/configure-aws-credentials@v1
4545
with:
@@ -53,7 +53,7 @@ jobs:
5353
runs-on: ubuntu-latest
5454
strategy:
5555
matrix:
56-
node-version: [17.x]
56+
node-version: [18.x]
5757
steps:
5858
- name: run Docker
5959
uses: actions/checkout@v2
@@ -77,18 +77,18 @@ jobs:
7777
runs-on: ubuntu-latest
7878
strategy:
7979
matrix:
80-
node-version: [17.x]
80+
node-version: [18.x]
8181
steps:
8282
- uses: actions/checkout@v2
8383
- name: Use Node.js ${{ matrix.node-version }}
8484
uses: actions/setup-node@v1
8585
with:
8686
node-version: ${{ matrix.node-version }}
8787
- run: rm -rf docs
88-
- run: npm install
89-
- run: npm run-script build
88+
- run: yarn install
89+
- run: yarn run-script build
9090
- run: curl ${{ secrets.INDEX_HTML_DEPLOYMENT_URL }} > dist/index.html
91-
- run: npm pack
91+
- run: yarn pack
9292
- run: rm -rf target
9393
- run: mkdir target
9494
- run: mv *.tgz target/
@@ -100,7 +100,7 @@ jobs:
100100
- run: npx @neo4j/code-signer --app ./package --private-key neo4j-labs-app.pem --cert neo4j-labs-app.cert --passphrase ${{ secrets.NEO4J_DESKTOP_PASSPHRASE }}
101101
- run: echo "${{ secrets.NEO4J_DESKTOP_CERTIFICATE }}" > neo4j_desktop.cert
102102
- run: npx @neo4j/code-signer --verify --app ./package --root-cert neo4j_desktop.cert
103-
- run: cd package && npm pack
103+
- run: cd package && yarn pack
104104
- run: mv package/*.tgz .
105105
- run: rm -rf package
106106
- run: tar xvf *.tgz package

.github/workflows/master.test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
node-version: [17.x]
13+
node-version: [18.x]
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: Use Node.js ${{ matrix.node-version }}
1717
uses: actions/setup-node@v1
1818
with:
1919
node-version: ${{ matrix.node-version }}
20-
- run: npm install
20+
- run: yarn install
2121
- name: Cypress run
2222
uses: cypress-io/github-action@v2
2323
with:
24-
build: npm run build
25-
start: npm run dev
24+
build: yarn run build
25+
start: yarn run dev
2626
wait-on: 'http://localhost:3000'

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ cypress/videos
2727
.env.development.local
2828
.env.test.local
2929
.env.production.local
30-
31-
npm-debug.log*
3230
yarn-debug.log*
3331
yarn-error.log*
3432

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# build stage
22
FROM node:lts-alpine AS build-stage
33

4-
RUN npm install -g typescript jest
4+
RUN yarn install -g typescript jest
55
WORKDIR /usr/local/src/neodash
66

77
# Pull source code if you have not cloned the repository
@@ -11,9 +11,9 @@ WORKDIR /usr/local/src/neodash
1111
# Copy sources and install/build
1212
COPY ./package.json /usr/local/src/neodash/package.json
1313

14-
RUN npm install
14+
RUN yarn install
1515
COPY ./ /usr/local/src/neodash
16-
RUN npm run build
16+
RUN yarn run build
1717

1818
# production stage
1919
FROM nginx:alpine AS neodash

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ For example: https://neo4j.com/labs/neodash/2.1
1111
## Local Build
1212
To compile and view the documentation locally, navigate to this (`./docs`) folder and run:
1313
```
14-
npm install
15-
npm start
14+
yarn install
15+
yarn start
1616
```
1717

1818
Then, open your browser and navigate to http://localhost:8000/.

docs/modules/ROOT/pages/developer-guide/adding-visualizations.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ You can add a new chart to NeoDash in three steps:
1212
. Make sure you have a local copy of NeoDash installed and running:
1313

1414
....
15-
git clone [email protected]:nielsdejong/neodash.git
15+
git clone [email protected]:neo4j-labs/neodash.git
1616
git checkout develop
17-
npm install
18-
npm run dev
17+
yarn install
18+
yarn run dev
1919
....
2020

2121
[arabic, start=2]

docs/modules/ROOT/pages/developer-guide/build-and-run.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
= Build & Run
22

3-
To start developing the application, you’ll need to set up the
3+
To start developing the application, you will need to set up the
44
development environment.
55

6-
== Run & Build using npm
6+
== Run & Build using yarn
77

8-
NeoDash is built with React. You’ll need `npm` installed to run the web
8+
NeoDash is built with React. You will need `yarn` installed to run the web
99
app.
1010

1111
____
12-
Use a recent version of `npm` and `node` to build NeoDash. The
13-
application has been tested with npm 8.6 & node v17.4.0.
12+
Use a recent version of `yarn` and `node` to build NeoDash. The
13+
application has been tested with yarn 1.22.17 & node v18.8.0.
1414
____
1515

1616
To run the application in development mode:
1717

1818
- clone this repository.
1919
- open a terminal and navigate to the directory you just cloned.
20-
- execute `npm install` to install the necessary dependencies.
21-
- execute `npm run dev` to run the app in development mode.
20+
- run `yarn install` to install the necessary dependencies.
21+
- run `yarn run dev` to run the app in development mode.
2222
- the application should be available at http://localhost:3000.
2323

2424
To build the app for production:
2525

2626
- follow the steps above to clone the repository and install dependencies.
27-
- execute `npm run build`. This will create a `build` folder in your project directory.
27+
- execute `yarn run build`. This will create a `build` folder in your project directory.
2828
- deploy the contents of the build folder to a web server. You should then be able to run the web app.
2929

3030
== Run locally with Docker

docs/modules/ROOT/pages/developer-guide/design.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ src: source code.
2828
target: compiled package as tgz file.
2929
.babelrc: javascript compiled settings.
3030
.gitignore: gitignore files.
31-
.npmignore: files ignored by the npm package.
3231
Dockerfile: docker image definition.
3332
....
3433

0 commit comments

Comments
 (0)