From ff27d964477f0269a5d39641caf19d6ff2647c1d Mon Sep 17 00:00:00 2001 From: Colten Krauter Date: Sat, 20 Jul 2024 20:57:54 -0600 Subject: [PATCH] feat: nodemon, package scripts --- .github/CODEOWNERS | 2 + .github/workflows/node-release.yaml | 12 +++ package-lock.json | 117 ++++++++++++++++++++++++++++ package.json | 7 +- src/app.ts | 1 + tsconfig.json | 12 ++- 6 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/node-release.yaml create mode 100644 src/app.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..5a6d19e --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# This auto assigns the following teams to pull requests +* @krauters/core diff --git a/.github/workflows/node-release.yaml b/.github/workflows/node-release.yaml new file mode 100644 index 0000000..5da42f9 --- /dev/null +++ b/.github/workflows/node-release.yaml @@ -0,0 +1,12 @@ +name: Node Release + +on: + push: + branches: '*' + workflow_dispatch: + +jobs: + publish: + uses: krauters/shared-workflows/.github/workflows/release-node.yaml@main + secrets: + GH_TOKEN_RELEASES: ${{ secrets.GH_TOKEN_RELEASES }} diff --git a/package-lock.json b/package-lock.json index f8e9cdb..13e9440 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "chai": "^5.1.1", "husky": "^9.1.1", "mocha": "^10.7.0", + "nodemon": "^3.1.4", "sinon": "^18.0.0", "ts-node": "^10.9.2", "typescript": "^5.5.3" @@ -618,6 +619,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", @@ -892,6 +899,12 @@ "url": "https://github.com/sponsors/typicode" } }, + "node_modules/ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", + "dev": true + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1216,6 +1229,77 @@ "path-to-regexp": "^6.2.1" } }, + "node_modules/nodemon": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.4.tgz", + "integrity": "sha512-wjPBbFhtpJwmIeY2yP7QF+UKzPfltVGtfce1g/bB15/8vCGZj8uxD62b/b9M9/WVgme0NZudpownKN+c0plXlQ==", + "dev": true, + "dependencies": { + "chokidar": "^3.5.2", + "debug": "^4", + "ignore-by-default": "^1.0.1", + "minimatch": "^3.1.2", + "pstree.remy": "^1.1.8", + "semver": "^7.5.3", + "simple-update-notifier": "^2.0.0", + "supports-color": "^5.5.0", + "touch": "^3.1.0", + "undefsafe": "^2.0.5" + }, + "bin": { + "nodemon": "bin/nodemon.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nodemon" + } + }, + "node_modules/nodemon/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/nodemon/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/nodemon/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/nodemon/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -1331,6 +1415,12 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pstree.remy": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", + "dev": true + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -1435,6 +1525,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/simple-update-notifier": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", + "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/sinon": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/sinon/-/sinon-18.0.0.tgz", @@ -1607,6 +1709,15 @@ "node": ">=8.0" } }, + "node_modules/touch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.1.tgz", + "integrity": "sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==", + "dev": true, + "bin": { + "nodetouch": "bin/nodetouch.js" + } + }, "node_modules/ts-node": { "version": "10.9.2", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", @@ -1681,6 +1792,12 @@ "node": ">=14.17" } }, + "node_modules/undefsafe": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.5.tgz", + "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", + "dev": true + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", diff --git a/package.json b/package.json index 1d19a4c..275f12f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "chai": "^5.1.1", "husky": "^9.1.1", "mocha": "^10.7.0", + "nodemon": "^3.1.4", "sinon": "^18.0.0", "ts-node": "^10.9.2", "typescript": "^5.5.3" @@ -14,13 +15,17 @@ "name": "@krauters/typescript-core", "description": "A TypeScript Repository that stands as a starting point for all other TypeScript repositories.", "version": "0.0.0", - "main": "index.ts", + "main": "app.ts", "type": "module", "scripts": { + "build": "npm run ts-node -- ./src/app.ts", + "example-1": "npm run ts-node -- ./example/1.ts", "mocha": "c8 --config test/c8.config.json mocha --config test/.mocharc.json", "prepare": "husky || true", "readme": "node scripts/readme.js", + "start": "nodemon --inspect -e ts -w ./src -x npm run build", "test": "npm run mocha", + "ts-node": "node --no-warnings --loader ts-node/esm/transpile-only", "update-all": "npx npm-check-updates -u && npm install" }, "keywords": [ diff --git a/src/app.ts b/src/app.ts new file mode 100644 index 0000000..914d915 --- /dev/null +++ b/src/app.ts @@ -0,0 +1 @@ +console.info('Hello world!') \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index fe41762..7da1b3f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,14 @@ "target": "ESNext", // Latest ECMAScript target "types": ["mocha", "node"] // Type definitions for Mocha and Node }, - "exclude": ["node_modules"], // Exclude node_modules directory - "include": ["src/**/*.{ts,tsx}", "test/**/*.{ts,tsx}"] // Include source and test files + "exclude": ["node_modules"], + "include": [ + "*.ts", + "examples/**/*.ts", + "examples/**/*.tsx", + "src/**/*.ts", + "src/**/*.tsx", + "test/**/*.ts", + "test/**/*.tsx", + ], }