@regardio/dev 1.18.3 → 1.20.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/README.md CHANGED
@@ -51,23 +51,28 @@ Detailed documentation is organized by topic:
51
51
 
52
52
  ### Concepts
53
53
 
54
- - [Development Principles](./docs/concepts/development-principles.md) - Code quality, architecture, maintainability
55
- - [Coding Standards](./docs/concepts/coding-standards.md) - TypeScript, React, and general patterns
56
- - [Naming Conventions](./docs/concepts/naming-conventions.md) - Consistent naming across languages
57
- - [Commit Conventions](./docs/concepts/commits.md) - Conventional commits and changelog generation
58
- - [Testing Approach](./docs/concepts/testing.md) - Testing philosophy and patterns
59
- - [AI Agent Guidelines](./docs/concepts/ai-agents.md) - Instructions for AI coding assistants
54
+ - [AI Agents](./docs/en/agents.md) - Instructions for AI coding assistants
55
+ - [API](./docs/en/api.md) - API design and implementation guidelines
56
+ - [Coding](./docs/en/coding.md) - TypeScript, React, and general patterns
57
+ - [Commits](./docs/en/commits.md) - Conventional commits and changelog generation
58
+ - [Documentation](./docs/en/documentation.md) - Documentation structure and conventions
59
+ - [Naming](./docs/en/naming.md) - Consistent naming across languages
60
+ - [Principles](./docs/en/principles.md) - Code quality, architecture, maintainability
61
+ - [React](./docs/en/react.md) - React and TypeScript development patterns
62
+ - [SQL](./docs/en/sql.md) - PostgreSQL/Supabase schema styling and structure
63
+ - [Testing](./docs/en/testing.md) - Testing philosophy and patterns
64
+ - [Writing](./docs/en/writing.md) - Voice, tone, and language for content
60
65
 
61
66
  ### Toolchain
62
67
 
63
- - [TypeScript](./docs/toolchain/typescript.md) - Strict TypeScript configuration
64
- - [Biome](./docs/toolchain/biome.md) - Linting and formatting
65
- - [Vitest](./docs/toolchain/vitest.md) - Unit and integration testing
66
- - [Playwright](./docs/toolchain/playwright.md) - End-to-end testing
67
- - [Commitlint](./docs/toolchain/commitlint.md) - Commit message validation
68
- - [Markdownlint](./docs/toolchain/markdownlint.md) - Markdown quality
69
- - [Husky](./docs/toolchain/husky.md) - Git hooks
70
- - [Release Workflow](./docs/toolchain/release-workflow.md) - GitLab-flow-based versioning and releases
68
+ - [Biome](./docs/en/toolchain/biome.md) - Linting and formatting
69
+ - [Commitlint](./docs/en/toolchain/commitlint.md) - Commit message validation
70
+ - [Husky](./docs/en/toolchain/husky.md) - Git hooks
71
+ - [Markdownlint](./docs/en/toolchain/markdownlint.md) - Markdown quality
72
+ - [Playwright](./docs/en/toolchain/playwright.md) - End-to-end testing
73
+ - [Releases](./docs/en/toolchain/releases.md) - GitLab-flow-based versioning and releases
74
+ - [TypeScript](./docs/en/toolchain/typescript.md) - Strict TypeScript configuration
75
+ - [Vitest](./docs/en/toolchain/vitest.md) - Unit and integration testing
71
76
 
72
77
  ## Portability
73
78
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { execSync } from 'node:child_process';
2
3
  import { existsSync, readFileSync, writeFileSync } from 'node:fs';
3
4
  import { join } from 'node:path';
4
5
  import { branchExists, bumpVersion, git, gitRead, insertChangelog, runQualityChecks, runScript, } from './utils.js';
