@funish/basis 0.2.8-edge.1 → 0.2.8-edge.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.
@@ -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};
@@ -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-3A6_NhRY.mjs";import{t as n}from"../_chunks/fmt-9Yi9STzz.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";
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(`
@@ -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-9Yi9STzz.mjs";import{runMain as t}from"citty";t(e);export{};
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{};
@@ -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-3A6_NhRY.mjs";import{runMain as t}from"citty";t(e);export{};
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{};
@@ -1 +1 @@
1
- import{defineCommand as e}from"citty";import{consola as t}from"consola";import{loadConfig as n}from"../config.mjs";import{runTool as r}from"../modules/run.mjs";export const fmtCommand=e({meta:{name:`fmt`,description:`Format code`},async run({rawArgs:e}){let{config:i}=await n(),a=i.fmt?.config||[];r({pkg:`oxfmt`,bin:`cli.js`,args:e.length>0?e:a}).status!==0&&process.exit(1),t.success(`Formatting completed`)}});
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)}});
@@ -1 +1 @@
1
- import{defineCommand as e}from"citty";import{consola as t}from"consola";import{loadConfig as n}from"../config.mjs";import{runTool as r}from"../modules/run.mjs";export const lintCommand=e({meta:{name:`lint`,description:`Lint code`},async run({rawArgs:e}){let{config:i}=await n(),a=i.lint?.config||[];r({pkg:`oxlint`,bin:`cli.js`,args:e.length>0?e:a}).status!==0&&process.exit(1),t.success(`Linting completed`)}});
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-edge.1",
3
+ "version": "0.2.8-edge.2",
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",
@@ -42,7 +42,8 @@
42
42
  "bin": {
43
43
  "basis": "dist/cli/basis.mjs",
44
44
  "oxfmt": "dist/cli/oxfmt.mjs",
45
- "oxlint": "dist/cli/oxlint.mjs"
45
+ "oxlint": "dist/cli/oxlint.mjs",
46
+ "tsgolint": "dist/cli/tsgolint.mjs"
46
47
  },
47
48
  "files": [
48
49
  "dist"
@@ -72,25 +73,18 @@
72
73
  "nypm": "0.6.5",
73
74
  "oxfmt": "0.36.0",
74
75
  "oxlint": "1.51.0",
76
+ "oxlint-tsgolint": "0.15.0",
75
77
  "pathe": "2.0.3",
76
78
  "picomatch": "4.0.3",
77
79
  "pkg-types": "2.3.0",
78
80
  "semver": "7.7.4",
79
81
  "tinyglobby": "0.2.15",
80
- "@funish/build": "0.0.4-edge.0"
82
+ "@funish/build": "0.0.4-edge.1"
81
83
  },
82
84
  "devDependencies": {
83
85
  "@types/picomatch": "4.0.2",
84
86
  "@types/semver": "7.7.1"
85
87
  },
86
- "peerDependencies": {
87
- "oxlint-tsgolint": "0.15.0"
88
- },
89
- "peerDependenciesMeta": {
90
- "oxlint-tsgolint": {
91
- "optional": true
92
- }
93
- },
94
88
  "scripts": {
95
89
  "dev": "isbuild --stub",
96
90
  "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};