Skip to content
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

Refactored package.json to support yarn instead of npm #199

Merged
merged 3 commits into from
Sep 25, 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
14 changes: 7 additions & 7 deletions .github/workflows/develop-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: rm -rf docs
- run: npm install
- run: yarn install
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm run build
start: npm run dev
build: yarn run build
start: yarn run dev
wait-on: 'http://localhost:3000'
deploy-docs:
needs: build-test
Expand All @@ -39,15 +39,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build
- run: yarn install
- run: yarn run build
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/develop-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: yarn install
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm run build
start: npm run dev
build: yarn run build
start: yarn run dev
wait-on: 'http://localhost:3000'
26 changes: 13 additions & 13 deletions .github/workflows/master-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: rm -rf docs
- run: npm install
- run: yarn install
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm run build
start: npm run dev
build: yarn run build
start: yarn run dev
wait-on: 'http://localhost:3000'
build-s3:
needs: build-test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: rm -rf docs
- run: npm install
- run: npm run build
- run: yarn install
- run: yarn run build
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
node-version: [18.x]
steps:
- name: run Docker
uses: actions/checkout@v2
Expand All @@ -77,18 +77,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: rm -rf docs
- run: npm install
- run: npm run-script build
- run: yarn install
- run: yarn run-script build
- run: curl ${{ secrets.INDEX_HTML_DEPLOYMENT_URL }} > dist/index.html
- run: npm pack
- run: yarn pack
- run: rm -rf target
- run: mkdir target
- run: mv *.tgz target/
Expand All @@ -100,7 +100,7 @@ jobs:
- run: npx @neo4j/code-signer --app ./package --private-key neo4j-labs-app.pem --cert neo4j-labs-app.cert --passphrase ${{ secrets.NEO4J_DESKTOP_PASSPHRASE }}
- run: echo "${{ secrets.NEO4J_DESKTOP_CERTIFICATE }}" > neo4j_desktop.cert
- run: npx @neo4j/code-signer --verify --app ./package --root-cert neo4j_desktop.cert
- run: cd package && npm pack
- run: cd package && yarn pack
- run: mv package/*.tgz .
- run: rm -rf package
- run: tar xvf *.tgz package
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/master.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [17.x]
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: yarn install
- name: Cypress run
uses: cypress-io/github-action@v2
with:
build: npm run build
start: npm run dev
build: yarn run build
start: yarn run dev
wait-on: 'http://localhost:3000'
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ cypress/videos
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# build stage
FROM node:lts-alpine AS build-stage

RUN npm install -g typescript jest
RUN yarn install -g typescript jest
WORKDIR /usr/local/src/neodash

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

RUN npm install
RUN yarn install
COPY ./ /usr/local/src/neodash
RUN npm run build
RUN yarn run build

# production stage
FROM nginx:alpine AS neodash
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ For example: https://neo4j.com/labs/neodash/2.1
## Local Build
To compile and view the documentation locally, navigate to this (`./docs`) folder and run:
```
npm install
npm start
yarn install
yarn start
```

Then, open your browser and navigate to http://localhost:8000/.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ You can add a new chart to NeoDash in three steps:
. Make sure you have a local copy of NeoDash installed and running:

....
git clone [email protected]:nielsdejong/neodash.git
git clone [email protected]:neo4j-labs/neodash.git
git checkout develop
npm install
npm run dev
yarn install
yarn run dev
....

[arabic, start=2]
Expand Down
16 changes: 8 additions & 8 deletions docs/modules/ROOT/pages/developer-guide/build-and-run.adoc
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
= Build & Run

To start developing the application, you’ll need to set up the
To start developing the application, you will need to set up the
development environment.

== Run & Build using npm
== Run & Build using yarn

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

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

To run the application in development mode:

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

To build the app for production:

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

== Run locally with Docker
Expand Down
1 change: 0 additions & 1 deletion docs/modules/ROOT/pages/developer-guide/design.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ src: source code.
target: compiled package as tgz file.
.babelrc: javascript compiled settings.
.gitignore: gitignore files.
.npmignore: files ignored by the npm package.
Dockerfile: docker image definition.
....

Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/developer-guide/testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ instructions].
After cypress is installed, you can use:

....
npm run test
yarn run test
....

To open the Cypress GUN. Alternatively, use:

....
npm run test-headless
yarn run test-headless
....

To run Cypress from the UI.

Before starting the tests, make sure you have a local instance of
NeoDash running at `http://localhost:3000` using `npm run dev`.
NeoDash running at `http://localhost:3000` using `yarn run dev`.

image:cypress.png[Cypress] Above: a screenshot of the Cypress GUI.

Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/quickstart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ docker run -it --rm -p 5005:5005 nielsdejong/neodash

Or, build it yourself:
```
git clone https://github.com/nielsdejong/neodash
npm install
npm run dev
git clone https://github.com/neo4j-labs/neodash
yarn install
yarn run dev
```

NeoDash connects to any recent version of the Neo4j database. (Neo4j 4.0
Expand Down
Loading