@regardio/dev 1.24.0 → 2.0.2

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.
Files changed (128) hide show
  1. package/README.md +2 -2
  2. package/dist/bin/ship/hotfix.bin.mjs +140 -0
  3. package/dist/bin/ship/production.bin.mjs +120 -0
  4. package/dist/bin/ship/staging.bin.mjs +70 -0
  5. package/dist/bin/ship/utils-BQ-JZ2D5.mjs +45 -0
  6. package/dist/playwright/index.d.mts +24 -0
  7. package/dist/playwright/index.mjs +61 -0
  8. package/dist/vitest/node.d.mts +22 -0
  9. package/dist/vitest/node.mjs +28 -0
  10. package/dist/vitest/react.d.mts +22 -0
  11. package/dist/vitest/react.mjs +28 -0
  12. package/docs/en/README.md +95 -0
  13. package/docs/en/agents.md +57 -0
  14. package/docs/en/standards/api.md +324 -0
  15. package/docs/en/standards/coding.md +144 -0
  16. package/docs/en/standards/commits.md +111 -0
  17. package/docs/en/standards/documentation.md +173 -0
  18. package/docs/en/standards/naming.md +180 -0
  19. package/docs/en/standards/principles.md +84 -0
  20. package/docs/en/standards/react.md +246 -0
  21. package/docs/en/standards/sql.md +258 -0
  22. package/docs/en/standards/testing.md +139 -0
  23. package/docs/en/standards/writing.md +119 -0
  24. package/docs/en/tools/biome.md +89 -0
  25. package/docs/en/tools/commitlint.md +92 -0
  26. package/docs/en/tools/dependencies.md +116 -0
  27. package/docs/en/tools/husky.md +90 -0
  28. package/docs/en/tools/markdownlint.md +84 -0
  29. package/docs/en/tools/playwright.md +117 -0
  30. package/docs/en/tools/releases.md +242 -0
  31. package/docs/en/tools/typescript.md +89 -0
  32. package/docs/en/tools/vitest.md +146 -0
  33. package/package.json +57 -70
  34. package/src/biome/preset.json +3 -0
  35. package/templates/changeset/README.md +14 -0
  36. package/templates/changeset/config.json +11 -0
  37. package/templates/github/release.yml +77 -0
  38. package/dist/bin/exec/clean.d.ts +0 -3
  39. package/dist/bin/exec/clean.d.ts.map +0 -1
  40. package/dist/bin/exec/clean.js +0 -25
  41. package/dist/bin/exec/clean.test.d.ts +0 -2
  42. package/dist/bin/exec/clean.test.d.ts.map +0 -1
  43. package/dist/bin/exec/clean.test.js +0 -45
  44. package/dist/bin/exec/husky.d.ts +0 -3
  45. package/dist/bin/exec/husky.d.ts.map +0 -1
  46. package/dist/bin/exec/husky.js +0 -9
  47. package/dist/bin/exec/p.d.ts +0 -3
  48. package/dist/bin/exec/p.d.ts.map +0 -1
  49. package/dist/bin/exec/p.js +0 -8
  50. package/dist/bin/exec/s.d.ts +0 -3
  51. package/dist/bin/exec/s.d.ts.map +0 -1
  52. package/dist/bin/exec/s.js +0 -8
  53. package/dist/bin/exec/tsc.d.ts +0 -3
  54. package/dist/bin/exec/tsc.d.ts.map +0 -1
  55. package/dist/bin/exec/tsc.js +0 -8
  56. package/dist/bin/lint/biome.d.ts +0 -3
  57. package/dist/bin/lint/biome.d.ts.map +0 -1
  58. package/dist/bin/lint/biome.js +0 -8
  59. package/dist/bin/lint/commit.d.ts +0 -3
  60. package/dist/bin/lint/commit.d.ts.map +0 -1
  61. package/dist/bin/lint/commit.js +0 -8
  62. package/dist/bin/lint/md.d.ts +0 -3
  63. package/dist/bin/lint/md.d.ts.map +0 -1
  64. package/dist/bin/lint/md.js +0 -16
  65. package/dist/bin/lint/package.d.ts +0 -4
  66. package/dist/bin/lint/package.d.ts.map +0 -1
  67. package/dist/bin/lint/package.js +0 -81
  68. package/dist/bin/lint/package.test.d.ts +0 -2
  69. package/dist/bin/lint/package.test.d.ts.map +0 -1
  70. package/dist/bin/lint/package.test.js +0 -65
  71. package/dist/bin/ship/hotfix.d.ts +0 -3
  72. package/dist/bin/ship/hotfix.d.ts.map +0 -1
  73. package/dist/bin/ship/hotfix.js +0 -141
  74. package/dist/bin/ship/production.d.ts +0 -3
  75. package/dist/bin/ship/production.d.ts.map +0 -1
  76. package/dist/bin/ship/production.js +0 -124
  77. package/dist/bin/ship/staging.d.ts +0 -3
  78. package/dist/bin/ship/staging.d.ts.map +0 -1
  79. package/dist/bin/ship/staging.js +0 -51
  80. package/dist/bin/ship/utils.d.ts +0 -9
  81. package/dist/bin/ship/utils.d.ts.map +0 -1
  82. package/dist/bin/ship/utils.js +0 -63
  83. package/dist/bin/ship/utils.test.d.ts +0 -2
  84. package/dist/bin/ship/utils.test.d.ts.map +0 -1
  85. package/dist/bin/ship/utils.test.js +0 -127
  86. package/dist/config.test.d.ts +0 -2
  87. package/dist/config.test.d.ts.map +0 -1
  88. package/dist/config.test.js +0 -101
  89. package/dist/playwright/index.d.ts +0 -10
  90. package/dist/playwright/index.d.ts.map +0 -1
  91. package/dist/playwright/index.js +0 -42
  92. package/dist/playwright/index.test.d.ts +0 -2
  93. package/dist/playwright/index.test.d.ts.map +0 -1
  94. package/dist/playwright/index.test.js +0 -55
  95. package/dist/testing/setup-react.d.ts +0 -2
  96. package/dist/testing/setup-react.d.ts.map +0 -1
  97. package/dist/testing/setup-react.js +0 -1
  98. package/dist/vitest/node.d.ts +0 -22
  99. package/dist/vitest/node.d.ts.map +0 -1
  100. package/dist/vitest/node.js +0 -16
  101. package/dist/vitest/react.d.ts +0 -17
  102. package/dist/vitest/react.d.ts.map +0 -1
  103. package/dist/vitest/react.js +0 -12
  104. package/src/bin/exec/clean.test.ts +0 -63
  105. package/src/bin/exec/clean.ts +0 -36
  106. package/src/bin/exec/husky.ts +0 -14
  107. package/src/bin/exec/p.ts +0 -13
  108. package/src/bin/exec/s.ts +0 -13
  109. package/src/bin/exec/tsc.ts +0 -13
  110. package/src/bin/lint/biome.ts +0 -13
  111. package/src/bin/lint/commit.ts +0 -13
  112. package/src/bin/lint/md.ts +0 -28
  113. package/src/bin/lint/package.test.ts +0 -83
  114. package/src/bin/lint/package.ts +0 -108
  115. package/src/bin/ship/hotfix.ts +0 -241
  116. package/src/bin/ship/production.ts +0 -240
  117. package/src/bin/ship/staging.ts +0 -108
  118. package/src/bin/ship/utils.test.ts +0 -178
  119. package/src/bin/ship/utils.ts +0 -109
  120. package/src/config.test.ts +0 -129
  121. package/src/markdownlint/markdownlint-cli2.jsonc +0 -9
  122. package/src/playwright/index.test.ts +0 -73
  123. package/src/playwright/index.ts +0 -63
  124. package/src/templates/release.yml +0 -128
  125. package/src/testing/setup-react.ts +0 -8
  126. package/src/vitest/node.ts +0 -25
  127. package/src/vitest/react.ts +0 -19
  128. /package/{src → templates}/sqlfluff/setup.cfg +0 -0
