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

Switch to npm #117

Merged
merged 1 commit into from
Apr 12, 2021
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
8 changes: 4 additions & 4 deletions .ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ jobs:
- task: Cache@2
displayName: 'Check Cache'
inputs:
key: 'yarn | yarn.lock'
key: 'npm | package-lock.json'
path: 'node_modules'
cacheHitVar: CACHE_RESTORED

- script: 'yarn install --frozen-lockfile'
- script: 'npm ci --no-audit'
displayName: 'Install Dependencies'
condition: ne(variables.CACHE_RESTORED, 'true')

- script: 'sh ./scripts/updateversion.sh'
displayName: 'Update version in package.json'

- script: 'yarn build:development'
- script: 'npm run build:development'
displayName: 'Build Development'
condition: eq(variables['BuildConfiguration'], 'development')

- script: 'yarn build:production'
- script: 'npm run build:production'
displayName: 'Build Bundle'
condition: eq(variables['BuildConfiguration'], 'production')

Expand Down
9 changes: 9 additions & 0 deletions .github/.dependabot.yml → .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ updates:
prefix: fix
prefix-development: chore
include: scope

- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
commit-message:
prefix: actions
106 changes: 37 additions & 69 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,74 +1,42 @@
name: Lint

on:
push:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
pull_request:
branches:
- master

jobs:
lint-js:
name: Lint JS/TS
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node env
uses: actions/setup-node@v2.1.2
with:
node-version: 14

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node_modules
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run ESLint
run: yarn run lint:code

lint-css:
name: Lint CSS
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node env
uses: actions/setup-node@v2.1.2
with:
node-version: 14

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node_modules
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run stylelint
run: yarn run lint:css
lint:
name: Lint TS and CSS
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node env
uses: actions/setup-node@v2.1.2
with:
node-version: 14

- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Cache node_modules
uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install dependencies
run: npm ci --no-audit

- name: Run ESLint
run: npm run lint
74 changes: 37 additions & 37 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: Test

on:
push:
branches:
- master
pull_request:
branches:
- master
push:
branches:
- master
pull_request:
branches:
- master

jobs:
jest:
name: Jest
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node env
uses: actions/setup-node@v2.1.2
with:
node-version: 14

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node_modules
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run tests
run: yarn run test
jest:
name: Jest
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node env
uses: actions/setup-node@v2.1.2
with:
node-version: 14

- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Cache node_modules
uses: actions/cache@v2
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install dependencies
run: npm ci --no-audit

- name: Run tests
run: npm run test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fund=false
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Development Environment

The development environment is setup with editorconfig, Code style is enforced by prettier and eslint for Javascipt/Typescript linting
The development environment is setup with editorconfig. Code style is enforced by prettier and eslint for Javascript/Typescript linting

- [editorconfig](https://editorconfig.org/)
- [prettier](https://prettier.io/)
Expand All @@ -14,13 +14,13 @@ The development environment is setup with editorconfig, Code style is enforced b

| name | required | description | default if not set |
| ------------- | -------- | ---------------------------------------------------------- | ------------------ |
| RECEIVER_PORT | No | The port used for the dev server when `yarn serve` is used | 9000 |
| RECEIVER_PORT | No | The port used for the dev server when `npm start` is used | 9000 |

### Building/Using

`yarn build:development` - Build a development version
`yarn serve` / `yarn start` - Build a development version and start a dev server
`yarn build:production` - Build a production version
`npm run build:development` - Build a development version
`npm start` - Build a development version and start a dev server
`npm run build:production` - Build a production version

## Pull Requests

Expand Down
Loading