@funish/basis 0.2.8-edge.1 → 0.2.8
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 +47 -16
- package/dist/_chunks/fmt-BluqTWgC.mjs +1 -0
- package/dist/_chunks/lint-D675ojvh.mjs +1 -0
- package/dist/cli/basis.mjs +1 -1
- package/dist/cli/oxfmt.mjs +1 -1
- package/dist/cli/oxlint.mjs +1 -1
- package/dist/cli/tsgolint.d.mts +1 -0
- package/dist/cli/tsgolint.mjs +2 -0
- package/dist/commands/fmt.mjs +1 -1
- package/dist/commands/lint.mjs +1 -1
- package/package.json +7 -12
- package/dist/_chunks/fmt-9Yi9STzz.mjs +0 -1
- package/dist/_chunks/lint-3A6_NhRY.mjs +0 -1
package/README.md
CHANGED
|
@@ -12,14 +12,16 @@
|
|
|
12
12
|
|
|
13
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
|
+
**Similar to**: [Vite+](https://viteplus.dev/) - Basis follows the same philosophy of unified tooling with Rust-powered components (oxlint/oxfmt) for maximum performance.
|
|
16
|
+
|
|
15
17
|
## Features
|
|
16
18
|
|
|
17
19
|
- 🎯 **Unified CLI**: One command interface for all development tasks
|
|
18
20
|
- 📦 **Package Management**: Add, remove dependencies with auto-detected package manager (npm, yarn, pnpm, bun, deno)
|
|
19
21
|
- 🏷️ **Version Management**: Semantic versioning with automated git tagging
|
|
20
22
|
- 🚀 **Publishing**: Flexible publishing with tag strategy
|
|
21
|
-
- 🔍 **Code Quality**: Linting, formatting, and
|
|
22
|
-
- 🛠️ **Project Audit**: Dependency and structure validation
|
|
23
|
+
- 🔍 **Code Quality**: Linting, formatting, and building
|
|
24
|
+
- 🛠️ **Project Audit**: Dependency and structure validation with auto-fix
|
|
23
25
|
- 🪪 **Smart Git Hooks**: Automatic git hook management and commit message validation
|
|
24
26
|
- 💻 **Direct TS Execution**: Run TypeScript files directly without compilation
|
|
25
27
|
- 🔧 **Single Configuration**: One config file for all functionality
|
|
@@ -29,12 +31,20 @@ Basis is your **unified development toolkit** for modern projects. Instead of ju
|
|
|
29
31
|
### Installation
|
|
30
32
|
|
|
31
33
|
```bash
|
|
32
|
-
# Install
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
# Install with npm
|
|
35
|
+
$ npm install -D @funish/basis
|
|
36
|
+
|
|
37
|
+
# Install with yarn
|
|
38
|
+
$ yarn add -D @funish/basis
|
|
39
|
+
|
|
40
|
+
# Install with pnpm
|
|
41
|
+
$ pnpm add -D @funish/basis
|
|
42
|
+
|
|
43
|
+
# Install globally (optional)
|
|
44
|
+
$ pnpm add -g @funish/basis
|
|
35
45
|
|
|
36
46
|
# Or use directly without installation
|
|
37
|
-
npx @funish/basis init
|
|
47
|
+
$ npx @funish/basis init
|
|
38
48
|
```
|
|
39
49
|
|
|
40
50
|
### Initialize
|
|
@@ -43,6 +53,11 @@ npx @funish/basis init
|
|
|
43
53
|
cd your-project
|
|
44
54
|
basis init
|
|
45
55
|
|
|
56
|
+
# Options
|
|
57
|
+
basis init --force # Overwrite existing configuration
|
|
58
|
+
basis init --skip-git-check # Skip git directory check
|
|
59
|
+
basis init --skip-install # Skip dependency installation
|
|
60
|
+
|
|
46
61
|
# This creates:
|
|
47
62
|
# ✅ basis.config.ts with Git hooks
|
|
48
63
|
# ✅ Git hooks setup (run 'basis git setup' to activate)
|
|
@@ -59,16 +74,16 @@ basis lint
|
|
|
59
74
|
# Format code
|
|
60
75
|
basis fmt
|
|
61
76
|
|
|
62
|
-
# Type check
|
|
63
|
-
basis check
|
|
64
|
-
|
|
65
77
|
# Build project
|
|
66
|
-
basis build
|
|
78
|
+
basis build # Build with default config
|
|
79
|
+
basis build --dir ./packages # Build specific directory
|
|
80
|
+
basis build --stub # Generate stub files
|
|
67
81
|
|
|
68
82
|
# Audit code quality
|
|
69
83
|
basis audit # Run all audits
|
|
70
84
|
basis audit --dependencies # Audit dependencies only
|
|
71
85
|
basis audit --structure # Audit structure only
|
|
86
|
+
basis audit --fix # Auto-fix issues
|
|
72
87
|
```
|
|
73
88
|
|
|
74
89
|
### Package Management
|
|
@@ -109,8 +124,16 @@ basis version major # 1.0.0 → 2.0.0
|
|
|
109
124
|
basis version prerelease # 1.0.0 → 1.0.1-edge.0
|
|
110
125
|
basis version prerelease --preid beta # 1.0.0 → 1.0.1-beta.0
|
|
111
126
|
|
|
127
|
+
# Advanced prerelease
|
|
128
|
+
basis version premajor # 2.0.0-alpha.0
|
|
129
|
+
basis version preminor # 1.1.0-alpha.0
|
|
130
|
+
basis version prepatch # 1.0.1-alpha.0
|
|
131
|
+
|
|
112
132
|
# Specific version
|
|
113
133
|
basis version 2.0.0
|
|
134
|
+
|
|
135
|
+
# Allow same version
|
|
136
|
+
basis version patch --allow-same-version
|
|
114
137
|
```
|
|
115
138
|
|
|
116
139
|
### Publishing
|
|
@@ -136,9 +159,10 @@ basis git staged
|
|
|
136
159
|
# Validate commit message
|
|
137
160
|
basis git lint-commit
|
|
138
161
|
|
|
139
|
-
# Git passthrough
|
|
162
|
+
# Git passthrough (all other git commands)
|
|
140
163
|
basis git status
|
|
141
164
|
basis git log --oneline
|
|
165
|
+
basis git branch -a
|
|
142
166
|
```
|
|
143
167
|
|
|
144
168
|
## Configuration
|
|
@@ -150,11 +174,15 @@ Basis uses a single configuration file for all features:
|
|
|
150
174
|
import { defineBasisConfig } from "@funish/basis/config";
|
|
151
175
|
|
|
152
176
|
export default defineBasisConfig({
|
|
153
|
-
// Linting configuration (oxlint)
|
|
154
|
-
lint: {
|
|
177
|
+
// Linting configuration (oxlint arguments)
|
|
178
|
+
lint: {
|
|
179
|
+
config: ["--fix", "--fix-suggestions", "--type-aware", "--type-check"],
|
|
180
|
+
},
|
|
155
181
|
|
|
156
|
-
// Formatting configuration (oxfmt)
|
|
157
|
-
fmt: {
|
|
182
|
+
// Formatting configuration (oxfmt arguments)
|
|
183
|
+
fmt: {
|
|
184
|
+
config: ["--write", "."],
|
|
185
|
+
},
|
|
158
186
|
|
|
159
187
|
// Git configuration
|
|
160
188
|
git: {
|
|
@@ -220,7 +248,10 @@ export default defineBasisConfig({
|
|
|
220
248
|
|
|
221
249
|
// Publishing configuration
|
|
222
250
|
publish: {
|
|
223
|
-
|
|
251
|
+
npm: {
|
|
252
|
+
tag: "latest",
|
|
253
|
+
additionalTag: "edge",
|
|
254
|
+
},
|
|
224
255
|
git: {
|
|
225
256
|
tagPrefix: "v",
|
|
226
257
|
message: (version) => `chore: release v${version}`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./config-lvw40IpZ.mjs";import{t}from"./run-D8ZiNeaU.mjs";import{defineCommand as n}from"citty";const r=n({meta:{name:`fmt`,description:`Format code`},async run({rawArgs:n}){let{config:r}=await e(),i=r.fmt?.config||[];t({pkg:`oxfmt`,bin:`cli.js`,args:n.length>0?n:i}).status!==0&&process.exit(1)}});export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./config-lvw40IpZ.mjs";import{t}from"./run-D8ZiNeaU.mjs";import{defineCommand as n}from"citty";const r=n({meta:{name:`lint`,description:`Lint code`},async run({rawArgs:n}){let{config:r}=await e(),i=r.lint?.config||[];t({pkg:`oxlint`,bin:`cli.js`,args:n.length>0?n:i}).status!==0&&process.exit(1)}});export{r as t};
|
package/dist/cli/basis.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{r as e}from"../_chunks/config-lvw40IpZ.mjs";import"../_chunks/run-D8ZiNeaU.mjs";import{t}from"../_chunks/lint-
|
|
2
|
+
import{r as e}from"../_chunks/config-lvw40IpZ.mjs";import"../_chunks/run-D8ZiNeaU.mjs";import{t}from"../_chunks/lint-D675ojvh.mjs";import{t as n}from"../_chunks/fmt-BluqTWgC.mjs";import{loadConfig as r}from"c12";import{readPackageJSON as i,resolvePackageJSON as a,writePackageJSON as o}from"pkg-types";import{resolve as s}from"pathe";import{defineCommand as c,runMain as l}from"citty";import{consola as u}from"consola";import{readFile as d,stat as f,writeFile as p}from"node:fs/promises";import{exec as m,setupEnvironment as h}from"dugite";import{addDependency as g,addDevDependency as _,detectPackageManager as v,dlx as y,removeDependency as b,runScript as x}from"nypm";import{execSync as S,spawnSync as C}from"node:child_process";import{build as w}from"@funish/build";import T from"picomatch";import{createJiti as ee}from"jiti";import{existsSync as E}from"node:fs";import D from"semver";import{glob as O}from"tinyglobby";async function k(e=process.cwd(),t={}){let{force:n=!1,skipGitCheck:i=!1}=t;u.start(`Initializing basis configuration`);let a=(await r({cwd:e,name:`basis`}))._configFile;if(a&&!n)return u.error(`Configuration file already exists: ${a}`),u.info(`Use --force to overwrite.`),!1;let o=(await v(e))?.name||`npm`,s=o===`npm`?`npx`:o,c={git:{hooks:{"pre-commit":`${s} basis git staged`,"commit-msg":`${s} basis git lint-commit`},staged:{rules:{"**/*.{ts,tsx,js,jsx}":`basis lint`,"**/*.{json,md,yml,yaml}":`basis fmt`}}}},l=`import { defineBasisConfig } from "@funish/basis/config";
|
|
3
3
|
|
|
4
4
|
export default defineBasisConfig(${JSON.stringify(c,null,2)});
|
|
5
5
|
`,d=`${e}/basis.config.ts`;if(await p(d,l,`utf8`),u.success(`Configuration created in ${d}`),!i)try{await m([`--version`],e),u.info(`Git detected`)}catch{u.info(`Git not found`)}return u.success(`Basis initialization completed!`),u.info(`Run 'basis git setup' to setup Git hooks`),!0}const A=c({meta:{name:`init`,description:`Initialize configuration`},args:{force:{type:`boolean`,description:`Overwrite existing configuration`},"skip-git-check":{type:`boolean`,description:`Skip git directory check`},"skip-install":{type:`boolean`,description:`Skip dependency installation`}},async run({args:e}){try{await k(process.cwd(),{force:e.force,skipGitCheck:e[`skip-git-check`],skipInstall:e[`skip-install`]})}catch(e){u.error(`Init failed:`,e),process.exit(1)}}}),j=c({meta:{name:`build`,description:`Build project`},args:{dir:{type:`string`,description:`Project directory`,default:`.`},stub:{type:`boolean`,description:`Generate stub files`,default:!1}},async run({args:e}){let t=s(e.dir||`.`);try{let{config:n={}}=await r({name:`isbuild`,configFile:`build.config`,cwd:t}),i=(n.entries||[]).map(t=>{if(typeof t==`string`){let[n,r]=t.split(`:`);return n.endsWith(`/`)?{type:`transform`,input:n,outDir:r,stub:e.stub}:{type:`bundle`,input:n.split(`,`),outDir:r,stub:e.stub}}return{...t,stub:e.stub}});(!i||i.length===0)&&(u.error(`No build entries specified in build.config.`),process.exit(1)),await w({cwd:t,...n,entries:i}),u.success(`Build completed`)}catch(e){u.error(`Build failed:`,e),process.exit(1)}}});async function M(){try{let e=S(`git --exec-path`,{encoding:`utf8`}).trim();if(e){let t=h({LOCAL_GIT_DIRECTORY:s(e,`..`,`..`,`..`)});Object.assign(process.env,t.env),u.debug(`Using system Git from: ${t.gitLocation}`)}}catch{u.debug(`System Git not found, dugite will use embedded Git`)}}M();async function N(e){try{let t=(await m([`diff`,`--cached`,`--name-only`],e)).stdout.trim().split(`
|
package/dist/cli/oxfmt.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"../_chunks/config-lvw40IpZ.mjs";import"../_chunks/run-D8ZiNeaU.mjs";import{t as e}from"../_chunks/fmt-
|
|
2
|
+
import"../_chunks/config-lvw40IpZ.mjs";import"../_chunks/run-D8ZiNeaU.mjs";import{t as e}from"../_chunks/fmt-BluqTWgC.mjs";import{runCommand as t}from"citty";t(e,{rawArgs:process.argv.slice(2),showUsage:!1});export{};
|
package/dist/cli/oxlint.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"../_chunks/config-lvw40IpZ.mjs";import"../_chunks/run-D8ZiNeaU.mjs";import{t as e}from"../_chunks/lint-
|
|
2
|
+
import"../_chunks/config-lvw40IpZ.mjs";import"../_chunks/run-D8ZiNeaU.mjs";import{t as e}from"../_chunks/lint-D675ojvh.mjs";import{runCommand as t}from"citty";t(e,{rawArgs:process.argv.slice(2),showUsage:!1});export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"../_chunks/run-D8ZiNeaU.mjs";import{defineCommand as t,runCommand as n}from"citty";n(t({meta:{name:`tsgolint`,description:`Lint TypeScript with tsgolint rules`},async run({rawArgs:t}){let n=e({pkg:`oxlint-tsgolint/bin/tsgolint.js`,bin:`tsgolint.js`,args:t});n.status!==0&&process.exit(n.status)}}),{rawArgs:process.argv.slice(2),showUsage:!1});export{};
|
package/dist/commands/fmt.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineCommand as e}from"citty";import{
|
|
1
|
+
import{defineCommand as e}from"citty";import{loadConfig as t}from"../config.mjs";import{runTool as n}from"../modules/run.mjs";export const fmtCommand=e({meta:{name:`fmt`,description:`Format code`},async run({rawArgs:e}){let{config:r}=await t(),i=r.fmt?.config||[];n({pkg:`oxfmt`,bin:`cli.js`,args:e.length>0?e:i}).status!==0&&process.exit(1)}});
|
package/dist/commands/lint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineCommand as e}from"citty";import{
|
|
1
|
+
import{defineCommand as e}from"citty";import{loadConfig as t}from"../config.mjs";import{runTool as n}from"../modules/run.mjs";export const lintCommand=e({meta:{name:`lint`,description:`Lint code`},async run({rawArgs:e}){let{config:r}=await t(),i=r.lint?.config||[];n({pkg:`oxlint`,bin:`cli.js`,args:e.length>0?e:i}).status!==0&&process.exit(1)}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funish/basis",
|
|
3
|
-
"version": "0.2.8
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "A modern development toolkit with unified CLI for package management, versioning, publishing, code quality, and Git workflow automation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"basis",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"semver",
|
|
23
23
|
"typescript",
|
|
24
24
|
"unjs",
|
|
25
|
-
"version-management"
|
|
25
|
+
"version-management",
|
|
26
|
+
"vite-plus"
|
|
26
27
|
],
|
|
27
28
|
"homepage": "https://github.com/funish/basis#readme",
|
|
28
29
|
"bugs": {
|
|
@@ -42,7 +43,8 @@
|
|
|
42
43
|
"bin": {
|
|
43
44
|
"basis": "dist/cli/basis.mjs",
|
|
44
45
|
"oxfmt": "dist/cli/oxfmt.mjs",
|
|
45
|
-
"oxlint": "dist/cli/oxlint.mjs"
|
|
46
|
+
"oxlint": "dist/cli/oxlint.mjs",
|
|
47
|
+
"tsgolint": "dist/cli/tsgolint.mjs"
|
|
46
48
|
},
|
|
47
49
|
"files": [
|
|
48
50
|
"dist"
|
|
@@ -72,25 +74,18 @@
|
|
|
72
74
|
"nypm": "0.6.5",
|
|
73
75
|
"oxfmt": "0.36.0",
|
|
74
76
|
"oxlint": "1.51.0",
|
|
77
|
+
"oxlint-tsgolint": "0.15.0",
|
|
75
78
|
"pathe": "2.0.3",
|
|
76
79
|
"picomatch": "4.0.3",
|
|
77
80
|
"pkg-types": "2.3.0",
|
|
78
81
|
"semver": "7.7.4",
|
|
79
82
|
"tinyglobby": "0.2.15",
|
|
80
|
-
"@funish/build": "0.0.4
|
|
83
|
+
"@funish/build": "0.0.4"
|
|
81
84
|
},
|
|
82
85
|
"devDependencies": {
|
|
83
86
|
"@types/picomatch": "4.0.2",
|
|
84
87
|
"@types/semver": "7.7.1"
|
|
85
88
|
},
|
|
86
|
-
"peerDependencies": {
|
|
87
|
-
"oxlint-tsgolint": "0.15.0"
|
|
88
|
-
},
|
|
89
|
-
"peerDependenciesMeta": {
|
|
90
|
-
"oxlint-tsgolint": {
|
|
91
|
-
"optional": true
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
89
|
"scripts": {
|
|
95
90
|
"dev": "isbuild --stub",
|
|
96
91
|
"build": "isbuild"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./config-lvw40IpZ.mjs";import{t}from"./run-D8ZiNeaU.mjs";import{defineCommand as n}from"citty";import{consola as r}from"consola";const i=n({meta:{name:`fmt`,description:`Format code`},async run({rawArgs:n}){let{config:i}=await e(),a=i.fmt?.config||[];t({pkg:`oxfmt`,bin:`cli.js`,args:n.length>0?n:a}).status!==0&&process.exit(1),r.success(`Formatting completed`)}});export{i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./config-lvw40IpZ.mjs";import{t}from"./run-D8ZiNeaU.mjs";import{defineCommand as n}from"citty";import{consola as r}from"consola";const i=n({meta:{name:`lint`,description:`Lint code`},async run({rawArgs:n}){let{config:i}=await e(),a=i.lint?.config||[];t({pkg:`oxlint`,bin:`cli.js`,args:n.length>0?n:a}).status!==0&&process.exit(1),r.success(`Linting completed`)}});export{i as t};
|