-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjustfile
67 lines (45 loc) · 1.42 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# List all the available recipes
help:
@just --list --unsorted --list-heading ''
# Test if node_modules directory exists
node_modules:
test -d node_modules || npm install
# Check the types using TypeScript
check-types: node_modules
npx tsc --noEmit
# Format the code using dprint
fmt: node_modules
npx dprint fmt
# Lint the code using ESLint
lint: node_modules
# Dprint doesn't support all the rules that eslint does,
# so we need to run eslint with the --fix flag to fix the rest.
# - https://github.com/dprint/dprint-plugin-typescript/issues/696
# - https://github.com/dprint/dprint-plugin-typescript/issues/432
npx eslint --ignore-pattern=.gitignore --fix .
# Run the unit tests
test-unit: node_modules
grep -q 'xmlbuilder2": "2.1.2' package.json || \
(echo "xmlbuilder2 must be version 2.1.2 due to " \
"https://github.com/oozcitak/xmlbuilder2/issues/178" && exit 1)
node --test --disable-warning=ExperimentalWarning
# Run C#'s OpenXmlValidator on the test Docx files
test-docx-files:
cd TestWordFiles && dotnet run
# Run all the tests
test: fmt lint check-types test-unit
build-esm:
bun build \
--target node \
--outfile dist/index-esm.js \
index.js
build-cjs:
bun build \
--target node \
--format cjs \
--outfile dist/index-cjs.js \
index.js
build: build-esm build-cjs
# Bump the version and create a new release
release: node_modules
npx standard-version