diff --git a/package.json b/package.json index d680aff..3c3b65f 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,11 @@ "dev": "run-p -r 'dev:*'", "dev:backend": "convex dev --typecheck-components", "dev:frontend": "cd example && vite --clearScreen false", - "dev:build": "chokidar 'tsconfig*.json' 'src/**/*.ts' -i '**/*.test.ts' -c 'convex codegen --component-dir ./src/component && npm run build' --initial", - "predev": "npm run dev:backend -- --until-success", - "clean": "rm -rf dist *.tsbuildinfo", + "dev:build": "chokidar 'tsconfig*.json' 'src/**/*.ts' -i '**/*.test.ts' -c 'npm run build:codegen' --initial", + "predev": "path-exists .env.local dist || (npm run build && convex dev --once)", "build": "tsc --project ./tsconfig.build.json", + "build:codegen": "npx convex codegen --component-dir ./src/component && npm run build", + "build:clean": "rm -rf dist *.tsbuildinfo && npm run build:codegen", "typecheck": "tsc --noEmit && tsc -p example/convex", "lint": "eslint .", "all": "run-p -r 'dev:*' 'test:watch'", @@ -30,10 +31,11 @@ "test:watch": "vitest --typecheck --clearScreen false", "test:debug": "vitest --inspect-brk --no-file-parallelism", "test:coverage": "vitest run --coverage --coverage.reporter=text", - "prepare": "npm run build", - "alpha": "npm run clean && npm ci && run-p test lint typecheck && npm version prerelease --preid alpha && npm publish --tag alpha && git push --tags", - "release": "npm run clean && npm ci && run-p test lint typecheck && npm version patch && npm publish && git push --tags", - "version": "pbcopy <<<$npm_package_version; vim CHANGELOG.md && prettier -w CHANGELOG.md && git add CHANGELOG.md" + "preversion": "npm ci && npm run build:clean && run-p test lint typecheck", + "prepublishOnly": "npm whoami || npm login", + "alpha": "npm version prerelease --preid alpha && npm publish --tag alpha && git push --follow-tags", + "release": "npm version patch && npm publish && git push --follow-tags", + "version": "vim -c 'normal o' -c 'normal o## '$npm_package_version CHANGELOG.md && prettier -w CHANGELOG.md && git add CHANGELOG.md" }, "files": [ "dist",