Skip to content

Commit

Permalink
chore/use npm for package manager (#96)
Browse files Browse the repository at this point in the history
* use npm for package manager

* use npm for package manager

* use npm for package manager

* use npm for package manager
  • Loading branch information
thescientist13 authored Nov 23, 2023
1 parent 669d852 commit 4afc02c
Show file tree
Hide file tree
Showing 9 changed files with 46,974 additions and 14,219 deletions.
32 changes: 15 additions & 17 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@

To develop for the project, you'll want to follow these steps:

1. Have [NodeJS LTS](https://nodejs.org) installed (>= 12.x) and [Yarn](https://yarnpkg.com/)
1. Have [NodeJS LTS](https://nodejs.org) installed
1. Clone the repository
1. Run `yarn install`
1. Run `npm ci`

If developing with Node Version Manager:

- Windows: [NVM for Windows](https://github.com/coreybutler/nvm-windows/releases)
- Linux/MacOS: [Node Version Manager](https://github.com/nvm-sh/nvm)
- Windows: [NVM for Windows](https://github.com/coreybutler/nvm-windows/releases)
- Linux/MacOS: [Node Version Manager](https://github.com/nvm-sh/nvm)

You can confirm by running the following

```sh
$ nvm use
Found '/Users/<directory_location>/www.analogstudios.net/.nvmrc' with version <14.17.0>
Expand All @@ -27,26 +25,26 @@ The [website](https://www.analogstudios.net/) is currently built by [**Greenwood

Below are the development tasks available for working on this project:

- `yarn develop` - Develop for the website locally using the dev server at `localhost:1984` in your browser.
- `yarn build` - Builds the website for production.
- `yarn serve` - Builds the website for production and runs it on a local webserver at `localhost:8000`
- `yarn test:tdd` - Run unit tests in watch mode
- `npm run dev` - Develop for the website locally using the dev server at `localhost:1984` in your browser.
- `npm run build` - Builds the website for production.
- `npm run serve` - Builds the website for production and runs it on a local web0server at `localhost:8000`
- `npm run test:tdd` - Run unit tests in watch mode

## Pull Requests

Pull requests are the best! To best help facililate contributions to the project, here are some requests:
Pull requests are the best! To best help facilitate contributions to the project, here are some requests:

- We generally prefer an issue be opened first, to help faciliate general discussion outside of the code review process itself and align on the ask and any expections. However, for typos in docs and minor "chore" like tasks a PR is usually sufficient. When in doubt, open an issue.
- We generally prefer an issue be opened first, to help facilitate general discussion outside of the code review process itself and align on the ask and any expectations. However, for typos in docs and minor "chore" like tasks a PR is usually sufficient. When in doubt, open an issue.
- For bugs, please consider reviewing the issue tracker first.
- For branching, we generally follow the convention `<issue-label>/issue-<number>-<issue-title>`, e.g. _bug/issue-12-fixed-bug-with-yada-yada-yada_
- To test the CI build scripts locally, run the `yarn` commands referenced above.
- To test the CI build scripts locally, run the scripts referenced above.

### Continuous Integration

This projet makes active use of testing tools like [GitHub Actions](https://github.com/features/actions) and [Netlify deploy previews](https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify/) as part of the workflow. Each time a PR is opened, a sequence of build steps defined _.github/workflows/ci.yml_ are run:
This project makes active use of testing tools like [GitHub Actions](https://github.com/features/actions) and [Netlify deploy previews](https://www.netlify.com/blog/2016/07/20/introducing-deploy-previews-in-netlify/) as part of the workflow. Each time a PR is opened, a sequence of build steps defined _.github/workflows/ci.yml_ are run:

1. Linting: `yarn lint`
1. Running unit tests: `yarn test`
1. Building the Greenwood website: `yarn build`
1. Linting: `npm run lint`
1. Running unit tests: `npm run test`
1. Building the Greenwood website: `npm run build`

A preview is also made available within the status checks section of the PR in GitHub and can be used to validate work in a live environment before having to merge.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
node-version: ${{ matrix.node }}
- name: Installing project dependencies
run: |
yarn install --frozen-lockfile
npm ci
- name: Lint
run: |
yarn lint
npm run lint
- name: Test
run: |
yarn test
npm run test
- name: Build
run: |
yarn clean && yarn build
npm run build
# - name: Storybook
# run: |
# yarn storybook:build
# npm run storybook:build
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
node-version: ${{ matrix.node }}
- name: Installing project dependencies
run: |
yarn install --frozen-lockfile
npm ci
- name: Build
run: |
yarn clean && yarn build
npm run clean && npm run build
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,28 @@ Frontend website for [www.analogstudios.net](https://www.analogstudios.net) base

### Setup

You'll need the following installed to run and contribute to this project.

1. [NodeJS LTS](https://nodejs.org/)
1. [Yarn 1.x](https://classic.yarnpkg.com/)
You'll need the latest [NodeJS LTS](https://nodejs.org/) version installed to run and contribute to this project. Or run `nvm use` if using [nvm**](https://github.com/nvm-sh/nvm).

You can confirm by running the following

```sh
$ node -v
v18.15.0

$ yarn -v
1.22.19
% npm -v
8.19.2
```

Then run `yarn install` to install the project's dependencies.
Then run `npm ci` to install the project's dependencies.

### Tasks

After installing the above, you can run the following commands:

- `yarn lint` - Lint all files in the project (JS , CSS, naming)
- `yarn start` - Starts **Greenwood**'s local development server
- `yarn build` - Runs **Greenwood** to generate a production build
- `yarn storybook:deveop` - Runs [**Storybook**](https://storybook.js.org/) in development mode
- `yarn test:tdd` - Runs unit tests in `watch` mode using [**@web/test-runner**](https://modern-web.dev/docs/test-runner/overview/)
- `npm run lint` - Lint all files in the project (JS , CSS, naming)
- `npm run start` - Starts **Greenwood**'s local development server
- `npm run build` - Runs **Greenwood** to generate a production build
- `npm run story:dev` - Runs [**Storybook**](https://storybook.js.org/) in development mode
- `npm run test:tdd` - Runs unit tests in `watch` mode using [**@web/test-runner**](https://modern-web.dev/docs/test-runner/overview/)

> _See `package.json#scripts` for a full list of available commands._
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build]
publish = "public/"
command = "yarn build"
command = "npm run build"

[build.processing]
skip_processing = true
Expand Down
Loading

0 comments on commit 4afc02c

Please sign in to comment.