Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_ENV=test
14 changes: 6 additions & 8 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:prettier/recommended",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:unicorn/recommended",
"plugin:node/recommended"
],
Expand Down Expand Up @@ -48,6 +46,7 @@
["^node:"],
["^@?\\w"],
["^@src(/.*|$)"],
["^@tests(/.*|$)"],
["^"],
["^\\."]
]
Expand All @@ -57,17 +56,16 @@
},
{
"files": ["tests/**"],
"plugins": ["jest"],
"plugins": ["vitest"],
"extends": ["plugin:vitest/recommended"],
"rules": {
"@typescript-eslint/unbound-method": "off",
"jest/unbound-method": "error",
"jest/expect-expect": "off",
"jest/no-standalone-expect": "off"
"vitest/expect-expect": "off",
"vitest/no-standalone-expect": "off"
}
}
],
"env": {
"node": true,
"jest": true
"node": true
}
}
13 changes: 6 additions & 7 deletions .github/pr-scope-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
- changed-files:
- any-glob-to-any-file:
- tests/**
- .jest/**
- scripts/merge-coverage.ts
- jest.config.ts
- nyc.config.js
- vitest.config.**.ts
- create-vitest-test-config.ts
- .env.test

📝 Documentation:
- changed-files:
Expand Down Expand Up @@ -47,10 +46,10 @@
- .swcrc
- .yamllint.yml
- commitlint.config.ts
- jest.config.ts
- vitest.config.**.ts
- create-vitest-test-config.ts
- .env.test
- lint-staged.config.js
- nest-cli.json
- nyc.config.js
- prettier.config.js
- tsconfig.json
- tsconfig.prod.json
Expand Down
1 change: 0 additions & 1 deletion .jest/set-env-vars.ts

This file was deleted.

3 changes: 2 additions & 1 deletion .swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"baseUrl": "./",
"paths": {
"@src/*": ["src/*"]
"@src/*": ["src/*"],
"@tests/*": ["tests/*"]
},
"target": "es2022"
},
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<a href="https://nodejs.org/docs/latest-v20.x/api/index.html"><img src="https://img.shields.io/badge/node-20.x-green.svg" alt="node"/></a>
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/supported_node-18.x_--_20.x-forestgreen.svg" alt="supported node"/></a>
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/typescript-5.x-blue.svg" alt="typescript"/></a>
<a href="https://vitest.dev/"><img src="https://img.shields.io/badge/Test-Vitest_-yellow.svg" alt="swc"/></a>
</p>

## 👀 Motivation
Expand All @@ -29,7 +30,7 @@ The main objective of this template is to provide a good base configuration for
- 💬 Use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to ensure our commits have a convention.
- ✅ Run the tests automatically.
- ⚙️ Check our action does not have type errors with Typescript.
3. 🧪 Testing with [Jest](https://jestjs.io/es-ES/).
3. 🧪 Testing with [Vitest](https://vitest.dev/)
4. 📌 Custom path aliases, where you can define your own paths (you will be able to use imports like `@src` instead of `../../../src`).
5. 🚀 CI/CD using GitHub Actions, helping ensure a good quality of our code and providing useful insights about dependencies, security vulnerabilities and others.
6. 🥷 Fully automatized release process. You just need to merge into `main` branch using conventional commits and that's all. Automatically we will:
Expand Down
43 changes: 31 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24706,12 +24706,13 @@ exports["default"] = _default;
/***/ }),

/***/ 7672:
/***/ ((__unused_webpack_module, exports) => {
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Action = void 0;
const sleep_1 = __nccwpck_require__(9250);
class Action {
logger;
outputs;
Expand All @@ -24724,16 +24725,11 @@ class Action {
const name = inputs.name || "World";
const message = `Hello ${name}`;
this.logger.info(message);
await this.sleep(3000);
await (0, sleep_1.sleep)(3000);
this.logger.info("Change: 9");
this.outputs.save("message", message);
this.logger.info("Finished github-action-nodejs-template");
}
sleep(milliseconds) {
return new Promise((resolve) => {
setTimeout(() => resolve(), milliseconds);
});
}
}
exports.Action = Action;

Expand Down Expand Up @@ -24873,6 +24869,23 @@ class CoreOutputs {
exports.CoreOutputs = CoreOutputs;


/***/ }),

/***/ 9250:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.sleep = void 0;
const sleep = (milliseconds) => {
return new Promise((resolve) => {
setTimeout(() => resolve(), milliseconds);
});
};
exports.sleep = sleep;


/***/ }),

/***/ 9491:
Expand Down Expand Up @@ -25183,7 +25196,7 @@ Dicer.prototype._write = function (data, encoding, cb) {
if (this._headerFirst && this._isPreamble) {
if (!this._part) {
this._part = new PartStream(this._partOpts)
if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() }
if (this.listenerCount('preamble') !== 0) { this.emit('preamble', this._part) } else { this._ignore() }
}
const r = this._hparser.push(data)
if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }
Expand Down Expand Up @@ -25240,7 +25253,7 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) {
}
}
if (this._dashes === 2) {
if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) }
if ((start + i) < end && this.listenerCount('trailer') !== 0) { this.emit('trailer', data.slice(start + i, end)) }
this.reset()
this._finished = true
// no more parts will be added
Expand All @@ -25258,7 +25271,13 @@ Dicer.prototype._oninfo = function (isMatch, data, start, end) {
this._part._read = function (n) {
self._unpause()
}
if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() }
if (this._isPreamble && this.listenerCount('preamble') !== 0) {
this.emit('preamble', this._part)
} else if (this._isPreamble !== true && this.listenerCount('part') !== 0) {
this.emit('part', this._part)
} else {
this._ignore()
}
if (!this._isPreamble) { this._inHeader = true }
}
if (data && start < end && !this._ignoreData) {
Expand Down Expand Up @@ -25941,7 +25960,7 @@ function Multipart (boy, cfg) {

++nfiles

if (!boy._events.file) {
if (boy.listenerCount('file') === 0) {
self.parser._ignore()
return
}
Expand Down Expand Up @@ -26470,7 +26489,7 @@ const decoders = {
if (textDecoders.has(this.toString())) {
try {
return textDecoders.get(this).decode(data)
} catch (e) { }
} catch {}
}
return typeof data === 'string'
? data
Expand Down
32 changes: 0 additions & 32 deletions jest.config.ts

This file was deleted.

5 changes: 1 addition & 4 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
const config = {
"**/*.ts?(x)": () => "tsc -p tsconfig.prod.json --noEmit",
"*.{js,jsx,ts,tsx}": [
"npm run lint",
"jest --coverage=false --findRelatedTests --passWithNoTests",
],
"*.{js,jsx,ts,tsx}": ["npm run lint", "vitest related --run"],
"*.{md,json}": "prettier --write",
};

Expand Down
Loading