@funish/basis 0.1.3 → 0.2.1

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 (80) hide show
  1. package/README.md +131 -427
  2. package/dist/_chunks/config.mjs +1 -0
  3. package/dist/_chunks/types.d.mts +194 -0
  4. package/dist/cli.d.mts +1 -1
  5. package/dist/cli.mjs +8 -1
  6. package/dist/commands/add.d.mts +2 -0
  7. package/dist/commands/add.mjs +1 -0
  8. package/dist/commands/audit.d.mts +2 -0
  9. package/dist/commands/audit.mjs +1 -0
  10. package/dist/commands/build.d.mts +2 -0
  11. package/dist/commands/build.mjs +1 -0
  12. package/dist/commands/check.d.mts +2 -0
  13. package/dist/commands/check.mjs +1 -0
  14. package/dist/commands/dlx.d.mts +2 -0
  15. package/dist/commands/dlx.mjs +1 -0
  16. package/dist/commands/fmt.d.mts +2 -0
  17. package/dist/commands/fmt.mjs +1 -0
  18. package/dist/commands/git.d.mts +2 -0
  19. package/dist/commands/git.mjs +1 -0
  20. package/dist/commands/init.d.mts +2 -0
  21. package/dist/commands/init.mjs +1 -0
  22. package/dist/commands/lint.d.mts +2 -0
  23. package/dist/commands/lint.mjs +1 -0
  24. package/dist/commands/publish.d.mts +2 -0
  25. package/dist/commands/publish.mjs +1 -0
  26. package/dist/commands/remove.d.mts +2 -0
  27. package/dist/commands/remove.mjs +1 -0
  28. package/dist/commands/run.d.mts +2 -0
  29. package/dist/commands/run.mjs +1 -0
  30. package/dist/commands/version.d.mts +2 -0
  31. package/dist/commands/version.mjs +1 -0
  32. package/dist/config.d.mts +24 -1
  33. package/dist/config.mjs +1 -1
  34. package/dist/index.d.mts +2 -178
  35. package/dist/index.mjs +1 -1
  36. package/package.json +69 -55
  37. package/dist/chunks/add.cjs +0 -1
  38. package/dist/chunks/add.mjs +0 -1
  39. package/dist/chunks/config.cjs +0 -1
  40. package/dist/chunks/config.mjs +0 -1
  41. package/dist/chunks/git.cjs +0 -1
  42. package/dist/chunks/git.mjs +0 -1
  43. package/dist/chunks/init.cjs +0 -1
  44. package/dist/chunks/init.mjs +0 -1
  45. package/dist/chunks/install.cjs +0 -1
  46. package/dist/chunks/install.mjs +0 -1
  47. package/dist/chunks/lint.cjs +0 -1
  48. package/dist/chunks/lint.mjs +0 -1
  49. package/dist/chunks/publish.cjs +0 -1
  50. package/dist/chunks/publish.mjs +0 -1
  51. package/dist/chunks/remove.cjs +0 -1
  52. package/dist/chunks/remove.mjs +0 -1
  53. package/dist/chunks/run.cjs +0 -1
  54. package/dist/chunks/run.mjs +0 -1
  55. package/dist/chunks/version.cjs +0 -1
  56. package/dist/chunks/version.mjs +0 -1
  57. package/dist/cli.cjs +0 -2
  58. package/dist/cli.d.cts +0 -1
  59. package/dist/cli.d.ts +0 -1
  60. package/dist/config.cjs +0 -1
  61. package/dist/config.d.cts +0 -1
  62. package/dist/config.d.ts +0 -1
  63. package/dist/index.cjs +0 -1
  64. package/dist/index.d.cts +0 -178
  65. package/dist/index.d.ts +0 -178
  66. package/dist/shared/basis.4m3-erzm.mjs +0 -1
  67. package/dist/shared/basis.5if__eE1.mjs +0 -8
  68. package/dist/shared/basis.Bqr6BGbD.cjs +0 -1
  69. package/dist/shared/basis.BrlVPuDi.mjs +0 -1
  70. package/dist/shared/basis.Bz4YLlJG.cjs +0 -1
  71. package/dist/shared/basis.CGkMo_WB.cjs +0 -3
  72. package/dist/shared/basis.CYJFGkEy.mjs +0 -1
  73. package/dist/shared/basis.Cc1QkX4i.mjs +0 -3
  74. package/dist/shared/basis.CyWSd-ys.mjs +0 -10
  75. package/dist/shared/basis.D3fInv-P.cjs +0 -1
  76. package/dist/shared/basis.DoHZYvYm.d.cts +0 -275
  77. package/dist/shared/basis.DoHZYvYm.d.mts +0 -275
  78. package/dist/shared/basis.DoHZYvYm.d.ts +0 -275
  79. package/dist/shared/basis.GHY7v-ns.cjs +0 -10
  80. package/dist/shared/basis.iEUClefn.cjs +0 -8
