@rtorcato/repo-tooling 2.59.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.
Files changed (136) hide show
  1. package/AGENTS.md +113 -0
  2. package/LICENSE +21 -0
  3. package/README.md +201 -0
  4. package/dist/cli/commands/doctor.js +336 -0
  5. package/dist/cli/commands/fix-targets.js +192 -0
  6. package/dist/cli/commands/fix.js +440 -0
  7. package/dist/cli/commands/setup-presets.js +281 -0
  8. package/dist/cli/commands/setup.js +501 -0
  9. package/dist/cli/generators/agent-rules.js +103 -0
  10. package/dist/cli/generators/badges.js +88 -0
  11. package/dist/cli/generators/build.js +216 -0
  12. package/dist/cli/generators/bun.js +25 -0
  13. package/dist/cli/generators/community-health.js +145 -0
  14. package/dist/cli/generators/docs-site.js +436 -0
  15. package/dist/cli/generators/git.js +164 -0
  16. package/dist/cli/generators/github-actions.js +35 -0
  17. package/dist/cli/generators/github-workflows.js +24 -0
  18. package/dist/cli/generators/gitlab-ci.js +10 -0
  19. package/dist/cli/generators/index.js +123 -0
  20. package/dist/cli/generators/linting.js +54 -0
  21. package/dist/cli/generators/misc.js +298 -0
  22. package/dist/cli/generators/nx.js +16 -0
  23. package/dist/cli/generators/package-json.js +317 -0
  24. package/dist/cli/generators/pnpm-workspace.js +126 -0
  25. package/dist/cli/generators/postcss.js +24 -0
  26. package/dist/cli/generators/readme.js +268 -0
  27. package/dist/cli/generators/security.js +156 -0
  28. package/dist/cli/generators/skills-install.js +70 -0
  29. package/dist/cli/generators/tailwind.js +34 -0
  30. package/dist/cli/generators/testing.js +88 -0
  31. package/dist/cli/generators/treeshake.js +148 -0
  32. package/dist/cli/generators/tsconfig.js +27 -0
  33. package/dist/cli/generators/turborepo.js +35 -0
  34. package/dist/cli/generators/typedoc.js +40 -0
  35. package/dist/cli/index.js +332 -0
  36. package/dist/cli/utils/copy-preset.js +98 -0
  37. package/dist/cli/utils/detect-language.js +22 -0
  38. package/dist/cli/utils/format.js +32 -0
  39. package/dist/cli/utils/install.js +28 -0
  40. package/dist/cli/utils/lockfile.js +84 -0
  41. package/dist/languages/js/checks.js +949 -0
  42. package/dist/languages/js/ci.js +251 -0
  43. package/dist/languages/js/fixers.js +735 -0
  44. package/dist/languages/registry.js +37 -0
  45. package/dist/languages/swift/checks.js +127 -0
  46. package/dist/languages/swift/ci.js +165 -0
  47. package/dist/languages/swift/fixers.js +102 -0
  48. package/dist/languages/swift/git-hooks.js +63 -0
  49. package/dist/languages/swift/gitignore.js +43 -0
  50. package/dist/languages/swift/scaffold.js +244 -0
  51. package/package.json +461 -0
  52. package/tooling/biome/README.md +90 -0
  53. package/tooling/biome/biome.json +63 -0
  54. package/tooling/bun/bunfig.toml +14 -0
  55. package/tooling/changesets/README.md +35 -0
  56. package/tooling/changesets/config.json +11 -0
  57. package/tooling/claude/repo-tooling.md +87 -0
  58. package/tooling/commitlint/commitlint.d.mts +4 -0
  59. package/tooling/commitlint/commitlint.mjs +40 -0
  60. package/tooling/cypress/cypress.config.d.mts +4 -0
  61. package/tooling/cypress/cypress.config.mjs +11 -0
  62. package/tooling/docusaurus/index.d.mts +17 -0
  63. package/tooling/docusaurus/index.mjs +38 -0
  64. package/tooling/docusaurus/sync-changelog.mjs +42 -0
  65. package/tooling/docusaurus/theme-tokens.css +79 -0
  66. package/tooling/docusaurus/theme.css +378 -0
  67. package/tooling/esbuild/index.d.mts +6 -0
  68. package/tooling/esbuild/index.mjs +102 -0
  69. package/tooling/eslint/base.d.mts +6 -0
  70. package/tooling/eslint/base.mjs +122 -0
  71. package/tooling/eslint/nextjs.d.mts +4 -0
  72. package/tooling/eslint/nextjs.mjs +22 -0
  73. package/tooling/eslint/types.d.ts +58 -0
  74. package/tooling/github-actions/workflows/cloudflare-pages.yml +42 -0
  75. package/tooling/github-actions/workflows/docker-publish.yml +44 -0
  76. package/tooling/github-actions/workflows/preview-deployments.yml +54 -0
  77. package/tooling/github-actions/workflows/vercel-deploy.yml +40 -0
  78. package/tooling/jest-presets/browser/jest-preset.d.mts +4 -0
  79. package/tooling/jest-presets/browser/jest-preset.mjs +14 -0
  80. package/tooling/jest-presets/node/jest-preset.d.mts +4 -0
  81. package/tooling/jest-presets/node/jest-preset.mjs +13 -0
  82. package/tooling/mcp/mcp.json.example +27 -0
  83. package/tooling/nx/nx.json +24 -0
  84. package/tooling/oxlint/README.md +25 -0
  85. package/tooling/oxlint/oxlintrc.json +28 -0
  86. package/tooling/playwright/playwright.config.d.mts +4 -0
  87. package/tooling/playwright/playwright.config.mjs +19 -0
  88. package/tooling/prettier/index.d.mts +4 -0
  89. package/tooling/prettier/index.mjs +36 -0
  90. package/tooling/release-please/.release-please-manifest.json +3 -0
  91. package/tooling/release-please/release-please-config.json +9 -0
  92. package/tooling/rolldown/rolldown.config.d.mts +18 -0
  93. package/tooling/rolldown/rolldown.config.mjs +59 -0
  94. package/tooling/rollup/rollup.config.d.mts +20 -0
  95. package/tooling/rollup/rollup.config.mjs +70 -0
  96. package/tooling/semantic-release/docker.d.mts +4 -0
  97. package/tooling/semantic-release/docker.mjs +59 -0
  98. package/tooling/semantic-release/github.d.mts +4 -0
  99. package/tooling/semantic-release/github.mjs +79 -0
  100. package/tooling/semantic-release/index.d.mts +4 -0
  101. package/tooling/semantic-release/index.mjs +80 -0
  102. package/tooling/swift/periphery.yml +4 -0
  103. package/tooling/swift/swiftlint.yml +23 -0
  104. package/tooling/tests/exports-resolution.d.mts +14 -0
  105. package/tooling/tests/exports-resolution.mjs +68 -0
  106. package/tooling/tests/ssr-safety.d.mts +14 -0
  107. package/tooling/tests/ssr-safety.mjs +53 -0
  108. package/tooling/tsup/index.d.mts +8 -0
  109. package/tooling/tsup/index.mjs +33 -0
  110. package/tooling/typedoc/typedoc.json +7 -0
  111. package/tooling/typescript/README.md +49 -0
  112. package/tooling/typescript/reset.d.ts +9 -0
  113. package/tooling/typescript/tsconfig.base.json +84 -0
  114. package/tooling/typescript/tsconfig.build.json +11 -0
  115. package/tooling/typescript/tsconfig.bun.json +9 -0
  116. package/tooling/typescript/tsconfig.express.json +9 -0
  117. package/tooling/typescript/tsconfig.next.json +20 -0
  118. package/tooling/typescript/tsconfig.node.json +9 -0
  119. package/tooling/typescript/tsconfig.react.json +15 -0
  120. package/tooling/typescript/tsconfig.test.json +8 -0
  121. package/tooling/typescript/v1/tsconfig.base.json +81 -0
  122. package/tooling/typescript/v1/tsconfig.express.json +9 -0
  123. package/tooling/typescript/v1/tsconfig.next.json +19 -0
  124. package/tooling/typescript/v1/tsconfig.node.json +9 -0
  125. package/tooling/typescript/v1/tsconfig.react.json +14 -0
  126. package/tooling/typescript/v1/tsconfig.test.json +8 -0
  127. package/tooling/vite/vite.config.d.mts +4 -0
  128. package/tooling/vite/vite.config.mjs +18 -0
  129. package/tooling/vitest/jsdom-shims.d.mts +1 -0
  130. package/tooling/vitest/jsdom-shims.mjs +58 -0
  131. package/tooling/vitest/vitest.config.d.mts +4 -0
  132. package/tooling/vitest/vitest.config.mjs +25 -0
  133. package/tooling/vitest/vitest.config.react.d.mts +4 -0
  134. package/tooling/vitest/vitest.config.react.mjs +27 -0
  135. package/tooling/vitest/vitest.setup.d.mts +1 -0
  136. package/tooling/vitest/vitest.setup.mjs +3 -0
