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

Make use of node_modules make target #263

Merged
merged 1 commit into from
Nov 10, 2023
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
11 changes: 7 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ on: push

name: CI

env:
MAKE_YARN_FROZEN_LOCKFILE: 1

jobs:
lint:
name: Lint
Expand All @@ -14,7 +17,7 @@ jobs:
node-version: "18"
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile
run: make node_modules
- name: ESLint
run: make lint
- name: Prettier
Expand All @@ -32,7 +35,7 @@ jobs:
node-version: "18"
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile
run: make node_modules
- name: Test
run: make test
docs:
Expand All @@ -46,7 +49,7 @@ jobs:
node-version: "18"
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile
run: make node_modules
- name: Docgen
run: make docgen
- name: Check uncommitted changes
Expand All @@ -62,7 +65,7 @@ jobs:
node-version: "18"
cache: "yarn"
- name: Install dependencies
run: yarn --frozen-lockfile
run: make node_modules
- name: Build
run: NODE_OPTIONS='--max_old_space_size=4096' make build
- name: Check uncommitted changes
Expand Down
31 changes: 18 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
ts-node = node --loader ts-node/esm --experimental-specifier-resolution=node

install:
node_modules: package.json yarn.lock
ifeq ($(MAKE_YARN_FROZEN_LOCKFILE), 1)
yarn install --frozen-lockfile
else
yarn install
endif
@touch node_modules

lint: install
lint: node_modules
yarn eslint .

lint.fix: install
lint.fix: node_modules
yarn eslint --fix .

lint.fix.dist: install
lint.fix.dist: node_modules
yarn eslint --fix dist

format: install
format: node_modules
yarn prettier --write .

format.check: install
format.check: node_modules
yarn prettier --check .

dev: install
dev: node_modules
$(ts-node) bin/dev.ts

build: install
build: node_modules
yarn run rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript
@make format
@make lint.fix.dist

docgen: install
docgen: node_modules
$(ts-node) bin/docgen.ts
@make format

typecheck: install
typecheck: node_modules
yarn tsc --noEmit

typecheck.watch: install
typecheck.watch: node_modules
yarn tsc --noEmit --watch

test: install
test: node_modules
yarn run ava

test.watch: install
test.watch: node_modules
yarn run ava --watch

scaffold.script:
Expand Down