-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Experiment Feature]: TypeScript config files support - Node.js v22 #192
Comments
commitlint Replace ts-node with cosmiconfig-typescript-loader package conventional-changelog/commitlint#3722 Although the speed has improved, The cosmiconfig-typescript-loader package added ,cz-git and czg will double the size, and I am still considering it. πΆβπ«οΈ |
|
Besides, I think you have misunderstood my original issue complaining about the deps number. Since your package is strongly relying on commitlint, so you should try to reuse package that is required by it as much as possible while keeping the same major, this way you can externalize them safely as they are supposed to be installed to workspace anyway. (e.g.: The main target for tool package like this is trying to avoid requiring any new package that is heavy. A package is heavy means that it has too many deps or a lot of unused features for your usage. You can try to bundle packages with cz-git, only if they:
|
Thank you for your reply.
|
Done |
Hi there. Docs preview: https://deploy-preview-197--cz-git.netlify.app/ I have released a next pre-release version π(v1.11.0-beta.1)π for testing. I am testing in the repository https://github.com/vuepress-theme-hope/vuepress-theme-hope Suggestion (ESM js)
import { execSync } from "node:child_process";
import { readdirSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { defineConfig } from "cz-git";
const packages = readdirSync(
join(dirname(fileURLToPath(import.meta.url)), "./packages/"),
);
const scopeComplete = execSync("git status --porcelain || true")
.toString()
.trim()
.split("\n")
.find((r) => ~r.indexOf("M packages"))
?.replace(/\//g, "%%")
?.match(/packages%%((\w|-)*)/)?.[1];
export default defineConfig({
extends: ["@commitlint/config-conventional"],
rules: {
"scope-enum": [2, "always", ["demo", "release", ...packages]],
},
prompt: {
defaultScope: scopeComplete,
customScopesAlign: !scopeComplete ? "top" : "bottom",
allowCustomIssuePrefix: false,
allowEmptyIssuePrefix: false,
},
}); (TypeScript configure)- "commit": "pnpm git-cz",
+ "commit": "cross-env NODE_OPTIONS=\"--experimental-transform-types --disable-warning ExperimentalWarning\" pnpm git-cz", |
The latest version π(v1.11.0)π released and can use Node v22 to loading ts configure, But it is recommended to use ESM js configure as a transition for the future TypeScript configuration file, and switch to it after Node.js runs TypeScript stably. Docs Link: https://cz-git.qbb.sh/config/#typescript-template |
β Checklist
π System Info
π Description
See https://commitlint.js.org/reference/configuration.html
So https://cz-git.qbb.sh/config/#typescript-template should be fixed
π Reproduction link / repo:
No response
The text was updated successfully, but these errors were encountered: