Skip to content

Commit

Permalink
Merge pull request #263 from mkobayashime/node_modules-make-target
Browse files Browse the repository at this point in the history
Make use of `node_modules` make target
  • Loading branch information
mkobayashime authored Nov 10, 2023
2 parents dfd8acc + 4fe3294 commit 74251cf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
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

0 comments on commit 74251cf

Please sign in to comment.