package/README.md CHANGED
@@ -4,97 +4,97 @@
4
4
  [![npm version](https://img.shields.io/npm/v/@funish/basis.svg)](https://www.npmjs.com/package/@funish/basis)
5
5
  [![npm downloads](https://img.shields.io/npm/dm/@funish/basis.svg)](https://www.npmjs.com/package/@funish/basis)
6
6
 
7
- > A unified development toolkit with CLI for package management, versioning, publishing, linting, and git hooks management for JavaScript/TypeScript projects.
7
+ > A modern development toolkit with unified CLI for package management, versioning, publishing, code quality, and Git workflow automation.
8
8
 
9
9
  **🧑‍💻 Contributing?** See the [monorepo documentation](https://github.com/funish/basis) for development setup and contribution guidelines.
10
10
 
11
11
  ## What is Basis?
12
12
 
13
- Basis is your **unified development toolkit** for modern JavaScript/TypeScript projects. Instead of juggling multiple CLI tools, Basis provides a single interface for all your development workflow needs.
13
+ Basis is your **unified development toolkit** for modern projects. Instead of juggling multiple CLI tools, Basis provides a single interface for all your development workflow needs.
14
14
 
15
15
  ## Features
16
16
 
17
17
  - 🎯 **Unified CLI**: One command interface for all development tasks
18
- - 📦 **Package Management**: Install, add, remove dependencies with auto-detected package manager (npm, yarn, pnpm, bun, deno)
19
- - 🏷️ **Version Management**: Semantic versioning with automated git tagging and releases
20
- - 🚀 **Publishing**: Multi-tag publishing strategy with edge version tracking
21
- - 🔧 **Tool Agnostic Linting**: Not tied to specific linters - use ESLint, Oxlint, Biome, or any tool you prefer
22
- - 🛠️ **Auto-fix Issues**: Automatically fix dependencies, structure, and documentation issues
23
- - 🪝 **Smart Git Hooks**: Automatic git repository initialization and hook management
24
- - 💻 **Modern Stack**: Built on the unjs ecosystem (citty, consola, c12, nypm, semver)
25
- - 💪 **TypeScript First**: Full TypeScript support with excellent DX
26
- - 📚 **Smart Defaults**: Best practices built-in, fully customizable
18
+ - 📦 **Package Management**: Add, remove dependencies with auto-detected package manager (npm, yarn, pnpm, bun, deno)
19
+ - 🏷️ **Version Management**: Semantic versioning with automated git tagging
20
+ - 🚀 **Publishing**: Flexible publishing with tag strategy
21
+ - 🔍 **Code Quality**: Linting, formatting, and type checking
22
+ - 🛠️ **Project Audit**: Dependency and structure validation
23
+ - 🪪 **Smart Git Hooks**: Automatic git hook management and commit message validation
24
+ - 💻 **Direct TS Execution**: Run TypeScript files directly without compilation
27
25
  - 🔧 **Single Configuration**: One config file for all functionality
28
26
 
29
27
  ## Quick Start
30
28
 
31
- ### Recommended Installation (Global with pnpm)
29
+ ### Installation
32
30
 
33
31
  ```bash
34
- # Install globally with pnpm (recommended)
32
+ # Install globally (recommended)
35
33
  pnpm add -g @funish/basis
36
-
37
- # Or install globally with npm
38
34
  npm install -g @funish/basis
39
35
 
40
- # Verify installation
41
- basis --version
42
- ```
43
-
44
- ### Alternative Installation Methods
45
-
46
- ```bash
47
- # Install in your project with pnpm
48
- pnpm add -D @funish/basis
49
-
50
- # Or with npm
51
- npm install -D @funish/basis
52
-
53
36
  # Or use directly without installation
54
37
  npx @funish/basis init
55
38
  ```
56
39
 
57
- ### Initialize in Existing Project
40
+ ### Initialize
58
41
 
59
42
  ```bash
60
- cd your-existing-project
43
+ cd your-project
61
44
  basis init
62
45
 
63
- # Interactive setup will ask you to:
64
- # 📁 Choose config format (.ts/.mjs/.cjs) - auto-detected based on your project
65
- # 🔧 Optionally setup Git hooks and configuration
66
-
67
- # Your project now has:
68
- # ✅ Configuration file with Git hooks that adapt to your package manager
69
- # ✅ Git hooks setup (if selected during init)
70
- # ✅ Tool-agnostic linting workflow
71
- # ✅ Package management through unified CLI
72
- # ✅ Version management with semantic versioning
73
- # ✅ Publishing workflow with multi-tag strategy
46
+ # This creates:
47
+ # basis.config.ts with Git hooks
48
+ # Git hooks setup (run 'basis git setup' to activate)
74
49
  ```
75
50
 
76
51
  ## CLI Commands
77
52
 
78
- ### Package Management
53
+ ### Code Quality
79
54
 
80
55
  ```bash
81
- # Install dependencies (auto-detects package manager)
82
- basis install # or basis i
83
- basis install --frozen-lockfile
56
+ # Lint code
57
+ basis lint
58
+
59
+ # Format code
60
+ basis fmt
84
61
 
62
+ # Type check
63
+ basis check
64
+
65
+ # Build project
66
+ basis build
67
+
68
+ # Audit code quality
69
+ basis audit # Run all audits
70
+ basis audit --dependencies # Audit dependencies only
71
+ basis audit --structure # Audit structure only
72
+ ```
73
+
74
+ ### Package Management
75
+
76
+ ```bash
85
77
  # Add dependencies
86
- basis add lodash # Add to dependencies
87
- basis add -D typescript # Add to devDependencies
88
- basis add --workspace app react # Add to specific workspace
89
- basis add -g @funish/basis # Install globally
78
+ basis add lodash
79
+ basis add -D typescript
90
80
 
91
81
  # Remove dependencies
92
- basis remove lodash # or basis rm / basis uninstall
93
- basis remove -D typescript
82
+ basis remove lodash
94
83
 
95
- # Run scripts
96
- basis run build # Run package.json scripts
97
- basis run test --silent
84
+ # Execute package without installation
85
+ basis dlx prettier --write .
86
+ ```
87
+
88
+ ### Run Scripts or Files
89
+
90
+ ```bash
91
+ # Run package.json scripts
92
+ basis run dev
93
+ basis run build
94
+
95
+ # Run TypeScript/JavaScript files directly
96
+ basis run src/index.ts
97
+ basis run scripts/setup.js
98
98
  ```
99
99
 
100
100
  ### Version Management
@@ -106,434 +106,138 @@ basis version minor # 1.0.0 → 1.1.0
106
106
  basis version major # 1.0.0 → 2.0.0
107
107
 
108
108
  # Prerelease versions
109
- basis version --prerelease # 1.0.0 → 1.0.1-edge.0
110
- basis version --prerelease --preid beta # 1.0.0 → 1.0.1-beta.0
109
+ basis version prerelease # 1.0.0 → 1.0.1-edge.0
110
+ basis version prerelease --preid beta # 1.0.0 → 1.0.1-beta.0
111
111
 
112
112
  # Specific version
113
113
  basis version 2.0.0
114
-
115
- # Custom commit message
116
- basis version patch --message "fix: critical bug"
117
114
  ```
118
115
 
119
116
  ### Publishing
120
117
 
121
118
  ```bash
122
- # Standard publishing (to edge tag)
123
- basis publish
124
-
125
- # Stable release (to latest + edge tags)
126
- basis publish --stable
119
+ # Publish with tag detection
120
+ basis publish # Auto-detect tag based on version
121
+ basis publish --tag beta # Custom tag
127
122
 
128
- # Custom tag publishing (to custom + edge tags)
129
- basis publish --tag beta
130
- basis publish --tag alpha
131
-
132
- # Dry run
133
- basis publish --dry-run
134
-
135
- # Skip build/tests
136
- basis publish --skip-build --skip-tests
123
+ # With git operations
124
+ basis publish --git # Also create git tag and commit
137
125
  ```
138
126
 
139
- ### Linting
127
+ ### Git Operations
140
128
 
141
129
  ```bash
142
- # Lint staged files
143
- basis lint --staged
144
-
145
- # Run project-wide linting
146
- basis lint --project
147
-
148
- # Check dependencies
149
- basis lint --deps
150
-
151
- # Check project structure
152
- basis lint --structure
153
-
154
- # Check documentation
155
- basis lint --docs
156
-
157
- # Run all lint checks
158
- basis lint --all
159
-
160
- # Auto-fix issues (can be combined with any check)
161
- basis lint --deps --fix # Check and fix dependency issues
162
- basis lint --structure --fix # Check and fix structure issues
163
- basis lint --docs --fix # Check and fix documentation issues
164
- basis lint --all --fix # Check and fix all issues
165
- basis lint --staged --fix # Note: --fix only works with --deps, --structure, --docs, --all
166
- ```
167
-
168
- #### Auto-fix Features
169
-
170
- The `--fix` flag enables automatic fixing of common issues:
171
-
172
- **🔧 Dependency Fixes**:
130
+ # Setup Git hooks
131
+ basis git setup # Install hooks from config
173
132
 
174
- - **Remove blocked packages**: Automatically uninstall packages listed in `blockedPackages`
175
- - **Update outdated dependencies**: Use package manager's update command to fix outdated packages
176
- - **Fix security vulnerabilities**: Attempt to fix security issues using `npm audit fix` or equivalent
177
-
178
- **📁 Structure Fixes**:
179
-
180
- - **Create missing files**: Generate empty files for items in `requiredFiles`
181
- - **Create missing directories**: Generate directories for items in `requiredDirs`
182
-
183
- **📝 Documentation Fixes**:
184
-
185
- - **Generate README.md**: Create an empty README.md if missing
186
- - **Generate CHANGELOG.md**: Create an empty CHANGELOG.md if missing
187
-
188
- **Configuration**: All fix behaviors are controlled by the `lint.fix` configuration in your `basis.config.ts`:
189
-
190
- ```ts
191
- export default defineBasisConfig({
192
- lint: {
193
- fix: {
194
- dependencies: {
195
- removeBlocked: true, // Enable automatic removal of blocked packages
196
- updateOutdated: false, // Disable automatic updates (manual control)
197
- fixSecurity: true, // Enable security fix attempts
198
- },
199
- structure: {
200
- createMissingFiles: true, // Enable file creation
201
- createMissingDirs: true, // Enable directory creation
202
- },
203
- docs: {
204
- generateReadme: true, // Enable README generation
205
- generateChangelog: false, // Disable CHANGELOG generation
206
- },
207
- },
208
- },
209
- });
210
- ```
211
-
212
- ### Git Hooks Management
213
-
214
- ```bash
215
- # Setup git configuration and hooks
216
- basis git setup
217
-
218
- # Setup git configuration only
219
- basis git config
220
-
221
- # Setup git hooks only
222
- basis git hooks
223
-
224
- # Remove git hooks
225
- basis git remove # Remove all basis-managed hooks
226
- basis git remove pre-commit # Remove specific hook
227
- basis git remove --update-config # Remove hooks AND config from basis.config.ts
228
-
229
- # Reset git configuration
230
- basis git reset # Reset config (keep user info)
231
- basis git reset --no-keep-user # Reset config (remove user info)
232
- basis git reset --update-config # Reset config AND remove from basis.config.ts
233
-
234
- # Initialize git repository with basis configuration
235
- basis git init
133
+ # Check staged files
134
+ basis git staged
236
135
 
237
136
  # Validate commit message
238
- basis git --lint-commit
239
- ```
137
+ basis git lint-commit
240
138
 
241
- ### Project Management
242
-
243
- ```bash
244
- # Initialize configuration
245
- basis init # Initialize basis configuration (interactive)
246
- basis init --force # Overwrite existing configuration
247
- basis init --skip-git-check # Skip git directory check
248
- basis init --skip-install # Skip dependency installation
249
-
250
- # Interactive setup will:
251
- # 1. Auto-detect recommended config format (.ts/.mjs/.cjs)
252
- # 2. Ask you to choose your preferred format
253
- # 3. Offer to setup Git hooks and configuration
254
-
255
- # Configuration
256
- basis config # Show current configuration
257
- basis config --json # Output configuration as JSON
258
- basis config --path # Show configuration file path
259
-
260
- # Help
261
- basis --help # Show help
262
- basis <command> --help # Show command-specific help
139
+ # Git passthrough
140
+ basis git status
141
+ basis git log --oneline
263
142
  ```
264
143
 
265
144
  ## Configuration
266
145
 
267
- Basis uses a single configuration file for all its features. The `basis init` command creates a configuration file with customized Git hooks in your preferred format:
146
+ Basis uses a single configuration file for all features:
268
147
 
269
148
  ```ts
270
- // basis.config.ts (TypeScript) or basis.config.mjs (ES Module)
271
- import { defineBasisConfig } from "@funish/basis";
149
+ // basis.config.ts
150
+ import { defineBasisConfig } from "@funish/basis/config";
272
151
 
273
152
  export default defineBasisConfig({
274
- // Configure your project here
275
- // See: https://github.com/funish/basis/tree/main/packages/basis#configuration
276
- git: {
277
- hooks: {
278
- "pre-commit": "pnpmbasis lint --staged", // Auto-adapts to your package manager
279
- "commit-msg": "pnpmbasis git --lint-commit",
280
- },
281
- },
282
- });
283
- ```
153
+ // Linting configuration (oxlint)
154
+ lint: {},
284
155
 
285
- ```cjs
286
- // basis.config.cjs (CommonJS)
287
- const { defineBasisConfig } = require("@funish/basis");
156
+ // Formatting configuration (oxfmt)
157
+ fmt: {},
288
158
 
289
- module.exports = defineBasisConfig({
290
- // Configure your project here
291
- // See: https://github.com/funish/basis/tree/main/packages/basis#configuration
159
+ // Git configuration
292
160
  git: {
161
+ // Git hooks
293
162
  hooks: {
294
- "pre-commit": "npx basis lint --staged", // Auto-adapts to your package manager
295
- "commit-msg": "npx basis git --lint-commit",
163
+ "pre-commit": "basis git staged",
164
+ "commit-msg": "basis git lint-commit",
296
165
  },
297
- },
298
- });
299
- ```
300
-
301
- > **💡 Configuration**: The generated config file only shows the Git hooks that are customized for your package manager. All other configuration options use smart defaults and can be added as needed.
302
-
303
- ### Full Configuration Example
304
-
305
- Here's a complete configuration with all available options:
306
-
307
- ```ts
308
- // basis.config.ts
309
- import { defineBasisConfig } from "@funish/basis";
310
166
 
311
- export default defineBasisConfig({
312
- // Linting configuration
313
- lint: {
314
- // Staged files linting patterns
167
+ // Staged files check (lint-staged style)
315
168
  staged: {
316
- "*.{ts,tsx,js,jsx}": "pnpm eslint --fix",
317
- "*.{json,md,yml,yaml}": "pnpm prettier --write",
318
- "*.vue": "pnpm vue-tsc --noEmit && pnpm eslint --fix",
319
- },
320
- // Project-wide linting commands
321
- project: {
322
- typecheck: "pnpm tsc --noEmit",
323
- "format-check": "pnpm prettier --check .",
324
- },
325
- // Auto-fix configuration
326
- fix: {
327
- // Dependency fix options
328
- dependencies: {
329
- removeBlocked: true, // Auto-remove blocked packages
330
- updateOutdated: true, // Auto-update outdated dependencies
331
- fixSecurity: true, // Auto-fix security vulnerabilities
332
- },
333
- // Structure fix options
334
- structure: {
335
- createMissingFiles: true, // Auto-create missing required files
336
- createMissingDirs: true, // Auto-create missing required directories
337
- },
338
- // Documentation fix options
339
- docs: {
340
- generateReadme: true, // Auto-create README.md if missing
341
- generateChangelog: true, // Auto-create CHANGELOG.md if missing
169
+ rules: {
170
+ "*.{ts,tsx,js,jsx}": "basis lint --fix",
171
+ "*.{json,md,yml,yaml}": "basis fmt --write",
342
172
  },
343
173
  },
344
- },
345
-
346
- // Git configuration
347
- git: {
348
- // Hook commands
349
- hooks: {
350
- "pre-commit": "pnpmbasis lint --staged",
351
- "commit-msg": "pnpmbasis git --lint-commit",
352
- },
353
174
 
354
175
  // Commit message validation
355
176
  commitMsg: {
356
- types: [
357
- "feat",
358
- "fix",
359
- "docs",
360
- "style",
361
- "refactor",
362
- "perf",
363
- "test",
364
- "build",
365
- "ci",
366
- "chore",
367
- ],
177
+ types: ["feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "chore"],
368
178
  maxLength: 72,
369
179
  minLength: 10,
370
- scopeRequired: false,
371
- allowedScopes: ["api", "ui", "core"],
372
180
  },
181
+ },
373
182
 
374
- // Options
375
- autoInitGit: true, // Auto-initialize git repo if not found
376
- skipGitCheck: false, // Skip git command availability check
377
- force: false, // Force operation even if git unavailable
183
+ // Run configuration (jiti)
184
+ run: {},
185
+
186
+ // Audit configuration
187
+ audit: {
188
+ dependencies: {
189
+ outdated: true,
190
+ security: true,
191
+ licenses: {
192
+ allowed: ["MIT", "Apache-2.0", "BSD-3-Clause"],
193
+ blocked: ["GPL"],
194
+ },
195
+ blocked: ["bad-package"],
196
+ },
197
+ structure: {
198
+ required: ["README.md", "LICENSE"],
199
+ files: [
200
+ {
201
+ pattern: "src/**/*.ts",
202
+ rule: "^[a-z][a-z0-9-]*\\.ts$",
203
+ message: "Files should use kebab-case",
204
+ },
205
+ ],
206
+ dirs: [
207
+ {
208
+ pattern: "src/*/",
209
+ rule: "^[a-z][a-z0-9-]*$",
210
+ message: "Directories should use kebab-case",
211
+ },
212
+ ],
213
+ },
378
214
  },
379
215
 
380
- // Version management configuration
216
+ // Version configuration
381
217
  version: {
382
- tagPrefix: "v", // Git tag prefix
383
- autoCommit: true, // Auto commit version changes
384
- autoTag: true, // Auto create git tag
385
- autoPush: false, // Manual push control
386
- prereleaseId: "edge", // Default prerelease identifier
387
- commitMessage: "chore: release v{version}",
218
+ preid: "edge",
388
219
  },
389
220
 
390
221
  // Publishing configuration
391
222
  publish: {
392
- defaultTag: "edge", // Always published tag
393
- stableTag: "latest", // Stable release tag
394
- access: "public", // Package access level
395
- registry: "https://registry.npmjs.org/",
396
- buildCommand: "pnpm build", // Build before publish
397
- testCommand: "pnpm test", // Test before publish
398
- checkGitClean: true, // Check git status before publish
399
- checkTests: true, // Run tests before publish
400
- autoGitPush: true, // Push after publish
401
- createGitTag: true, // Create git tag after publish
223
+ tag: "latest",
224
+ git: {
225
+ tagPrefix: "v",
226
+ message: (version) => `chore: release v${version}`,
227
+ push: true,
228
+ signTag: false,
229
+ },
402
230
  },
403
231
  });
404
232
  ```
405
233
 
406
234
  ## Publishing Strategy
407
235
 
408
- Basis implements an intelligent multi-tag publishing strategy:
409
-
410
- ### Tag Types
411
-
412
- - **`edge`**: Always points to the latest published version (any type)
413
- - **`latest`**: Points to stable releases
414
- - **Prerelease Tags**: `alpha`, `beta`, `rc` versions get their own tags
415
- - **Custom Tags**: Flexible tagging for different release channels
416
-
417
- ### Examples
236
+ Basis uses intelligent tag detection based on version:
418
237
 
419
- ```bash
420
- # Version 1.0.0 (stable)
421
- basis publish --stable
422
- # → Published to: latest + edge
423
-
424
- # Version 1.1.0-beta.1 (prerelease)
425
- basis publish
426
- # → Published to: beta + edge
427
-
428
- # Version 1.2.0 (custom workflow)
429
- basis publish --tag canary
430
- # → Published to: canary + edge
431
- ```
432
-
433
- ### Installation Examples
434
-
435
- ```bash
436
- # Install stable version
437
- pnpm add @funish/basis # Gets latest tag
438
-
439
- # Install edge version (latest published)
440
- pnpm add @funish/basis@edge
441
-
442
- # Install prerelease
443
- pnpm add @funish/basis@beta
444
-
445
- # Install specific version
446
- pnpm add @funish/basis@1.0.0
447
- ```
448
-
449
- ## Core Concepts
450
-
451
- ### 🎯 **Unified CLI**
452
-
453
- Single command interface for package management, versioning, publishing, linting, and git hooks. No more switching between different tools.
454
-
455
- ### 📦 **Auto-Detected Package Manager**
456
-
457
- Basis automatically detects your preferred package manager (npm, yarn, pnpm, bun, deno) and uses the appropriate commands, powered by [nypm](https://github.com/unjs/nypm).
458
-
459
- ### 🏷️ **Semantic Versioning**
460
-
461
- Built-in semantic versioning support using the standard [semver](https://www.npmjs.com/package/semver) package, with automated git tagging and commit generation.
462
-
463
- ### 🔧 **Tool Agnostic**
464
-
465
- Basis doesn't force specific tools. Use ESLint, Oxlint, Biome, or any other linter. Basis orchestrates your existing tools, doesn't replace them.
466
-
467
- ### 📦 **Modern Foundations**
468
-
469
- Built on the [unjs ecosystem](https://unjs.io/), leveraging proven tools like `citty`, `consola`, `c12`, `nypm`, and `semver` for maximum reliability and performance.
470
-
471
- ## Integration
472
-
473
- Basis integrates seamlessly with:
474
-
475
- - **Package Managers**: npm, yarn, pnpm, bun, deno (auto-detected)
476
- - **Linters**: ESLint, Oxlint, Biome, Prettier, StyleLint
477
- - **Git**: Works with any git workflow and hosting provider
478
- - **CI/CD**: GitHub Actions, GitLab CI, Jenkins
479
- - **Frameworks**: React, Vue, Angular, Next.js, Nuxt, SvelteKit
480
-
481
- ## Why Choose Basis?
482
-
483
- ### Instead of juggling multiple tools:
484
-
485
- ```bash
486
- npm install package # Package management
487
- yarn version patch # Version management
488
- npm publish --tag beta # Publishing
489
- npx lint-staged # Linting
490
- git config --global ... # Git configuration
491
- ```
492
-
493
- ### Use one unified command:
494
-
495
- ```bash
496
- basis add package # Unified package management
497
- basis version patch # Unified version management
498
- basis publish --tag beta # Unified publishing
499
- basis lint --staged # Unified linting
500
- basis git setup # Unified git setup
501
- ```
502
-
503
- ## API
504
-
505
- ```ts
506
- import {
507
- createBasis,
508
- defineBasisConfig,
509
- // Import module functions directly for maximum flexibility
510
- init,
511
- setupGit,
512
- lintAll,
513
- updatePackageVersion,
514
- publishPackage,
515
- } from "@funish/basis";
516
-
517
- // Programmatic usage with Basis class (for config caching and workflows)
518
- const basis = createBasis(process.cwd());
519
-
520
- // High-level workflows
521
- await basis.setup({ force: false, skipGitCheck: false, skipInstall: false }); // init + git setup
522
- await basis.release({ patch: true }, { stable: true }); // lint + version + publish
523
-
524
- // Configuration management
525
- const config = await basis.getConfig(); // Cached config loading
526
- await basis.reloadConfig(); // Force reload
527
- basis.setCwd("/different/path"); // Change working directory
528
-
529
- // Or use module functions directly for more control
530
- const cwd = process.cwd();
531
- await init(cwd, { force: true });
532
- await setupGit(cwd);
533
- await lintAll(cwd);
534
- await updatePackageVersion(cwd, { patch: true });
535
- await publishPackage(cwd, { stable: true });
536
- ```
238
+ - **Stable** (1.0.0): Published to `latest` + `edge`
239
+ - **Prerelease** (1.0.0-beta.1): Published to `beta` + `edge`
240
+ - **Custom tag**: Use `--tag` to override
537
241
 
538
242
  ## License
539
243
 
@@ -0,0 +1 @@
1
+ import{loadConfig as e}from"c12";import{defineBuildConfig as t}from"@funish/build/config";function n(e){return e}async function r(t={}){return await e({name:`basis`,cwd:process.cwd(),...t,defaults:{...t.defaults},configFile:`basis.config`})}export{t as n,r,n as t};