@@ -0,0 +1,81 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ // 🔧 Output & Module Resolution
5
+ "moduleResolution": "bundler",
6
+ "module": "esnext",
7
+ "target": "esnext",
8
+ // "module": "esnext", //
9
+ // "moduleResolution": "node", // Prefer "bundler" if you're using Vite, esbuild, etc.
10
+ // "target": "esnext", //
11
+ "lib": ["ES2022"], // Specify library files to be included in the compilation
12
+ "rootDir": "src",
13
+ "outDir": "dist",
14
+
15
+
16
+ // 🔍 JavaScript Support
17
+ "allowJs": true, // Allow JavaScript files to be compiled
18
+ "checkJs": true, // Enable type checking on JavaScript files
19
+ "resolveJsonModule": true, // Allow importing JSON files
20
+ "isolatedModules": true, // Ensure that each file can be safely transpiled independently
21
+ "esModuleInterop": true, // Enables emit interoperability between CommonJS and ES Modules
22
+ "allowSyntheticDefaultImports": true, // recommend enabling this for smoother interop
23
+
24
+ // ⚙️ Module Detection
25
+ "moduleDetection": "force", // Force module detection
26
+
27
+ // 📈 Performance
28
+ "skipLibCheck": true, // Skip type checking of declaration files
29
+ "incremental": true, // Enable incremental compilation
30
+ // Pin the build-info location so downstream emit tools (e.g. tsup's `dts`
31
+ // build) don't hit TS5074 from inheriting `incremental` without a file.
32
+ // ${configDir} resolves to the consuming project's dir (TS 5.5+).
33
+ "tsBuildInfoFile": "${configDir}/node_modules/.cache/tsconfig.tsbuildinfo",
34
+ "disableSourceOfProjectReferenceRedirect": true, // Disable source of project reference redirect
35
+
36
+ // 🚨 Strict Type Checking
37
+ "strict": true, // Enable all strict type checking options
38
+ "noUncheckedIndexedAccess": true, // Disallow accessing an index signature with an arbitrary key
39
+ "noImplicitAny": true, // Disallow implicit any type
40
+ "noImplicitReturns": true, // Disallow functions that do not return a value
41
+ "noImplicitOverride": true, // Ensure override keyword is used
42
+ "noImplicitThis": true, // Disallow 'this' with an implicit any type
43
+ "noPropertyAccessFromIndexSignature": true, // Disallow property access from index signature
44
+
45
+ // 🧹 Lint-Like Settings
46
+ "noUnusedLocals": true, // Disallow unused locals
47
+ "noUnusedParameters": true, // Disallow unused parameters
48
+ "noFallthroughCasesInSwitch": true, // Disallow fallthrough cases in switch statements
49
+
50
+ // 📦 Types & Declarations
51
+ "types": ["node", "vitest"], // Specify type declaration files to be included in the compilation
52
+ "declaration": false, // Do not generate .d.ts files
53
+ "declarationMap": false, // Do not generate sourcemaps for d.ts files
54
+
55
+ // 🛑 Emit Settings
56
+ "noEmit": true, // Do not emit output files
57
+ "sourceMap": true, // Generate sourcemaps for .ts files
58
+
59
+ "paths": { // Path mapping for module resolution
60
+ "~/*": ["./src/*"],
61
+ "@/*": ["./src/*"]
62
+ }
63
+ },
64
+ "include": ["src/**/*", "index.d.ts"], // Include files in the src directory and index.d.ts
65
+ "exclude": [
66
+ "node_modules",
67
+ "build",
68
+ "dist",
69
+ ".next",
70
+ ".expo",
71
+ "OLD",
72
+ "**/*.test.ts",
73
+ "**/*.test.tsx",
74
+ "**/*.spec.ts",
75
+ "**/*.spec.tsx",
76
+ ".turbo",
77
+ "out",
78
+ "not-used",
79
+ "vitest.config.ts"
80
+ ] // Exclude directories from compilation
81
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "lib": ["ES2022"], // Only include ES libs, no DOM
5
+ "types": ["node", "express", "vitest"], // Add express types for API development
6
+ },
7
+ "include": ["src", "index.d.ts"],
8
+ "exclude": ["node_modules", "dist", "build", "test", "**/*.test.ts", "**/*.spec.ts"]
9
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "jsx": "preserve", // Let Next.js handle JSX transformation
5
+ "lib": ["DOM", "DOM.Iterable", "ESNext"], // Include DOM types for browser APIs
6
+ "module": "esnext", // Next.js expects ESNext modules
7
+ "moduleResolution": "bundler", // Modern module resolution for Next.js
8
+ "allowJs": true, // Allow JavaScript files
9
+ "esModuleInterop": true, // Interop for CommonJS/ESM
10
+ "types": ["react", "tailwindcss", "vitest"],
11
+ "plugins": [ { "name": "next" } ], // Next.js plugin for TypeScript
12
+ "paths": {
13
+ "~/*": ["./src/*"],
14
+ "@/*": ["./src/*"]
15
+ }
16
+ },
17
+ "include": ["next-env.d.ts", "src", "pages", "app", "components", "types", "index.d.ts"],
18
+ "exclude": ["node_modules", "dist", ".next", "build", "out"]
19
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "lib": ["ES2022"],
5
+ "types": ["node", "vitest"]
6
+ },
7
+ "include": ["src", "index.d.ts"],
8
+ "exclude": ["node_modules", "dist", "build", "test", "**/*.test.ts", "**/*.spec.ts"]
9
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "jsx": "react-jsx", // Use the new JSX transform for React 17+
5
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],// Include DOM types for browser APIs
6
+ "types": ["react", "react-dom", "tailwindcss", "vitest"],
7
+ "paths": {
8
+ "~/*": ["./src/*"],
9
+ "@/*": ["./src/*"]
10
+ }
11
+ },
12
+ "include": ["src", "index.d.ts", "types"],
13
+ "exclude": ["node_modules", "dist", "build", "out", "**/*.test.ts", "**/*.spec.ts"]
14
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "types": ["node", "vitest"]
6
+ },
7
+ "include": ["src", "tests", "**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts", "**/*.spec.tsx"]
8
+ }
@@ -0,0 +1,4 @@
1
+ import type { UserConfig } from 'vite'
2
+
3
+ declare const config: UserConfig
4
+ export default config
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from 'vite'
2
+
3
+ export default defineConfig({
4
+ resolve: {
5
+ alias: {
6
+ '@': '/src',
7
+ '~': '/src',
8
+ },
9
+ },
10
+ build: {
11
+ outDir: 'dist',
12
+ sourcemap: true,
13
+ },
14
+ server: {
15
+ port: 3000,
16
+ open: true,
17
+ },
18
+ })
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,58 @@
1
+ // jsdom doesn't ship the browser APIs that Radix UI, cmdk, embla-carousel,
2
+ // react-day-picker and friends call at mount time. Import this file from your
3
+ // vitest setupFiles to install no-op polyfills for all of them:
4
+ //
5
+ // // vitest.config.ts -> test.setupFiles
6
+ // import '@rtorcato/repo-tooling/vitest/jsdom-shims'
7
+ //
8
+ // Side-effect only; nothing is exported.
9
+
10
+ if (typeof Element !== 'undefined') {
11
+ if (!Element.prototype.hasPointerCapture) {
12
+ Element.prototype.hasPointerCapture = () => false
13
+ }
14
+ if (!Element.prototype.setPointerCapture) {
15
+ Element.prototype.setPointerCapture = () => {}
16
+ }
17
+ if (!Element.prototype.releasePointerCapture) {
18
+ Element.prototype.releasePointerCapture = () => {}
19
+ }
20
+ if (!Element.prototype.scrollIntoView) {
21
+ Element.prototype.scrollIntoView = () => {}
22
+ }
23
+ }
24
+
25
+ if (typeof globalThis.ResizeObserver === 'undefined') {
26
+ globalThis.ResizeObserver = class ResizeObserver {
27
+ observe() {}
28
+ unobserve() {}
29
+ disconnect() {}
30
+ }
31
+ }
32
+
33
+ if (typeof globalThis.IntersectionObserver === 'undefined') {
34
+ globalThis.IntersectionObserver = class IntersectionObserver {
35
+ observe() {}
36
+ unobserve() {}
37
+ disconnect() {}
38
+ takeRecords() {
39
+ return []
40
+ }
41
+ root = null
42
+ rootMargin = ''
43
+ thresholds = []
44
+ }
45
+ }
46
+
47
+ if (typeof window !== 'undefined' && typeof window.matchMedia === 'undefined') {
48
+ window.matchMedia = (query) => ({
49
+ matches: false,
50
+ media: query,
51
+ onchange: null,
52
+ addListener: () => {},
53
+ removeListener: () => {},
54
+ addEventListener: () => {},
55
+ removeEventListener: () => {},
56
+ dispatchEvent: () => false,
57
+ })
58
+ }
@@ -0,0 +1,4 @@
1
+ import type { UserConfig } from 'vitest/config'
2
+
3
+ declare const config: UserConfig
4
+ export default config
@@ -0,0 +1,25 @@
1
+ import { dirname, resolve } from 'node:path'
2
+ import { fileURLToPath } from 'node:url'
3
+ import { configDefaults, defineConfig } from 'vitest/config'
4
+
5
+ const __dirname = dirname(fileURLToPath(import.meta.url))
6
+
7
+ export default defineConfig({
8
+ test: {
9
+ globals: true,
10
+ environment: 'node',
11
+ // Keep vitest's defaults, plus ignore Claude Code worktrees so mirrored
12
+ // test files under .claude/worktrees/ aren't collected twice.
13
+ exclude: [...configDefaults.exclude, '.claude/**'],
14
+ coverage: {
15
+ provider: 'v8',
16
+ reporter: ['text', 'json', 'html', 'json-summary'],
17
+ },
18
+ },
19
+ resolve: {
20
+ alias: [
21
+ { find: '@', replacement: resolve(__dirname, './src') },
22
+ { find: '~', replacement: resolve(__dirname, './src') },
23
+ ],
24
+ },
25
+ })
@@ -0,0 +1,4 @@
1
+ import type { UserConfig } from 'vitest/config'
2
+
3
+ declare const config: UserConfig
4
+ export default config
@@ -0,0 +1,27 @@
1
+ import base from '@rtorcato/repo-tooling/vitest/config'
2
+ import react from '@vitejs/plugin-react'
3
+ import { dirname, resolve } from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { defineConfig, mergeConfig } from 'vitest/config'
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url))
8
+
9
+ export default mergeConfig(
10
+ base,
11
+ defineConfig({
12
+ plugins: [react()],
13
+ test: {
14
+ environment: 'jsdom',
15
+ include: ['src/**/*.{test,spec}.{js,jsx,ts,tsx}'],
16
+ css: true, // ← Vitest will stub every *.css / *.module.css import
17
+ exclude: ['OLD/**'],
18
+ setupFiles: ['./vitest.setup.ts'],
19
+ },
20
+ resolve: {
21
+ alias: [
22
+ { find: '@', replacement: resolve(__dirname, './src') },
23
+ { find: '~', replacement: resolve(__dirname, './src') },
24
+ ],
25
+ },
26
+ })
27
+ )
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,3 @@
1
+ import { vi } from 'vitest'
2
+
3
+ vi.mock('**/*.module.css', () => ({}))