@@ -77,7 +78,31 @@ if (subcommand === 'finish') {
77
78
  const today = new Date().toISOString().slice(0, 10);
78
79
  insertChangelog(changelogPath, `## [${newVersion}] - ${today} (hotfix)\n\n${message}\n`);
79
80
  try {
80
- runScript('fix');
81
+ runScript('fix:pkg');
82
+ }
83
+ catch {
84
+ }
85
+ try {
86
+ git('add', '-A');
87
+ const changedFiles = gitRead('diff', '--cached', '--name-only').split('\n').filter(Boolean);
88
+ for (const file of changedFiles) {
89
+ if (file.endsWith('.json')) {
90
+ try {
91
+ execSync(`npx biome check --write ${file}`, { cwd: process.cwd(), stdio: 'inherit' });
92
+ }
93
+ catch {
94
+ }
95
+ }
96
+ }
97
+ for (const file of changedFiles) {
98
+ if (file.endsWith('.md')) {
99
+ try {
100
+ execSync(`npx markdownlint-cli2 --fix ${file}`, { cwd: process.cwd(), stdio: 'inherit' });
101
+ }
102
+ catch {
103
+ }
104
+ }
105
+ }
81
106
  }
82
107
  catch {
83
108
  }
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { execSync } from 'node:child_process';
2
3
  import { existsSync, readFileSync, writeFileSync } from 'node:fs';
3
4
  import { join } from 'node:path';
4
5
  import { branchExists, bumpVersion, confirm, git, gitRead, insertChangelog, runQualityChecks, runScript, } from './utils.js';
@@ -77,7 +78,31 @@ const changelogPath = join(process.cwd(), 'CHANGELOG.md');
77
78
  const today = new Date().toISOString().slice(0, 10);
78
79
  insertChangelog(changelogPath, `## [${newVersion}] - ${today}\n\n${changeBody}\n`);
79
80
  try {
80
- runScript('fix');
81
+ runScript('fix:pkg');
82
+ }
83
+ catch {
84
+ }
85
+ try {
86
+ git('add', '-A');
87
+ const changedFiles = gitRead('diff', '--cached', '--name-only').split('\n').filter(Boolean);
88
+ for (const file of changedFiles) {
89
+ if (file.endsWith('.json')) {
90
+ try {
91
+ execSync(`npx biome check --write ${file}`, { cwd: process.cwd(), stdio: 'inherit' });
92
+ }
93
+ catch {
94
+ }
95
+ }
96
+ }
97
+ for (const file of changedFiles) {
98
+ if (file.endsWith('.md')) {
99
+ try {
100
+ execSync(`npx markdownlint-cli2 --fix ${file}`, { cwd: process.cwd(), stdio: 'inherit' });
101
+ }
102
+ catch {
103
+ }
104
+ }
105
+ }
81
106
  }
82
107
  catch {
83
108
  }
@@ -1,9 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { existsSync, readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
- import { branchExists, git, gitRead, runQualityChecks, runScript } from './utils.js';
5
- const args = process.argv.slice(2);
6
- const message = args.join(' ') || 'auto-fix formatting';
4
+ import { branchExists, git, gitRead, runQualityChecks } from './utils.js';
7
5
  const currentBranch = gitRead('branch', '--show-current');
8
6
  if (currentBranch !== 'main') {
9
7
  console.error(`Must be on the main branch to release. Currently on: ${currentBranch}`);
@@ -42,16 +40,6 @@ catch {
42
40
  process.exit(1);
43
41
  }
44
42
  console.log('✅ Quality checks passed');
45
- try {
46
- runScript('fix');
47
- }
48
- catch {
49
- }
50
- git('add', '-A');
51
- const hasStagedChanges = gitRead('diff', '--cached', '--name-only') !== '';
52
- if (hasStagedChanges) {
53
- git('commit', '-m', `chore(staging): ${message}`);
54
- }
55
43
  console.log('\nMerging main into staging...');
56
44
  git('checkout', 'staging');
57
45
  git('merge', '--ff-only', 'main');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package.json",
3
3
  "name": "@regardio/dev",
4
- "version": "1.18.3",
4
+ "version": "1.20.0",
5
5
  "private": false,
6
6
  "description": "Regardio developer tooling for testing, linting, and build workflows",
7
7
  "keywords": [
@@ -93,7 +93,7 @@
93
93
  "typecheck": "tsc --noEmit"
94
94
  },
95
95
  "dependencies": {
96
- "@biomejs/biome": "2.4.9",
96
+ "@biomejs/biome": "2.4.10",
97
97
  "@commitlint/cli": "20.5.0",
98
98
  "@commitlint/config-conventional": "20.5.0",
99
99
  "@playwright/test": "1.58.2",
@@ -101,19 +101,19 @@
101
101
  "@testing-library/react": "16.3.2",
102
102
  "@total-typescript/ts-reset": "0.6.1",
103
103
  "@types/node": "25.5.0",
104
- "@vitest/coverage-v8": "4.1.1",
105
- "@vitest/ui": "4.1.1",
104
+ "@vitest/coverage-v8": "4.1.2",
105
+ "@vitest/ui": "4.1.2",
106
106
  "husky": "9.1.7",
107
107
  "jsdom": "29.0.1",
108
108
  "markdownlint-cli2": "0.22.0",
109
109
  "npm-run-all": "4.1.5",
110
110
  "postcss": "8.5.8",
111
111
  "rimraf": "6.1.3",
112
- "rollup": "4.60.0",
112
+ "rollup": "4.60.1",
113
113
  "sort-package-json": "3.6.1",
114
114
  "typescript": "6.0.2",
115
- "vite": "8.0.2",
116
- "vitest": "4.1.1"
115
+ "vite": "8.0.3",
116
+ "vitest": "4.1.2"
117
117
  },
118
118
  "devDependencies": {
119
119
  "tsx": "4.21.0"
@@ -22,6 +22,7 @@
22
22
  * 7. Pushes all three branches, deletes the hotfix branch
23
23
  * 8. Checks out main
24
24
  */
25
+ import { execSync } from 'node:child_process';
25
26
  import { existsSync, readFileSync, writeFileSync } from 'node:fs';
26
27
  import { join } from 'node:path';
27
28
 
@@ -146,11 +147,41 @@ if (subcommand === 'finish') {
146
147
  const today = new Date().toISOString().slice(0, 10);
147
148
  insertChangelog(changelogPath, `## [${newVersion}] - ${today} (hotfix)\n\n${message}\n`);
148
149
 
149
- // Fix formatting if available
150
+ // Fix formatting of modified files (package.json, CHANGELOG.md)
150
151
  try {
151
- runScript('fix');
152
+ runScript('fix:pkg');
152
153
  } catch {
153
- // fix may not exist in all packages
154
+ // fix:pkg may not exist
155
+ }
156
+
157
+ // Format modified files
158
+ try {
159
+ git('add', '-A');
160
+ const changedFiles = gitRead('diff', '--cached', '--name-only').split('\n').filter(Boolean);
161
+
162
+ // Format JSON files with biome
163
+ for (const file of changedFiles) {
164
+ if (file.endsWith('.json')) {
165
+ try {
166
+ execSync(`npx biome check --write ${file}`, { cwd: process.cwd(), stdio: 'inherit' });
167
+ } catch {
168
+ // File might not need formatting or biome not available
169
+ }
170
+ }
171
+ }
172
+
173
+ // Format markdown files with markdownlint
174
+ for (const file of changedFiles) {
175
+ if (file.endsWith('.md')) {
176
+ try {
177
+ execSync(`npx markdownlint-cli2 --fix ${file}`, { cwd: process.cwd(), stdio: 'inherit' });
178
+ } catch {
179
+ // File might not need formatting or markdownlint not available
180
+ }
181
+ }
182
+ }
183
+ } catch {
184
+ // Formatters not available
154
185
  }
155
186
 
156
187
  // Commit
@@ -23,6 +23,7 @@
23
23
  * 10. Merges production back into main to ensure consistency
24
24
  * 11. Returns to main
25
25
  */
26
+ import { execSync } from 'node:child_process';
26
27
  import { existsSync, readFileSync, writeFileSync } from 'node:fs';
27
28
  import { join } from 'node:path';
28
29
 
@@ -167,12 +168,42 @@ const today = new Date().toISOString().slice(0, 10);
167
168
  insertChangelog(changelogPath, `## [${newVersion}] - ${today}\n\n${changeBody}\n`);
168
169
 
169
170
  // ---------------------------------------------------------------------------
170
- // Fix formatting if available
171
+ // Fix formatting of modified files (package.json, CHANGELOG.md)
171
172
  // ---------------------------------------------------------------------------
172
173
  try {
173
- runScript('fix');
174
+ runScript('fix:pkg');
174
175
  } catch {
175
- // fix may not exist in all packages
176
+ // fix:pkg may not exist
177
+ }
178
+
179
+ // Format modified files
180
+ try {
181
+ git('add', '-A');
182
+ const changedFiles = gitRead('diff', '--cached', '--name-only').split('\n').filter(Boolean);
183
+
184
+ // Format JSON files with biome
185
+ for (const file of changedFiles) {
186
+ if (file.endsWith('.json')) {
187
+ try {
188
+ execSync(`npx biome check --write ${file}`, { cwd: process.cwd(), stdio: 'inherit' });
189
+ } catch {
190
+ // File might not need formatting or biome not available
191
+ }
192
+ }
193
+ }
194
+
195
+ // Format markdown files with markdownlint
196
+ for (const file of changedFiles) {
197
+ if (file.endsWith('.md')) {
198
+ try {
199
+ execSync(`npx markdownlint-cli2 --fix ${file}`, { cwd: process.cwd(), stdio: 'inherit' });
200
+ } catch {
201
+ // File might not need formatting or markdownlint not available
202
+ }
203
+ }
204
+ }
205
+ } catch {
206
+ // Formatters not available
176
207
  }
177
208
 
178
209
  // ---------------------------------------------------------------------------
@@ -19,18 +19,14 @@
19
19
  * This script:
20
20
  * 1. Ensures the current branch is main and the working tree is clean
21
21
  * 2. Pulls latest main from origin
22
- * 3. Runs quality checks locally (build, typecheck, tests)
23
- * 4. Runs fix commits formatting output (if any) with a commitlint-compliant message
24
- * 5. Merges main into staging (fast-forward) and pushes
25
- * 6. Pushes main and returns so work can continue
22
+ * 3. Runs quality checks locally (build, lint, typecheck, tests)
23
+ * 4. Merges main into staging (fast-forward) and pushes
24
+ * 5. Pushes main and returns so work can continue
26
25
  */
27
26
  import { existsSync, readFileSync } from 'node:fs';
28
27
  import { join } from 'node:path';
29
28
 
30
- import { branchExists, git, gitRead, runQualityChecks, runScript } from './utils.js';
31
-
32
- const args = process.argv.slice(2);
33
- const message = args.join(' ') || 'auto-fix formatting';
29
+ import { branchExists, git, gitRead, runQualityChecks } from './utils.js';
34
30
 
35
31
  // ---------------------------------------------------------------------------
36
32
  // Guard: must be on main
@@ -93,24 +89,6 @@ try {
93
89
  }
94
90
  console.log('✅ Quality checks passed');
95
91
 
96
- // ---------------------------------------------------------------------------
97
- // Fix formatting if available
98
- // ---------------------------------------------------------------------------
99
- try {
100
- runScript('fix');
101
- } catch {
102
- // fix may not exist in all packages
103
- }
104
-
105
- // ---------------------------------------------------------------------------
106
- // Commit formatting fixes (if any)
107
- // ---------------------------------------------------------------------------
108
- git('add', '-A');
109
- const hasStagedChanges = gitRead('diff', '--cached', '--name-only') !== '';
110
- if (hasStagedChanges) {
111
- git('commit', '-m', `chore(staging): ${message}`);
112
- }
113
-
114
92
  // ---------------------------------------------------------------------------
115
93
  // Merge into staging
116
94
  // ---------------------------------------------------------------------------