2023-12-31 11:05:12 +08:00
|
|
|
{
|
|
|
|
"tasks": {
|
|
|
|
"build": {
|
|
|
|
"name": "build",
|
|
|
|
"description": "Full release build",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"spawn": "default"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "pre-compile"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "compile"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "post-compile"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "test"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "package"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"bump": {
|
|
|
|
"name": "bump",
|
|
|
|
"description": "Bumps version based on latest git tag and generates a changelog entry",
|
|
|
|
"env": {
|
|
|
|
"OUTFILE": "package.json",
|
|
|
|
"CHANGELOG": "dist/changelog.md",
|
|
|
|
"BUMPFILE": "dist/version.txt",
|
|
|
|
"RELEASETAG": "dist/releasetag.txt",
|
|
|
|
"RELEASE_TAG_PREFIX": ""
|
|
|
|
},
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"builtin": "release/bump-version"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"condition": "! git log --oneline -1 | grep -q \"chore(release):\""
|
|
|
|
},
|
2024-01-07 08:15:49 +08:00
|
|
|
"ci": {
|
|
|
|
"name": "ci",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"spawn": "install:ci"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2024-07-03 08:15:05 +08:00
|
|
|
"clean-compile": {
|
|
|
|
"name": "clean-compile",
|
|
|
|
"description": "Clean up the compiled output",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"exec": "rm -rf lib && rm -rf dist"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2023-12-31 11:05:12 +08:00
|
|
|
"clobber": {
|
|
|
|
"name": "clobber",
|
|
|
|
"description": "hard resets to HEAD of origin and cleans the local repo",
|
|
|
|
"env": {
|
|
|
|
"BRANCH": "$(git branch --show-current)"
|
|
|
|
},
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"exec": "git checkout -b scratch",
|
|
|
|
"name": "save current HEAD in \"scratch\" branch"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"exec": "git checkout $BRANCH"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"exec": "git fetch origin",
|
|
|
|
"name": "fetch latest changes from origin"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"exec": "git reset --hard origin/$BRANCH",
|
|
|
|
"name": "hard reset to origin commit"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"exec": "git clean -fdx",
|
|
|
|
"name": "clean all untracked files"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"say": "ready to rock! (unpushed commits are under the \"scratch\" branch)"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"condition": "git diff --exit-code > /dev/null"
|
|
|
|
},
|
|
|
|
"compile": {
|
|
|
|
"name": "compile",
|
|
|
|
"description": "Only compile",
|
|
|
|
"steps": [
|
|
|
|
{
|
2023-12-31 11:18:19 +08:00
|
|
|
"exec": "tsc --build tsconfig.publish.json"
|
2023-12-31 11:05:12 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"default": {
|
|
|
|
"name": "default",
|
|
|
|
"description": "Synthesize project files",
|
|
|
|
"steps": [
|
|
|
|
{
|
2023-12-31 11:18:19 +08:00
|
|
|
"exec": "ts-node --project tsconfig.json .projenrc.ts"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"docgen": {
|
|
|
|
"name": "docgen",
|
|
|
|
"description": "Generate TypeScript API reference docs/",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"exec": "typedoc src --disableSources --out docs/"
|
2023-12-31 11:05:12 +08:00
|
|
|
}
|
2024-07-03 08:15:05 +08:00
|
|
|
],
|
|
|
|
"condition": "if [ \"$RELEASE\" = \"true\" ] ; then exit 1 ; fi"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
"eject": {
|
|
|
|
"name": "eject",
|
|
|
|
"description": "Remove projen from the project",
|
|
|
|
"env": {
|
|
|
|
"PROJEN_EJECTING": "true"
|
|
|
|
},
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"spawn": "default"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"eslint": {
|
|
|
|
"name": "eslint",
|
|
|
|
"description": "Runs eslint against the codebase",
|
|
|
|
"steps": [
|
|
|
|
{
|
2024-01-07 08:15:49 +08:00
|
|
|
"exec": "eslint --ext .ts,.tsx --fix --no-error-on-unmatched-pattern $@ src test build-tools projenrc .projenrc.ts",
|
2024-07-03 08:15:05 +08:00
|
|
|
"receiveArgs": true
|
2024-01-07 08:15:49 +08:00
|
|
|
}
|
2024-07-03 08:15:05 +08:00
|
|
|
],
|
|
|
|
"condition": "if [ \"$RELEASE\" = \"true\" ] ; then exit 1 ; fi"
|
2024-01-07 08:15:49 +08:00
|
|
|
},
|
|
|
|
"i": {
|
|
|
|
"name": "i",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"spawn": "install"
|
2023-12-31 11:05:12 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"install": {
|
|
|
|
"name": "install",
|
|
|
|
"description": "Install project dependencies and update lockfile (non-frozen)",
|
|
|
|
"steps": [
|
|
|
|
{
|
2023-12-31 11:18:19 +08:00
|
|
|
"exec": "pnpm i --no-frozen-lockfile"
|
2023-12-31 11:05:12 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"install:ci": {
|
|
|
|
"name": "install:ci",
|
|
|
|
"description": "Install project dependencies using frozen lockfile",
|
|
|
|
"steps": [
|
|
|
|
{
|
2023-12-31 11:18:19 +08:00
|
|
|
"exec": "pnpm i --frozen-lockfile"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"lint": {
|
|
|
|
"name": "lint",
|
|
|
|
"description": "Alternate lint command",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"spawn": "eslint"
|
2023-12-31 11:05:12 +08:00
|
|
|
}
|
2024-07-03 08:15:05 +08:00
|
|
|
],
|
|
|
|
"condition": "if [ \"$RELEASE\" = \"true\" ] ; then exit 1 ; fi"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
"package": {
|
|
|
|
"name": "package",
|
|
|
|
"description": "Creates the distribution package",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"exec": "ncc build --source-map --license licenses.txt"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"post-compile": {
|
|
|
|
"name": "post-compile",
|
2023-12-31 11:18:19 +08:00
|
|
|
"description": "Runs after successful compilation",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"spawn": "docgen"
|
|
|
|
}
|
|
|
|
]
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
"post-upgrade": {
|
|
|
|
"name": "post-upgrade",
|
|
|
|
"description": "Runs after upgrading dependencies"
|
|
|
|
},
|
|
|
|
"pre-compile": {
|
|
|
|
"name": "pre-compile",
|
|
|
|
"description": "Prepare the project for compilation"
|
|
|
|
},
|
|
|
|
"release": {
|
|
|
|
"name": "release",
|
|
|
|
"description": "Prepare a release from \"main\" branch",
|
|
|
|
"env": {
|
2023-12-31 11:18:19 +08:00
|
|
|
"RELEASE": "true",
|
|
|
|
"MAJOR": "2"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"exec": "rm -fr dist"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "bump"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "build"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "unbump"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"exec": "git diff --ignore-space-at-eol --exit-code"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"test": {
|
|
|
|
"name": "test",
|
|
|
|
"description": "Run tests",
|
|
|
|
"steps": [
|
|
|
|
{
|
2024-01-07 08:15:49 +08:00
|
|
|
"spawn": "eslint"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
{
|
2024-01-07 08:15:49 +08:00
|
|
|
"spawn": "type-check"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "test-unit"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"test-unit": {
|
|
|
|
"name": "test-unit",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"exec": "jest --passWithNoTests --coverageProvider=v8 --updateSnapshot",
|
|
|
|
"receiveArgs": true
|
2023-12-31 11:05:12 +08:00
|
|
|
}
|
2024-07-03 08:15:05 +08:00
|
|
|
],
|
|
|
|
"condition": "if [ \"$RELEASE\" = \"true\" ] ; then exit 1 ; fi"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
"test:watch": {
|
|
|
|
"name": "test:watch",
|
|
|
|
"description": "Run jest in watch mode",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"exec": "jest --watch"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2023-12-31 11:18:19 +08:00
|
|
|
"type-check": {
|
|
|
|
"name": "type-check",
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"exec": "tsc --noEmit"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2023-12-31 11:05:12 +08:00
|
|
|
"unbump": {
|
|
|
|
"name": "unbump",
|
|
|
|
"description": "Restores version to 0.0.0",
|
|
|
|
"env": {
|
|
|
|
"OUTFILE": "package.json",
|
|
|
|
"CHANGELOG": "dist/changelog.md",
|
|
|
|
"BUMPFILE": "dist/version.txt",
|
|
|
|
"RELEASETAG": "dist/releasetag.txt",
|
|
|
|
"RELEASE_TAG_PREFIX": ""
|
|
|
|
},
|
|
|
|
"steps": [
|
|
|
|
{
|
|
|
|
"builtin": "release/reset-version"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"upgrade": {
|
|
|
|
"name": "upgrade",
|
|
|
|
"description": "upgrade dependencies",
|
|
|
|
"env": {
|
|
|
|
"CI": "0"
|
|
|
|
},
|
|
|
|
"steps": [
|
|
|
|
{
|
2024-07-03 08:15:05 +08:00
|
|
|
"exec": "pnpx npm-check-updates@16 --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@types/clone-deep,@types/jest,@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,@vercel/ncc,clone-deep,dkershner6-projen-github-actions,eslint-config-prettier,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-jest,eslint-plugin-prettier,eslint-plugin-sonarjs,eslint,jest,jest-junit,prettier,projen-github-action-typescript,standard-version,ts-jest,ts-node,typedoc,typescript,@actions/core,@actions/github,axios"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
{
|
2023-12-31 11:18:19 +08:00
|
|
|
"exec": "pnpm i --no-frozen-lockfile"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
{
|
2024-07-03 08:15:05 +08:00
|
|
|
"exec": "pnpm update @types/clone-deep @types/jest @types/node @typescript-eslint/eslint-plugin @typescript-eslint/parser @vercel/ncc clone-deep dkershner6-projen-github-actions eslint-config-prettier eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-jest eslint-plugin-prettier eslint-plugin-sonarjs eslint jest jest-junit prettier projen-github-action-typescript standard-version ts-jest ts-node typedoc typescript @actions/core @actions/github axios"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"exec": "npx projen"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"spawn": "post-upgrade"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"watch": {
|
|
|
|
"name": "watch",
|
|
|
|
"description": "Watch & compile in the background",
|
|
|
|
"steps": [
|
|
|
|
{
|
2024-01-07 08:15:49 +08:00
|
|
|
"exec": "tsc --build -w tsconfig.publish.json"
|
2023-12-31 11:05:12 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"env": {
|
2023-12-31 11:18:19 +08:00
|
|
|
"PATH": "$(pnpm -c exec \"node --print process.env.PATH\")"
|
2023-12-31 11:05:12 +08:00
|
|
|
},
|
|
|
|
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
|
|
|
|
}
|