@@ -0,0 +1,89 @@
1
+ ---
2
+
3
+ title: TypeScript Configuration
4
+ type: guide
5
+ status: published
6
+ summary: TypeScript setup and configuration for Regardio projects
7
+ related: [biome, vitest]
8
+ locale: en-US
9
+ ---
10
+
11
+ # TypeScript Configuration
12
+
13
+ Strict shared TypeScript presets for Regardio projects. Extend from `@regardio/dev` instead of rebuilding config from scratch. Keep strict settings enabled.
14
+
15
+ ## Presets
16
+
17
+ | Preset | Use Case |
18
+ |--------|----------|
19
+ | `@regardio/dev/typescript/base` | Node.js packages, libraries |
20
+ | `@regardio/dev/typescript/react` | React applications and components |
21
+ | `@regardio/dev/typescript/build` | Build-specific settings (extends base) |
22
+
23
+ ## Configuration
24
+
25
+ ### tsconfig.json
26
+
27
+ ```json
28
+ {
29
+ "extends": "@regardio/dev/typescript/base",
30
+ "include": ["src/**/*.ts"]
31
+ }
32
+ ```
33
+
34
+ For React projects:
35
+
36
+ ```json
37
+ {
38
+ "extends": "@regardio/dev/typescript/react",
39
+ "include": ["src/**/*.ts", "src/**/*.tsx"]
40
+ }
41
+ ```
42
+
43
+ ### tsconfig.build.json
44
+
45
+ Separate build config for production output:
46
+
47
+ ```json
48
+ {
49
+ "compilerOptions": {
50
+ "outDir": "./dist",
51
+ "rootDir": "./src"
52
+ },
53
+ "extends": ["./tsconfig.json", "@regardio/dev/typescript/build"],
54
+ "include": ["src/**/*.ts"]
55
+ }
56
+ ```
57
+
58
+ ## Strict Settings
59
+
60
+ The base config enables strict TypeScript checking:
61
+
62
+ - `strict: true` - All strict type-checking options
63
+ - `noUncheckedIndexedAccess: true` - Adds `undefined` to index signatures
64
+ - `exactOptionalPropertyTypes: true` - Distinguishes between `undefined` and missing
65
+ - `noImplicitReturns: true` - All code paths must return a value
66
+ - `noFallthroughCasesInSwitch: true` - Prevents switch fallthrough bugs
67
+
68
+ ## Scripts
69
+
70
+ ```json
71
+ {
72
+ "scripts": {
73
+ "build": "exec-tsc --project tsconfig.build.json",
74
+ "typecheck": "exec-tsc --noEmit"
75
+ }
76
+ }
77
+ ```
78
+
79
+ Run `typecheck` regularly during development to catch type errors early.
80
+
81
+ Related documents:
82
+
83
+ - [Biome](./biome.md) — Linting and formatting
84
+ - [Vitest](./vitest.md) — Unit and integration testing for TypeScript projects
85
+
86
+ ### Resources
87
+
88
+ - [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/)
89
+ - [tsconfig Reference](https://www.typescriptlang.org/tsconfig)
@@ -0,0 +1,146 @@
1
+ ---
2
+
3
+ title: Vitest
4
+ type: guide
5
+ status: published
6
+ summary: Unit and integration testing for TypeScript projects
7
+ related: [typescript, playwright]
8
+ locale: en-US
9
+ ---
10
+
11
+ # Vitest
12
+
13
+ Unit and integration testing for TypeScript projects. Vite-native, TypeScript-first. Configuration centralized in `@regardio/dev`.
14
+
15
+ ## Coverage Thresholds
16
+
17
+ Library packages must meet minimum coverage thresholds before publishing:
18
+
19
+ | Metric | Minimum |
20
+ |--------|---------|
21
+ | **Statements** | 80% |
22
+ | **Branches** | 80% |
23
+ | **Functions** | 80% |
24
+ | **Lines** | 80% |
25
+
26
+ These thresholds are enforced by:
27
+
28
+ 1. **`pnpm report`** - Fails if coverage is below thresholds
29
+ 2. **`ship-staging`** - Runs coverage check before deploying to staging
30
+ 3. **GitHub Actions** - Runs coverage check before publishing to npm
31
+
32
+ To check coverage locally:
33
+
34
+ ```bash
35
+ pnpm report
36
+ ```
37
+
38
+ ## Configuration
39
+
40
+ ### Node.js Packages
41
+
42
+ ```typescript
43
+ // vitest.config.ts
44
+ import { defineConfig } from 'vitest/config';
45
+ import { vitestNodeConfig } from '@regardio/dev/vitest/node';
46
+
47
+ export default defineConfig({ test: vitestNodeConfig });
48
+ ```
49
+
50
+ ### React Packages
51
+
52
+ ```typescript
53
+ // vitest.config.ts
54
+ import { defineConfig } from 'vitest/config';
55
+ import { vitestReactConfig } from '@regardio/dev/vitest/react';
56
+
57
+ export default defineConfig({ test: vitestReactConfig });
58
+ ```
59
+
60
+ ## Scripts
61
+
62
+ ```json
63
+ {
64
+ "scripts": {
65
+ "test": "exec-s test:*",
66
+ "test:unit": "vitest run",
67
+ "report": "vitest run --coverage"
68
+ }
69
+ }
70
+ ```
71
+
72
+ Required devDependencies:
73
+
74
+ ```json
75
+ {
76
+ "devDependencies": {
77
+ "@regardio/dev": "^1.11.0",
78
+ "@vitest/coverage-v8": "^4.0.0",
79
+ "vitest": "^4.0.0"
80
+ }
81
+ }
82
+ ```
83
+
84
+ ## Running Tests
85
+
86
+ ```bash
87
+ pnpm test:unit # Run all tests once
88
+ pnpm vitest # Watch mode
89
+ pnpm vitest --ui # Visual UI
90
+ pnpm vitest --coverage # With coverage report
91
+ ```
92
+
93
+ ## Test File Naming
94
+
95
+ - Unit tests: `*.test.ts` or `*.test.tsx`
96
+ - Place tests next to source files or in `__tests__` directories
97
+
98
+ ## Writing Tests
99
+
100
+ Follow the Arrange-Act-Assert pattern:
101
+
102
+ ```typescript
103
+ import { describe, it, expect } from 'vitest';
104
+
105
+ describe('calculateTotal', () => {
106
+ it('should apply discount correctly', () => {
107
+ // Arrange
108
+ const items = [{ price: 100 }, { price: 50 }];
109
+ const discount = 0.1;
110
+
111
+ // Act
112
+ const total = calculateTotal(items, discount);
113
+
114
+ // Assert
115
+ expect(total).toBe(135);
116
+ });
117
+ });
118
+ ```
119
+
120
+ ## React Component Testing
121
+
122
+ ```typescript
123
+ import { render, screen } from '@testing-library/react';
124
+ import userEvent from '@testing-library/user-event';
125
+ import { Button } from './Button';
126
+
127
+ it('calls onClick when clicked', async () => {
128
+ const handleClick = vi.fn();
129
+ render(<Button onClick={handleClick}>Click me</Button>);
130
+
131
+ await userEvent.click(screen.getByRole('button'));
132
+
133
+ expect(handleClick).toHaveBeenCalledOnce();
134
+ });
135
+ ```
136
+
137
+ Related documents:
138
+
139
+ - [Testing Approach](../standards/testing.md) — Testing philosophy and patterns for Regardio projects
140
+ - [Playwright](./playwright.md) — End-to-end testing for web applications
141
+ - [TypeScript Configuration](./typescript.md) — TypeScript setup and configuration for Regardio projects
142
+
143
+ ### Resources
144
+
145
+ - [Vitest Documentation](https://vitest.dev/)
146
+ - [Testing Library](https://testing-library.com/)
package/package.json CHANGED
@@ -1,31 +1,34 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package.json",
3
3
  "name": "@regardio/dev",
4
- "version": "1.24.0",
4
+ "version": "2.0.2",
5
5
  "private": false,
6
- "description": "Regardio developer tooling for testing, linting, and build workflows",
6
+ "description": "Regardio development presets: biome, typescript, commitlint, markdownlint, vitest, playwright, sqlfluff, husky, and GitLab-flow ship tooling",
7
7
  "keywords": [
8
8
  "biome",
9
9
  "commitlint",
10
10
  "dev",
11
11
  "documentation",
12
+ "gitlab-flow",
12
13
  "husky",
13
14
  "linting",
14
15
  "markdownlint",
15
16
  "playwright",
17
+ "release",
16
18
  "sqlfluff",
17
19
  "testing",
18
20
  "tooling",
19
21
  "typescript",
20
22
  "vitest"
21
23
  ],
22
- "homepage": "https://github.com/regardio/dev/blob/main/README.md",
24
+ "homepage": "https://codeberg.org/regardio/commons/src/branch/main/packages/dev",
23
25
  "bugs": {
24
- "url": "https://github.com/regardio/dev/issues"
26
+ "url": "https://codeberg.org/regardio/commons/issues"
25
27
  },
26
28
  "repository": {
27
29
  "type": "git",
28
- "url": "git+https://github.com/regardio/dev.git"
30
+ "url": "git+https://codeberg.org/regardio/commons.git",
31
+ "directory": "packages/dev"
29
32
  },
30
33
  "license": "MIT",
31
34
  "author": "Bernd Matzner <bernd.matzner@regard.io>",
@@ -35,92 +38,76 @@
35
38
  "./biome": "./src/biome/preset.json",
36
39
  "./commitlint": "./src/commitlint/commitlint.cjs",
37
40
  "./markdownlint": "./src/markdownlint/markdownlint.json",
38
- "./markdownlint-cli2": "./src/markdownlint/markdownlint-cli2.jsonc",
39
41
  "./playwright": {
40
- "types": "./dist/playwright/index.d.ts",
41
- "default": "./dist/playwright/index.js"
42
+ "import": "./dist/playwright/index.mjs",
43
+ "types": "./dist/playwright/index.d.mts"
42
44
  },
43
- "./testing/setup-react": {
44
- "types": "./dist/testing/setup-react.d.ts",
45
- "default": "./dist/testing/setup-react.js"
46
- },
47
- "./typescript/base.json": "./src/typescript/base.json",
48
- "./typescript/build.json": "./src/typescript/build.json",
49
- "./typescript/react.json": "./src/typescript/react.json",
45
+ "./typescript/base": "./src/typescript/base.json",
46
+ "./typescript/build": "./src/typescript/build.json",
47
+ "./typescript/react": "./src/typescript/react.json",
50
48
  "./vitest/node": {
51
- "types": "./dist/vitest/node.d.ts",
52
- "default": "./dist/vitest/node.js"
49
+ "import": "./dist/vitest/node.mjs",
50
+ "types": "./dist/vitest/node.d.mts"
53
51
  },
54
52
  "./vitest/react": {
55
- "types": "./dist/vitest/react.d.ts",
56
- "default": "./dist/vitest/react.js"
53
+ "import": "./dist/vitest/react.mjs",
54
+ "types": "./dist/vitest/react.d.mts"
57
55
  }
58
56
  },
59
57
  "bin": {
60
- "exec-clean": "dist/bin/exec/clean.js",
61
- "exec-husky": "dist/bin/exec/husky.js",
62
- "exec-p": "dist/bin/exec/p.js",
63
- "exec-s": "dist/bin/exec/s.js",
64
- "exec-tsc": "dist/bin/exec/tsc.js",
65
- "lint-biome": "dist/bin/lint/biome.js",
66
- "lint-commit": "dist/bin/lint/commit.js",
67
- "lint-md": "dist/bin/lint/md.js",
68
- "lint-package": "dist/bin/lint/package.js",
69
- "ship-hotfix": "dist/bin/ship/hotfix.js",
70
- "ship-production": "dist/bin/ship/production.js",
71
- "ship-staging": "dist/bin/ship/staging.js"
58
+ "ship-hotfix": "dist/bin/ship/hotfix.bin.mjs",
59
+ "ship-production": "dist/bin/ship/production.bin.mjs",
60
+ "ship-staging": "dist/bin/ship/staging.bin.mjs"
72
61
  },
73
62
  "files": [
74
63
  "dist",
75
- "src"
64
+ "src/biome",
65
+ "src/commitlint",
66
+ "src/markdownlint",
67
+ "src/typescript",
68
+ "docs",
69
+ "templates"
76
70
  ],
71
+ "devDependencies": {
72
+ "@total-typescript/ts-reset": "0.6.1",
73
+ "@types/node": "25.6.0",
74
+ "@vitest/coverage-v8": "4.1.5",
75
+ "tsdown": "0.21.9",
76
+ "vitest": "4.1.5"
77
+ },
78
+ "peerDependencies": {
79
+ "@biomejs/biome": ">=2",
80
+ "@changesets/changelog-git": ">=0.2",
81
+ "@changesets/cli": ">=2",
82
+ "@commitlint/cli": ">=20",
83
+ "@commitlint/config-conventional": ">=20",
84
+ "@playwright/test": ">=1",
85
+ "@testing-library/jest-dom": ">=6",
86
+ "@testing-library/react": ">=16",
87
+ "husky": ">=9",
88
+ "jsdom": ">=29",
89
+ "markdownlint-cli2": ">=0.22",
90
+ "typescript": ">=6",
91
+ "vitest": ">=4"
92
+ },
93
+ "engines": {
94
+ "node": ">=24"
95
+ },
77
96
  "scripts": {
78
- "build": "tsc -p tsconfig.build.json",
79
- "clean": "tsx src/bin/exec/clean.ts .turbo dist",
97
+ "build": "tsdown",
98
+ "clean": "rimraf .turbo dist",
99
+ "dev": "tsdown --watch",
80
100
  "fix": "run-s fix:pkg fix:md fix:biome",
81
101
  "fix:biome": "biome check --write --unsafe .",
82
102
  "fix:md": "markdownlint-cli2 --fix",
83
- "fix:pkg": "tsx src/bin/lint/package.ts --fix",
103
+ "fix:pkg": "sort-package-json",
84
104
  "lint": "run-s lint:md lint:biome",
85
105
  "lint:biome": "biome check .",
86
106
  "lint:md": "markdownlint-cli2",
87
- "lint:pkg": "tsx src/bin/lint/package.ts",
88
- "prepare": "husky",
89
- "report": "vitest run --coverage",
90
- "ship:hotfix": "tsx src/bin/ship/hotfix.ts",
91
- "ship:production": "tsx src/bin/ship/production.ts",
92
- "ship:staging": "tsx src/bin/ship/staging.ts",
107
+ "lint:pkg": "sort-package-json --check",
93
108
  "test": "run-p test:*",
109
+ "test:e2e": "echo 'no e2e tests'",
94
110
  "test:unit": "vitest run",
95
111
  "typecheck": "tsc --noEmit"
96
- },
97
- "dependencies": {
98
- "@biomejs/biome": "2.4.12",
99
- "@commitlint/cli": "20.5.0",
100
- "@commitlint/config-conventional": "20.5.0",
101
- "@playwright/test": "1.59.1",
102
- "@testing-library/jest-dom": "6.9.1",
103
- "@testing-library/react": "16.3.2",
104
- "@total-typescript/ts-reset": "0.6.1",
105
- "@types/node": "25.6.0",
106
- "@vitest/coverage-v8": "4.1.4",
107
- "@vitest/ui": "4.1.4",
108
- "husky": "9.1.7",
109
- "jsdom": "29.0.2",
110
- "markdownlint-cli2": "0.22.0",
111
- "npm-run-all": "4.1.5",
112
- "postcss": "8.5.10",
113
- "rimraf": "6.1.3",
114
- "rollup": "4.60.1",
115
- "sort-package-json": "3.6.1",
116
- "typescript": "6.0.2",
117
- "vite": "8.0.8",
118
- "vitest": "4.1.4"
119
- },
120
- "devDependencies": {
121
- "tsx": "4.21.0"
122
- },
123
- "engines": {
124
- "node": ">=24"
125
112
  }
126
113
  }
@@ -336,6 +336,9 @@
336
336
  }
