@danhezcode/test-auto-release 1.0.1 โ 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release.yml +54 -0
- package/.github/workflows/validations.yml +63 -0
- package/CHANGELOG.md +39 -0
- package/changelog-preset.js +17 -0
- package/commitlint.config.js +1 -0
- package/eslint.config.js +214 -0
- package/package.json +27 -21
- package/prettier.config.js +12 -0
- package/release.config.mjs +50 -0
- package/src/index.ts +3 -0
- package/tests/index.test.ts +7 -0
- package/tsconfig.json +61 -0
- package/tsdown.config.ts +6 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["Validations"]
|
|
6
|
+
types: [completed]
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
id-token: write
|
|
13
|
+
issues: write
|
|
14
|
+
pull-requests: write
|
|
15
|
+
packages: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
release:
|
|
19
|
+
name: Semantic Release
|
|
20
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
timeout-minutes: 10
|
|
23
|
+
concurrency: release
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout repo
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0 # Necesario para semantic-release
|
|
30
|
+
|
|
31
|
+
- name: Setup Node.js
|
|
32
|
+
uses: actions/setup-node@v4
|
|
33
|
+
with:
|
|
34
|
+
node-version: 24
|
|
35
|
+
|
|
36
|
+
- name: Setup pnpm
|
|
37
|
+
uses: pnpm/action-setup@v4
|
|
38
|
+
with:
|
|
39
|
+
version: 10
|
|
40
|
+
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: pnpm install --frozen-lockfile
|
|
43
|
+
|
|
44
|
+
# - name: Audit dependencies
|
|
45
|
+
# run: pnpm audit --prod --audit-level=moderate && pnpm audit signatures
|
|
46
|
+
|
|
47
|
+
# - name: Build
|
|
48
|
+
# run: pnpm build
|
|
49
|
+
|
|
50
|
+
- name: Semantic Release
|
|
51
|
+
env:
|
|
52
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
53
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
54
|
+
run: pnpm release
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: Validations
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: ["**"]
|
|
6
|
+
|
|
7
|
+
push:
|
|
8
|
+
branches: [main, develop]
|
|
9
|
+
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
checks: write
|
|
14
|
+
statuses: write
|
|
15
|
+
contents: read
|
|
16
|
+
pull-requests: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
validate:
|
|
20
|
+
name: Validate Code Quality
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
timeout-minutes: 15
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout repo
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0 # Necesario para commitlint
|
|
29
|
+
|
|
30
|
+
- name: Setup Node.js
|
|
31
|
+
uses: actions/setup-node@v4
|
|
32
|
+
with:
|
|
33
|
+
node-version: 24
|
|
34
|
+
|
|
35
|
+
- name: Setup pnpm
|
|
36
|
+
uses: pnpm/action-setup@v4
|
|
37
|
+
with:
|
|
38
|
+
version: 10
|
|
39
|
+
|
|
40
|
+
- name: Install dependencies
|
|
41
|
+
run: pnpm install --frozen-lockfile
|
|
42
|
+
|
|
43
|
+
- name: Lint
|
|
44
|
+
run: pnpm lint:fix
|
|
45
|
+
|
|
46
|
+
- name: Format check
|
|
47
|
+
run: pnpm format:prettier
|
|
48
|
+
|
|
49
|
+
- name: TypeScript check
|
|
50
|
+
run: pnpm typecheck
|
|
51
|
+
|
|
52
|
+
- name: Run tests
|
|
53
|
+
run: pnpm test
|
|
54
|
+
|
|
55
|
+
# - name: Build check
|
|
56
|
+
# run: pnpm build
|
|
57
|
+
|
|
58
|
+
# - name: Audit dependencies
|
|
59
|
+
# run: pnpm audit --prod --audit-level=moderate && pnpm audit signatures
|
|
60
|
+
|
|
61
|
+
- name: Commitlint
|
|
62
|
+
if: github.event_name == 'pull_request'
|
|
63
|
+
run: pnpm commitlint --from=${{ github.event.pull_request.base.sha }} --to=HEAD
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# [1.1.0](https://github.com/DanhezCode/test-release/compare/v1.0.0...v1.1.0) (2026-04-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add writerOps in code ([7ce96ec](https://github.com/DanhezCode/test-release/commit/7ce96ecd8b49f57f002ffef0beb54bf5f97d85cc))
|
|
7
|
+
* remove imports ([ac111b2](https://github.com/DanhezCode/test-release/commit/ac111b2e609ab67b5d1c7252f7fcda274358b831))
|
|
8
|
+
* update import preset ([ee75269](https://github.com/DanhezCode/test-release/commit/ee7526920216a82664a029995c7d77ef57ba0bea))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* edit messages ([589d69d](https://github.com/DanhezCode/test-release/commit/589d69d433ff1751c38f1284ca450285542ee231))
|
|
14
|
+
|
|
15
|
+
# Changelog
|
|
16
|
+
|
|
17
|
+
All notable changes to this project will be documented in this file.
|
|
18
|
+
|
|
19
|
+
# 1.0.0 (2026-04-02)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* update package.json ([cf63326](https://github.com/DanhezCode/test-release/commit/cf63326a28d6e1220c89a202e35f29b0a411f6ee))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* add ESLint and Prettier configuration files for code quality ([f1446e6](https://github.com/DanhezCode/test-release/commit/f1446e6d9e470f604954edf00340676d3064e777))
|
|
30
|
+
* add semantic release configuration and initial project setup ([3722ca8](https://github.com/DanhezCode/test-release/commit/3722ca84a66f4a4dc0b3ed3b35da1831bef93a56))
|
|
31
|
+
* add semantic-release ([0beb66d](https://github.com/DanhezCode/test-release/commit/0beb66db048bf6d3a2ffad1241fb3f81b42bffe0))
|
|
32
|
+
* comment out build and audit steps in workflows ([75f11bc](https://github.com/DanhezCode/test-release/commit/75f11bc63755f71dd9d01304c2428ec86d6d1c00))
|
|
33
|
+
* enhance tsconfig.json with additional compiler options and improved organization ([1abac8e](https://github.com/DanhezCode/test-release/commit/1abac8e775a94656d1df36f914c0abba7bb4ad58))
|
|
34
|
+
* up v ([6d8aa74](https://github.com/DanhezCode/test-release/commit/6d8aa74112aaee1c494714ef52273dcc65cccbfc))
|
|
35
|
+
* up v1.0.1 ([1cc7e47](https://github.com/DanhezCode/test-release/commit/1cc7e47ca4d13aa608af0f8d5c40b04ab630c0a5))
|
|
36
|
+
* update ESLint config to ignore 'bench' and include test files in tsconfig ([28b9620](https://github.com/DanhezCode/test-release/commit/28b9620328e070ab2da9beab8276334b834b6dff))
|
|
37
|
+
* update package metadata with correct author and repository details ([5a5d652](https://github.com/DanhezCode/test-release/commit/5a5d652531689a352223b3920500b06ad450dcab))
|
|
38
|
+
* update package name to include scope ([58917fe](https://github.com/DanhezCode/test-release/commit/58917fe498760b359c652ca0eaf340ad7ede8ed9))
|
|
39
|
+
* update scripts in package.json for linting, formatting, and testing ([c4a46cd](https://github.com/DanhezCode/test-release/commit/c4a46cd55f3757927f1edb974855eff9b37c900f))
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import writerOpts from "conventional-changelog-writer";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
writerOpts: {
|
|
5
|
+
...writerOpts,
|
|
6
|
+
types: [
|
|
7
|
+
{ type: "feat", section: "๐ New Features", hidden: false },
|
|
8
|
+
{ type: "fix", section: "๐ Bug Fixes", hidden: false },
|
|
9
|
+
{ type: "docs", section: "๐ Documentation Improvements", hidden: false },
|
|
10
|
+
{ type: "style", section: "๐จ Code Style & Formatting", hidden: false },
|
|
11
|
+
{ type: "refactor", section: "๐ง Code Refactoring", hidden: false },
|
|
12
|
+
{ type: "perf", section: "โก Performance Improvements", hidden: false },
|
|
13
|
+
{ type: "test", section: "๐งช Test Updates", hidden: false },
|
|
14
|
+
{ type: "chore", section: "๐ฆ Internal Maintenance", hidden: false },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default { extends: ["@commitlint/config-conventional"] };
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
// Base ESLint configs
|
|
2
|
+
import js from "@eslint/js";
|
|
3
|
+
import ts from "typescript-eslint";
|
|
4
|
+
|
|
5
|
+
// Plugins
|
|
6
|
+
import globals from "globals";
|
|
7
|
+
import importPlugin from "eslint-plugin-import";
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { defineConfig } from "eslint/config";
|
|
10
|
+
// import reactPlugin from "eslint-plugin-react";
|
|
11
|
+
|
|
12
|
+
const gitignore = readFileSync(".gitignore", "utf8").split("\n").filter(Boolean);
|
|
13
|
+
|
|
14
|
+
export default defineConfig(
|
|
15
|
+
/**
|
|
16
|
+
* -------------------------------------------------------
|
|
17
|
+
* Files and folders to ignore during linting
|
|
18
|
+
* -------------------------------------------------------
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
{
|
|
22
|
+
ignores: [
|
|
23
|
+
// Gitignored files and folders
|
|
24
|
+
...gitignore,
|
|
25
|
+
|
|
26
|
+
// NEXT: Ignore bench temporarily, remove later
|
|
27
|
+
"bench",
|
|
28
|
+
|
|
29
|
+
// Configuration files
|
|
30
|
+
"*.config.{mjs,js,ts}",
|
|
31
|
+
|
|
32
|
+
// Dependency folders
|
|
33
|
+
"node_modules",
|
|
34
|
+
|
|
35
|
+
// Lockfiles (pnpm, bun, npm, yarn)
|
|
36
|
+
"pnpm-lock.yaml",
|
|
37
|
+
"bun.lock",
|
|
38
|
+
"package-lock.json",
|
|
39
|
+
"yarn.lock",
|
|
40
|
+
"changelog-preset.js",
|
|
41
|
+
|
|
42
|
+
// Build artifacts
|
|
43
|
+
"dist",
|
|
44
|
+
"coverage",
|
|
45
|
+
"build",
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* -------------------------------------------------------
|
|
51
|
+
* Base JavaScript recommended rules
|
|
52
|
+
* -------------------------------------------------------
|
|
53
|
+
*/
|
|
54
|
+
js.configs.recommended,
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* -------------------------------------------------------
|
|
58
|
+
* TypeScript recommended rules
|
|
59
|
+
* - Includes type-aware rules via recommendedTypeChecked
|
|
60
|
+
* -------------------------------------------------------
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
ts.configs.recommendedTypeChecked,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Enable type-aware linting for TS files
|
|
67
|
+
* (Required for rules that need type information)
|
|
68
|
+
*/
|
|
69
|
+
{
|
|
70
|
+
languageOptions: {
|
|
71
|
+
parserOptions: {
|
|
72
|
+
projectService: true,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* -------------------------------------------------------
|
|
79
|
+
* Import plugin configuration
|
|
80
|
+
* - Enforces clean, consistent import ordering
|
|
81
|
+
* - Alphabetizes imports
|
|
82
|
+
* - Adds TypeScript resolver to avoid false positives
|
|
83
|
+
* -------------------------------------------------------
|
|
84
|
+
*/
|
|
85
|
+
{
|
|
86
|
+
plugins: {
|
|
87
|
+
import: importPlugin,
|
|
88
|
+
},
|
|
89
|
+
settings: {
|
|
90
|
+
// Ensures eslint-plugin-import resolves TS paths correctly
|
|
91
|
+
"import/resolver": {
|
|
92
|
+
typescript: {
|
|
93
|
+
project: "./tsconfig.json",
|
|
94
|
+
alwaysTryTypes: true,
|
|
95
|
+
},
|
|
96
|
+
node: {
|
|
97
|
+
extensions: [".js", ".ts"],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
rules: {
|
|
102
|
+
"import/order": [
|
|
103
|
+
"error",
|
|
104
|
+
{
|
|
105
|
+
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
|
|
106
|
+
"newlines-between": "always",
|
|
107
|
+
alphabetize: { order: "asc", caseInsensitive: true },
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* -------------------------------------------------------
|
|
115
|
+
* Global variables for browser and Node environments
|
|
116
|
+
* -------------------------------------------------------
|
|
117
|
+
*/
|
|
118
|
+
{
|
|
119
|
+
languageOptions: {
|
|
120
|
+
globals: {
|
|
121
|
+
...globals.browser,
|
|
122
|
+
...globals.node,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* -------------------------------------------------------
|
|
129
|
+
* Custom rules (your explicit, clean, no-magic style)
|
|
130
|
+
* -------------------------------------------------------
|
|
131
|
+
*/
|
|
132
|
+
{
|
|
133
|
+
rules: {
|
|
134
|
+
// Disable base rule and use TS version instead
|
|
135
|
+
"no-unused-vars": "off",
|
|
136
|
+
|
|
137
|
+
// Allow unused variables prefixed with "__"
|
|
138
|
+
"@typescript-eslint/no-unused-vars": [
|
|
139
|
+
"error",
|
|
140
|
+
{ argsIgnorePattern: "^__", varsIgnorePattern: "^__" },
|
|
141
|
+
],
|
|
142
|
+
|
|
143
|
+
// Allow console.warn and console.error only
|
|
144
|
+
// "no-console": ["warn", { allow: ["warn", "error"] }],
|
|
145
|
+
|
|
146
|
+
// Enforce consistent type imports
|
|
147
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
148
|
+
"error",
|
|
149
|
+
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* -------------------------------------------------------
|
|
156
|
+
* React support (commented out)
|
|
157
|
+
* - Enables React linting rules
|
|
158
|
+
* - Includes JSX runtime rules for React 17+
|
|
159
|
+
* - Auto-detects installed React version
|
|
160
|
+
* -------------------------------------------------------
|
|
161
|
+
*/
|
|
162
|
+
// {
|
|
163
|
+
// files: ["**/*.jsx", "**/*.tsx"],
|
|
164
|
+
// plugins: {
|
|
165
|
+
// react: reactPlugin,
|
|
166
|
+
// },
|
|
167
|
+
// rules: {
|
|
168
|
+
// // Recommended React rules
|
|
169
|
+
// ...reactPlugin.configs.recommended.rules,
|
|
170
|
+
// // Rules for the new JSX transform (no need to import React)
|
|
171
|
+
// ...reactPlugin.configs["jsx-runtime"].rules,
|
|
172
|
+
// },
|
|
173
|
+
// settings: {
|
|
174
|
+
// react: {
|
|
175
|
+
// version: "detect", // Automatically detects installed React version
|
|
176
|
+
// },
|
|
177
|
+
// },
|
|
178
|
+
// },
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* -------------------------------------------------------
|
|
182
|
+
* Preact support (commented out)
|
|
183
|
+
* - Enables Preact-specific JSX linting
|
|
184
|
+
* - Uses eslint-plugin-react compatibility mode
|
|
185
|
+
* - Works with @preact/preset-vite or Next.js + Preact
|
|
186
|
+
* -------------------------------------------------------
|
|
187
|
+
*/
|
|
188
|
+
// {
|
|
189
|
+
// files: ["**/*.jsx", "**/*.tsx"],
|
|
190
|
+
// plugins: {
|
|
191
|
+
// react: reactPlugin,
|
|
192
|
+
// },
|
|
193
|
+
// settings: {
|
|
194
|
+
// react: {
|
|
195
|
+
// pragma: "h", // Preact's JSX pragma
|
|
196
|
+
// version: "detect",
|
|
197
|
+
// },
|
|
198
|
+
// // Allows eslint-plugin-import to resolve Preact aliases
|
|
199
|
+
// "import/resolver": {
|
|
200
|
+
// alias: {
|
|
201
|
+
// map: [
|
|
202
|
+
// ["react", "preact/compat"],
|
|
203
|
+
// ["react-dom", "preact/compat"],
|
|
204
|
+
// ],
|
|
205
|
+
// extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
206
|
+
// },
|
|
207
|
+
// },
|
|
208
|
+
// },
|
|
209
|
+
// rules: {
|
|
210
|
+
// // React rules still apply because Preact uses the same JSX semantics
|
|
211
|
+
// ...reactPlugin.configs.recommended.rules,
|
|
212
|
+
// },
|
|
213
|
+
// },
|
|
214
|
+
);
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danhezcode/test-auto-release",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"description": "A starter for creating a TypeScript package.",
|
|
6
|
-
"author": "
|
|
6
|
+
"author": "danhezcode@gmail.com",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"homepage": "https://github.com/
|
|
8
|
+
"homepage": "https://github.com/DanhezCode/test-release#readme",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/DanhezCode/test-release.git"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/DanhezCode/test-release/issues"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
17
|
".": "./dist/index.mjs",
|
|
@@ -20,13 +20,28 @@
|
|
|
20
20
|
"main": "./dist/index.mjs",
|
|
21
21
|
"module": "./dist/index.mjs",
|
|
22
22
|
"types": "./dist/index.d.mts",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
23
|
+
"scripts": {
|
|
24
|
+
"lint": "eslint . --ext .ts",
|
|
25
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"format:prettier": "prettier --write .",
|
|
28
|
+
"format:all": "pnpm lint:fix && pnpm format:prettier",
|
|
29
|
+
"check": "concurrently \"pnpm format:all\" \"pnpm typecheck\"",
|
|
30
|
+
"check:all": "concurrently \"pnpm format:all\" \"pnpm typecheck\" \"pnpm test\"",
|
|
31
|
+
"test": "vitest run",
|
|
32
|
+
"test:watch": "vitest --watch",
|
|
33
|
+
"test:coverage": "vitest run --coverage",
|
|
34
|
+
"release": "semantic-release",
|
|
35
|
+
"prepare": "husky"
|
|
36
|
+
},
|
|
26
37
|
"devDependencies": {
|
|
27
38
|
"@commitlint/cli": "20.3.0",
|
|
28
39
|
"@commitlint/config-conventional": "20.3.0",
|
|
29
40
|
"@eslint/js": "9.39.2",
|
|
41
|
+
"@semantic-release/changelog": "6.0.3",
|
|
42
|
+
"@semantic-release/git": "10.0.1",
|
|
43
|
+
"@semantic-release/github": "12.0.6",
|
|
44
|
+
"@semantic-release/npm": "13.1.4",
|
|
30
45
|
"@types/bun": "latest",
|
|
31
46
|
"@types/node": "25.0.6",
|
|
32
47
|
"eslint": "9.39.2",
|
|
@@ -36,21 +51,12 @@
|
|
|
36
51
|
"globals": "17.0.0",
|
|
37
52
|
"husky": "9.1.7",
|
|
38
53
|
"prettier": "3.7.4",
|
|
54
|
+
"semantic-release": "25.0.3",
|
|
39
55
|
"tsdown": "0.20.0-beta.4",
|
|
40
56
|
"typescript-eslint": "8.51.0",
|
|
41
57
|
"vitest": "4.0.17"
|
|
42
58
|
},
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"lint:fix": "eslint . --ext .ts --fix",
|
|
46
|
-
"typecheck": "tsc --noEmit",
|
|
47
|
-
"format:prettier": "prettier --write .",
|
|
48
|
-
"format:all": "pnpm lint:fix && pnpm format:prettier",
|
|
49
|
-
"check": "concurrently \"pnpm format:all\" \"pnpm typecheck\"",
|
|
50
|
-
"check:all": "concurrently \"pnpm format:all\" \"pnpm typecheck\" \"pnpm test\"",
|
|
51
|
-
"test": "vitest run",
|
|
52
|
-
"test:watch": "vitest --watch",
|
|
53
|
-
"test:coverage": "vitest run --coverage",
|
|
54
|
-
"release": "semantic-release"
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"conventional-changelog-writer": "^8.4.0"
|
|
55
61
|
}
|
|
56
|
-
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** @type {import('semantic-release').GlobalConfig} */
|
|
2
|
+
export default {
|
|
3
|
+
branches: ["main", { name: "beta", prerelease: "beta", channel: "beta" }],
|
|
4
|
+
|
|
5
|
+
plugins: [
|
|
6
|
+
"@semantic-release/commit-analyzer",
|
|
7
|
+
|
|
8
|
+
[
|
|
9
|
+
"@semantic-release/release-notes-generator",
|
|
10
|
+
{
|
|
11
|
+
// preset: customPreset,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
|
|
15
|
+
[
|
|
16
|
+
"@semantic-release/changelog",
|
|
17
|
+
{
|
|
18
|
+
changelogFile: "CHANGELOG.md",
|
|
19
|
+
writerOpts: {
|
|
20
|
+
types: [
|
|
21
|
+
{ type: "feat", section: "๐ New Features", hidden: false },
|
|
22
|
+
{ type: "fix", section: "๐ Bug Fixes", hidden: false },
|
|
23
|
+
{ type: "docs", section: "๐ Documentation Improvements", hidden: false },
|
|
24
|
+
{ type: "style", section: "๐จ Code Style & Formatting", hidden: false },
|
|
25
|
+
{ type: "refactor", section: "๐ง Code Refactoring", hidden: false },
|
|
26
|
+
{ type: "perf", section: "โก Performance Improvements", hidden: false },
|
|
27
|
+
{ type: "test", section: "๐งช Test Updates", hidden: false },
|
|
28
|
+
{ type: "chore", section: "๐ฆ Internal Maintenance", hidden: false },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
|
|
34
|
+
["@semantic-release/npm", { npmPublish: true }],
|
|
35
|
+
|
|
36
|
+
[
|
|
37
|
+
"@semantic-release/git",
|
|
38
|
+
{
|
|
39
|
+
assets: ["CHANGELOG.md"],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
[
|
|
44
|
+
"@semantic-release/github",
|
|
45
|
+
{
|
|
46
|
+
assets: ["dist/**/*", "docs/**/*", "package.json", "CHANGELOG.md", "README.md", "LICENSE"],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
],
|
|
50
|
+
};
|
package/src/index.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// ----------------------------------------
|
|
4
|
+
// JS/TS language features
|
|
5
|
+
// ----------------------------------------
|
|
6
|
+
"target": "ESNext", // Use latest JS features
|
|
7
|
+
"lib": ["ESNext"], // Include latest JS APIs
|
|
8
|
+
// "allowJs": true, // Allow .js files in the project
|
|
9
|
+
|
|
10
|
+
// ----------------------------------------
|
|
11
|
+
// Interoperability
|
|
12
|
+
// ----------------------------------------
|
|
13
|
+
"resolveJsonModule": true, // Allow importing .json files
|
|
14
|
+
"types": ["node"], // Include Node.js type definitions
|
|
15
|
+
"esModuleInterop": true, // Enable default-like imports for CommonJS
|
|
16
|
+
|
|
17
|
+
// ----------------------------------------
|
|
18
|
+
// Core build behavior
|
|
19
|
+
// ----------------------------------------
|
|
20
|
+
"incremental": true, // Enable incremental compilation for faster rebuilds
|
|
21
|
+
"declaration": true, // Generate .d.ts type declaration files
|
|
22
|
+
"emitDeclarationOnly": true, // Emit only .d.ts files without generating JavaScript
|
|
23
|
+
// "noEmit": true, // Type checking only; do not emit JS
|
|
24
|
+
// "outDir": "./dist", // Output directory for emitted files
|
|
25
|
+
|
|
26
|
+
// ----------------------------------------
|
|
27
|
+
// Module system & resolution
|
|
28
|
+
// ----------------------------------------
|
|
29
|
+
"module": "preserve", // Keep import/export syntax as written
|
|
30
|
+
"moduleResolution": "bundler", // Modern bundler-friendly resolution
|
|
31
|
+
"moduleDetection": "force", // Force module detection for ESNext
|
|
32
|
+
"verbatimModuleSyntax": true, // Preserve exact import/export syntax
|
|
33
|
+
// "allowImportingTsExtensions": true, // Allow importing .ts with explicit extensions
|
|
34
|
+
|
|
35
|
+
// ----------------------------------------
|
|
36
|
+
// Type checking & strictness
|
|
37
|
+
// ----------------------------------------
|
|
38
|
+
"strict": true, // Enable all strict type checking
|
|
39
|
+
"skipLibCheck": true, // Skip type checking of external libs
|
|
40
|
+
"noFallthroughCasesInSwitch": true, // Prevent silent fallthrough
|
|
41
|
+
"noUncheckedIndexedAccess": true, // Safer indexed access
|
|
42
|
+
"noImplicitOverride": true, // Require `override` keyword
|
|
43
|
+
"isolatedDeclarations": true, // Ensure each file can generate its own .d.ts in isolation (safer, deterministic types)
|
|
44
|
+
|
|
45
|
+
// ----------------------------------------
|
|
46
|
+
// Misc flags
|
|
47
|
+
// ----------------------------------------
|
|
48
|
+
"noUnusedLocals": false, // Allow unused local variables (fix by linter)
|
|
49
|
+
"noUnusedParameters": false, // Allow unused function parameters (useful for API signatures or future expansion)
|
|
50
|
+
"noPropertyAccessFromIndexSignature": false // Permit direct property access even when coming from an index signature
|
|
51
|
+
|
|
52
|
+
// ----------------------------------------
|
|
53
|
+
// JSX
|
|
54
|
+
// ----------------------------------------
|
|
55
|
+
// "jsx": "react-jsx", // Modern JSX transform
|
|
56
|
+
// "jsxImportSource": "preact", // Uncomment for Preact
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// Only analyze files inside src/
|
|
60
|
+
"include": ["src", "tests"]
|
|
61
|
+
}
|