337
337
  }
338
338
  },
339
+ "formatter": {
340
+ "enabled": false
341
+ },
339
342
  "includes": ["**/package.json"]
340
343
  }
341
344
  ],
@@ -0,0 +1,14 @@
1
+ # Changesets
2
+
3
+ Pending version bumps live here as small Markdown files. Add one with `pnpm changeset` whenever you make a version-worthy change.
4
+
5
+ ## How it fits the GitLab flow
6
+
7
+ - On `main`, authors run `pnpm changeset` alongside their change to describe the bump.
8
+ - `ship-staging` deploys to staging without touching versions.
9
+ - `ship-production` runs quality checks, consumes pending changesets (bumping versions and updating each package's `CHANGELOG.md`), commits the bumps on `main`, and merges to `production`.
10
+ - CI on `production` runs `changeset publish` to push the new versions to npm.
11
+
12
+ ## Skipping a release
13
+
14
+ If a commit is tooling-only and should not trigger a release, don't add a changeset.
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
3
+ "access": "public",
4
+ "baseBranch": "main",
5
+ "changelog": "@changesets/changelog-git",
6
+ "commit": false,
7
+ "fixed": [],
8
+ "ignore": [],
9
+ "linked": [],
10
+ "updateInternalDependencies": "patch"
11
+ }
@@ -0,0 +1,77 @@
1
+ # Regardio Release Workflow (GitHub Actions)
2
+ # Copy this file to .github/workflows/release.yml
3
+ #
4
+ # Required setup:
5
+ # 1. Initialize Changesets in your repo:
6
+ # cp -r node_modules/@regardio/dev/templates/changeset .changeset
7
+ # 2. Add these scripts to package.json:
8
+ # "changeset": "changeset",
9
+ # "changeset:publish": "changeset publish",
10
+ # "ship:staging": "ship-staging",
11
+ # "ship:production": "ship-production",
12
+ # "ship:hotfix": "ship-hotfix"
13
+ # 3. Create the branches:
14
+ # git checkout -b staging && git push -u origin staging
15
+ # git checkout -b production && git push -u origin production
16
+ # 4. Add `NPM_TOKEN` to repo secrets. First npm publish of any new package
17
+ # must be done locally (`npm publish --access public`).
18
+ #
19
+ # Usage:
20
+ # - Author adds a changeset on main: `pnpm changeset`
21
+ # - `pnpm ship:staging` deploys to staging for validation
22
+ # - `pnpm ship:production` consumes changesets locally, bumps versions, merges
23
+ # to production. This workflow then publishes to npm.
24
+
25
+ name: Release
26
+
27
+ on:
28
+ push:
29
+ branches:
30
+ - production
31
+
32
+ concurrency: ${{ github.workflow }}-${{ github.ref }}
33
+
34
+ jobs:
35
+ release:
36
+ name: Release
37
+ runs-on: ubuntu-latest
38
+ permissions:
39
+ contents: write
40
+ id-token: write
41
+ steps:
42
+ - name: Checkout
43
+ uses: actions/checkout@v6
44
+ with:
45
+ fetch-depth: 0
46
+
47
+ - name: Setup pnpm
48
+ uses: pnpm/action-setup@v5
49
+ with:
50
+ version: 10
51
+
52
+ - name: Setup Node.js
53
+ uses: actions/setup-node@v6
54
+ with:
55
+ node-version: 24
56
+ registry-url: https://registry.npmjs.org
57
+
58
+ - name: Install dependencies
59
+ run: pnpm install --frozen-lockfile
60
+
61
+ - name: Build
62
+ run: pnpm -r build
63
+
64
+ - name: Publish changed public packages
65
+ # `changeset publish`:
66
+ # - walks the workspace topologically
67
+ # - replaces `workspace:*` with real versions
68
+ # - skips packages where the current version already exists on npm
69
+ # - skips packages marked `"private": true`
70
+ # - creates git tags like `@scope/pkg@1.2.3` for each published package
71
+ run: pnpm changeset publish
72
+ env:
73
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
74
+ NPM_CONFIG_PROVENANCE: "true"
75
+
76
+ - name: Push tags
77
+ run: git push --tags
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export declare function resolveRimrafBin(require: NodeRequire): string | null;
3
- //# sourceMappingURL=clean.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/clean.ts"],"names":[],"mappings":";AAcA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAQpE"}
@@ -1,25 +0,0 @@
1
- #!/usr/bin/env node
2
- import { spawn } from 'node:child_process';
3
- import { createRequire } from 'node:module';
4
- import path from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- export function resolveRimrafBin(require) {
7
- const pkgPath = require.resolve('rimraf/package.json');
8
- const pkg = require(pkgPath);
9
- const binRel = typeof pkg.bin === 'string' ? pkg.bin : pkg.bin?.rimraf;
10
- if (!binRel)
11
- return null;
12
- const normalized = binRel.startsWith('./') ? binRel.slice(2) : binRel;
13
- return path.join(path.dirname(pkgPath), normalized);
14
- }
15
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
16
- const require = createRequire(import.meta.url);
17
- const bin = resolveRimrafBin(require);
18
- if (!bin) {
19
- console.error('Unable to locate rimraf binary from package.json bin field');
20
- process.exit(1);
21
- }
22
- const args = process.argv.slice(2);
23
- const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
24
- child.on('exit', (code) => process.exit(code ?? 0));
25
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=clean.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clean.test.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/clean.test.ts"],"names":[],"mappings":""}
@@ -1,45 +0,0 @@
1
- import { createRequire } from 'node:module';
2
- import path from 'node:path';
3
- import { describe, expect, it } from 'vitest';
4
- import { resolveRimrafBin } from './clean.js';
5
- function makeRequire(pkgPath, pkg) {
6
- const req = (id) => (id === pkgPath ? pkg : undefined);
7
- req.resolve = (_id) => pkgPath;
8
- return req;
9
- }
10
- describe('resolveRimrafBin', () => {
11
- it('resolves when bin is a plain string', () => {
12
- const pkgPath = '/node_modules/rimraf/package.json';
13
- const req = makeRequire(pkgPath, { bin: './dist/esm/bin.js' });
14
- const result = resolveRimrafBin(req);
15
- expect(result).toBe(path.join('/node_modules/rimraf', 'dist/esm/bin.js'));
16
- });
17
- it('strips leading ./ from the bin path', () => {
18
- const pkgPath = '/node_modules/rimraf/package.json';
19
- const req = makeRequire(pkgPath, { bin: './bin/rimraf' });
20
- const result = resolveRimrafBin(req);
21
- expect(result).toBe(path.join('/node_modules/rimraf', 'bin/rimraf'));
22
- });
23
- it('resolves when bin is an object with a rimraf key', () => {
24
- const pkgPath = '/node_modules/rimraf/package.json';
25
- const req = makeRequire(pkgPath, { bin: { rimraf: './dist/esm/bin.js' } });
26
- const result = resolveRimrafBin(req);
27
- expect(result).toBe(path.join('/node_modules/rimraf', 'dist/esm/bin.js'));
28
- });
29
- it('returns null when bin field is missing', () => {
30
- const pkgPath = '/node_modules/rimraf/package.json';
31
- const req = makeRequire(pkgPath, {});
32
- expect(resolveRimrafBin(req)).toBeNull();
33
- });
34
- it('returns null when bin object has no rimraf key', () => {
35
- const pkgPath = '/node_modules/rimraf/package.json';
36
- const req = makeRequire(pkgPath, { bin: { other: './dist/other.js' } });
37
- expect(resolveRimrafBin(req)).toBeNull();
38
- });
39
- it('resolves against the real rimraf package', () => {
40
- const req = createRequire(import.meta.url);
41
- const result = resolveRimrafBin(req);
42
- expect(result).not.toBeNull();
43
- expect(path.isAbsolute(result ?? '')).toBe(true);
44
- });
45
- });
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=husky.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"husky.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/husky.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import { spawn } from 'node:child_process';
3
- import { createRequire } from 'node:module';
4
- import { dirname, resolve } from 'node:path';
5
- const require = createRequire(import.meta.url);
6
- const bin = resolve(dirname(require.resolve('husky')), 'bin.js');
7
- const args = process.argv.slice(2);
8
- const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
9
- child.on('exit', (code) => process.exit(code ?? 0));
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=p.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"p.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/p.ts"],"names":[],"mappings":""}
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { spawn } from 'node:child_process';
3
- import { createRequire } from 'node:module';
4
- const require = createRequire(import.meta.url);
5
- const bin = require.resolve('npm-run-all/bin/run-p/index.js');
6
- const args = process.argv.slice(2);
7
- const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
8
- child.on('exit', (code) => process.exit(code ?? 0));
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=s.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"s.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/s.ts"],"names":[],"mappings":""}