@funish/basis 0.2.0 → 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.
- package/LICENSE +21 -0
- package/dist/_chunks/config.mjs +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/commands/build.mjs +1 -1
- package/dist/commands/publish.mjs +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +1 -1
- package/package.json +10 -8
- package/dist/THIRD-PARTY-LICENSES.md +0 -276
- package/dist/_chunks/libs/common.d.mts +0 -6970
- package/dist/_chunks/libs/common.mjs +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Funish
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/_chunks/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{loadConfig as e}from"c12";function
|
|
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};
|
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
2
|
+
import{r as e}from"./_chunks/config.mjs";import{defineCommand as t,runMain as n}from"citty";import{consola as r}from"consola";import{readPackageJSON as i,resolvePackageJSON as a,writePackageJSON as o}from"pkg-types";import{readFile as s,stat as c,writeFile as l}from"node:fs/promises";import{exec as u}from"dugite";import{loadConfig as d}from"c12";import{addDependency as f,addDevDependency as p,detectPackageManager as m,dlx as h,removeDependency as g,runScript as _}from"nypm";import{dirname as v,resolve as y}from"pathe";import{build as b}from"@funish/build";import{execSync as x}from"node:child_process";import S from"picomatch";import{createJiti as C}from"jiti";import w from"semver";import{existsSync as ee}from"node:fs";import{glob as T}from"tinyglobby";async function E(e=process.cwd(),t={}){let{force:n=!1,skipGitCheck:i=!1}=t;r.start(`Initializing basis configuration`);let a=(await d({cwd:e,name:`basis`}))._configFile;if(a&&!n)return r.error(`Configuration file already exists: ${a}`),r.info(`Use --force to overwrite.`),!1;let o=(await m(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 --fix`,"*.{json,md,yml,yaml}":`basis fmt --write`}}}},f=`import { defineBasisConfig } from "@funish/basis/config";
|
|
3
3
|
|
|
4
4
|
export default defineBasisConfig(${JSON.stringify(c,null,2)});
|
|
5
|
-
`,p=`${e}/basis.config.ts`;if(await l(p,f,`utf8`),r.success(`Configuration created in ${p}`),!i)try{await u([`--version`],e),r.info(`Git detected`)}catch{r.info(`Git not found`)}return r.success(`Basis initialization completed!`),r.info(`Run 'basis git setup' to setup Git hooks`),!0}const
|
|
5
|
+
`,p=`${e}/basis.config.ts`;if(await l(p,f,`utf8`),r.success(`Configuration created in ${p}`),!i)try{await u([`--version`],e),r.info(`Git detected`)}catch{r.info(`Git not found`)}return r.success(`Basis initialization completed!`),r.info(`Run 'basis git setup' to setup Git hooks`),!0}const D=t({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 E(process.cwd(),{force:e.force,skipGitCheck:e[`skip-git-check`],skipInstall:e[`skip-install`]})}catch(e){r.error(`Init failed:`,e),process.exit(1)}}}),O=t({meta:{name:`lint`,description:`Lint code`},async run({rawArgs:t}){let n=process.cwd(),{config:i}=await e({cwd:n}),a=[...i.lint?.config||[],...t];try{await h(`oxlint`,{args:a,cwd:n}),r.success(`Linting completed`)}catch(e){r.error(`Linting failed:`,e),process.exit(1)}}}),k=t({meta:{name:`fmt`,description:`Format code`},async run({rawArgs:t}){let n=process.cwd(),{config:i}=await e({cwd:n}),a=[...i.fmt?.config||[],...t];try{await h(`oxfmt`,{args:a,cwd:n}),r.success(`Formatting completed`)}catch(e){r.error(`Formatting failed:`,e),process.exit(1)}}}),A=t({meta:{name:`check`,description:`Type check code`},async run({rawArgs:e}){try{await h(`vue-tsc`,{args:[`--noEmit`,...e],cwd:process.cwd()}),r.success(`Type checking completed`)}catch(e){r.error(`Type checking failed:`,e),process.exit(1)}}}),j=t({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=y(e.dir||`.`);try{let{config:n={}}=await d({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)&&(r.error(`No build entries specified in build.config.`),process.exit(1)),await b({cwd:t,...n,entries:i}),r.success(`Build completed`)}catch(e){r.error(`Build failed:`,e),process.exit(1)}}});async function M(e){try{let t=(await u([`diff`,`--cached`,`--name-only`],e)).stdout.trim().split(`
|
|
6
6
|
`).filter(Boolean),n=await u([`diff`,`--cached`,`--name-only`,`--diff-filter=D`],e),r=new Set(n.stdout.trim().split(`
|
|
7
|
-
`).filter(Boolean));return t.filter(e=>!r.has(e))}catch{return[]}}async function
|
|
8
|
-
`)[0],n=t.match(/^(\w+)(\(([^)]+)\))?(!)?:\s*(.+)$/);if(!n)return null;let[,r,,i,,a]=n;return{type:r,scope:i,subject:a,isBreaking:t.includes(`!`)||e.includes(`BREAKING CHANGE:`)}}async function
|
|
9
|
-
`)[0];return h.length>o&&p.push(`Header too long (${h.length} chars). Max: ${o}`),h.length<c&&p.push(`Header too short (${h.length} chars). Min: ${c}`),l&&!m.scope&&p.push(`Scope is required`),m.scope&&d.length>0&&!d.includes(m.scope)&&p.push(`Invalid scope '${m.scope}'. Allowed: ${d.join(`, `)}`),p.length>0?(r.error(`Invalid commit message:`),p.forEach(e=>r.error(` ${e}`)),!1):(r.success(`Commit message validation passed`),!0)}async function F(t=process.cwd()){let{config:n}=await e({cwd:t}),i=n.git?.hooks;if(!i||Object.keys(i).length===0)return r.warn(`No Git hooks configured`),!0;let a=x(t,`.git/hooks`);try{for(let[e,t]of Object.entries(i))await l(x(a,e),`#!/bin/sh\n${t}\n`,{mode:493}),r.success(`Created ${e} hook`);return!0}catch(e){return r.error(`Failed to setup Git hooks:`,e),!1}}async function I(e=process.cwd()){return r.start(`Setting up Git configuration`),await F(e)?(r.success(`Git setup completed`),!0):!1}const L=t({meta:{name:`git`,description:`Git operations`},subCommands:{staged:t({meta:{name:`staged`,description:`Check staged files`},async run(){await j()||process.exit(1)}}),"lint-commit":t({meta:{name:`lint-commit`,description:`Validate commit message`},async run(){await P()||process.exit(1)}}),setup:t({meta:{name:`setup`,description:`Setup Git hooks and configuration`},async run(){await I()||process.exit(1)}})},async run({rawArgs:e}){if(e.length===0){r.info(`Available subcommands: staged, lint-commit, setup`),r.info(`Git passthrough mode: basis git <git-command>`);return}let t=[`staged`,`lint-commit`,`setup`],n=e[0];if(!t.includes(n))try{let t=await u(e,process.cwd(),{processCallback:e=>{e.stdout?.on(`data`,e=>{process.stdout.write(e)}),e.stderr?.on(`data`,e=>{process.stderr.write(e)})}});if(t.exitCode!==0)throw Error(`git exited with code ${t.exitCode}`)}catch(e){r.error(`Git operation failed:`,e),process.exit(1)}}}),R=t({meta:{name:`run`,description:`Run scripts or files`},async run({rawArgs:t}){t.length===0&&(r.error(`Please specify a script name or file path`),process.exit(1));let[n,...i]=t,a=process.cwd(),{config:o}=await e({cwd:a}),s=o.run?.config;try{await _(n,{cwd:a,args:i});return}catch(e){try{await S(a,s).import(n);return}catch(t){r.error(`Run failed:`),r.error(` runScript error: ${String(e)}`),r.error(` jiti error: ${String(t)}`),r.info(`\nTried to run "${n}" as both a package.json script and a file, but both failed.`),process.exit(1)}}}});function z(e,t,n){if(t.version){if(C.valid(t.version))return t.version;throw Error(`Invalid version format: ${t.version}. Please use semantic versioning format (e.g., 1.0.0, 2.1.0-alpha.1)`)}if(!C.valid(e))throw Error(`Invalid current version format: ${e}. Please fix version in package.json to use semantic versioning format (e.g., 1.0.0)`);let r=C.prerelease(e),i=t.preid||(r&&typeof r[0]==`string`?r[0]:null)||n.preid||`edge`,a=`patch`;t.major?a=`major`:t.minor?a=`minor`:t.premajor?a=`premajor`:t.preminor?a=`preminor`:t.prepatch?a=`prepatch`:t.prerelease?a=r?`prerelease`:`prepatch`:t.fromGit&&(a=`patch`);let o=a===`prerelease`||a.startsWith(`pre`)?C.inc(e,a,i):C.inc(e,a);if(!o)throw Error(`Failed to calculate new version from ${e}. Please check your version increment options.`);return o}const B=t({meta:{name:`version`,description:`Update package version`},args:{version:{type:`positional`,description:`Version to set (patch, minor, major, prerelease, or specific version)`,required:!1},preid:{type:`string`,description:`Prerelease identifier (alpha, beta, rc)`},major:{type:`boolean`,description:`Bump major version`},minor:{type:`boolean`,description:`Bump minor version`},patch:{type:`boolean`,description:`Bump patch version`},premajor:{type:`boolean`,description:`Bump premajor version`},preminor:{type:`boolean`,description:`Bump preminor version`},prepatch:{type:`boolean`,description:`Bump prepatch version`},prerelease:{type:`boolean`,description:`Bump prerelease version`},"allow-same-version":{type:`boolean`,description:`Allow same version`}},async run({args:t}){try{let{config:n}=await e(),s={preid:t.preid,major:t.major,minor:t.minor,patch:t.patch||!t.major&&!t.minor&&!t.version,premajor:t.premajor,preminor:t.preminor,prepatch:t.prepatch,prerelease:t.prerelease,allowSameVersion:t[`allow-same-version`]};if(t.version){let e=t.version;[`patch`,`minor`,`major`,`prerelease`,`premajor`,`preminor`,`prepatch`].includes(e)?s[e]=!0:s.version=e}let c=process.cwd(),l=await i(c),u=l.version;if(!u)throw Error(`No version found in package.json`);let d=z(u,s,n.version||{});if(!s.allowSameVersion&&d===u)throw Error(`Version unchanged: ${u}. Use --allow-same-version to allow this.`);await o(await a(c),{...l,version:d}),r.success(`Version updated: ${u} → ${d}`)}catch(e){r.error(`Version update failed:`,e),process.exit(1)}}});async function V(e,t){let n=process.cwd(),r=await i(n),a=r.version,o=r.name;if(!o)throw Error(`Package name is required in package.json`);if(!a)throw Error(`Package version is required in package.json`);let s=(await m(n))?.name||`npm`,c=t.npm||{tag:`latest`,access:`public`},l=e.tag;if(!l&&a&&a.includes(`-`)){let e=a.match(/-(\w+)\.\d+$/);e&&(l=e[1])}l=l||c.tag||`latest`;let u=(t=>{let n=[];e.tarball&&n.push(e.tarball),n.push(`--tag`,t);let r=e.access||c.access;return r&&n.push(`--access`,r),e.dryRun&&n.push(`--dry-run`),e.otp&&n.push(`--otp`,e.otp),n})(l);await new Promise((e,t)=>{y(s,[`publish`,...u],{stdio:`inherit`,shell:!0}).on(`close`,n=>{n===0?e():t(Error(`${s} publish exited with code ${n}`))})});let d=c.additionalTag;!e.dryRun&&d&&d!==l&&v(`npm dist-tag add ${o}@${a} ${d}`,{cwd:n,stdio:`inherit`})}async function H(e,t){let n=process.cwd(),r=t?.tagPrefix;if(!r)throw Error(`Git tagPrefix is required`);let i=`${r}${e}`,a=t?.message?t.message(e):`chore: release ${i}`;await u([`add`,`package.json`],n),await u([`commit`,`-m`,a],n),await u([`tag`,i,...t?.signTag?[`--sign`]:[]],n),t?.push&&(await u([`push`],n),await u([`push`,`--tags`],n))}const U=t({meta:{name:`publish`,description:`Publish to registry`},args:{tag:{type:`string`,description:`Publish tag`},git:{type:`boolean`,description:`Also create git tag and commit`},access:{type:`string`,description:`Package access level (public, restricted)`},"dry-run":{type:`boolean`,description:`Dry run mode`},otp:{type:`string`,description:`One-time password for 2FA`}},async run({args:t}){try{let{config:n}=await e();if(await V({tag:t.tag,git:t.git,access:t.access||void 0,dryRun:t[`dry-run`],otp:t.otp},n.publish||{}),r.success(`Package published successfully`),t.git&&n.publish?.git){r.info(`Creating git tag and commit...`);let e=(await i(process.cwd())).version;e&&(await H(e,n.publish.git),r.success(`Git operations completed`))}}catch(e){r.error(`Publish failed:`,e),process.exit(1)}}}),W={npm:{outdated:[`outdated`],audit:[`audit`]},yarn:{outdated:[`outdated`,`-c`],audit:[`audit`]},pnpm:{outdated:[`outdated`],audit:[`audit`]},bun:{outdated:[`outdated`],audit:[`audit`]},deno:{outdated:null,audit:null}};async function G(t=process.cwd(),n,o=!1){let{config:s}=await e({cwd:t,overrides:n?{audit:{dependencies:n}}:void 0}),c=s.audit?.dependencies||{};r.start(`Auditing dependencies...`);let l=!1;if(c.blocked&&c.blocked.length>0)try{let e=await i(t),n={...e.dependencies,...e.devDependencies},a=Object.keys(n).filter(e=>c.blocked?.includes(e));a.length>0&&(r.error(`Found ${a.length} blocked package(s): ${a.join(`, `)}`),l=!0)}catch(e){r.error(`Failed to check blocked packages:`,e),l=!0}if(c.outdated)try{let e=(await m(t))?.name||`npm`,n=W[e];if(!n.outdated)r.info(`Skipping outdated check for ${e}`);else try{v(`${e} ${n.outdated.join(` `)}`,{cwd:t,stdio:`inherit`})}catch{r.warn(`Some dependencies are outdated`)}}catch(e){r.error(`Failed to check outdated dependencies:`,e),l=!0}if(c.security)try{let e=(await m(t))?.name||`npm`,n=W[e];if(!n.audit)r.info(`Skipping security audit for ${e}`);else try{v(`${e} ${n.audit.join(` `)}`,{cwd:t,stdio:`inherit`})}catch{l=!0}}catch(e){r.error(`Failed to check security vulnerabilities:`,e),l=!0}if(c.licenses&&(c.licenses.allowed||c.licenses.blocked))try{let e=await a(t),n=await K(t),o=[];for(let t of n)try{let n=await i(t);if(!n.name||t===e)continue;if(n.license){let e=Array.isArray(n.license)?n.license.join(`, `):n.license;if(c.licenses.blocked&&c.licenses.blocked.some(t=>e.includes(t))){o.push(`${n.name}: ${e}`);continue}c.licenses.allowed&&c.licenses.allowed.length>0&&(c.licenses.allowed.some(t=>e.includes(t))||o.push(`${n.name}: ${e}`))}}catch{}o.length>0&&(r.error(`Packages with invalid licenses:`),o.forEach(e=>r.error(` ${e}`)),l=!0)}catch(e){r.error(`Failed to check licenses:`,e),l=!0}return l||r.success(`Dependencies audit passed`),!l}async function K(e){try{return await w([`node_modules/*/package.json`,`node_modules/@*/*/package.json`,`node_modules/@*/*/*/package.json`],{cwd:e,onlyFiles:!0,absolute:!0})}catch{return[]}}async function q(t=process.cwd(),n){let{config:i}=await e({cwd:t,overrides:n?{audit:{structure:n}}:void 0}),a=i.audit?.structure||{};r.start(`Auditing project structure...`);let o=!1;if(a.required&&a.required.length>0){let e=[];for(let n of a.required)try{await c(x(t,n))}catch{n.includes(`*`)||n.includes(`?`)?(await w(n,{cwd:t})).length===0&&e.push(n):e.push(n)}e.length>0&&(r.error(`Missing required file(s)/director(ies): ${e.join(`, `)}`),o=!0)}if(a.files&&a.files.length>0)for(let e of a.files)try{let n=await w(e.pattern,{cwd:t}),i=new RegExp(e.rule),a=n.filter(e=>!i.test(e));a.length>0&&(r.error(`${e.message}: ${a.slice(0,5).join(`, `)}${a.length>5?`...`:``}`),o=!0)}catch(t){r.error(`Failed to check file naming rule: ${e.pattern}`,t),o=!0}if(a.dirs&&a.dirs.length>0)for(let e of a.dirs)try{let n=await w(e.pattern,{cwd:t}),i=new RegExp(e.rule),a=n.filter(e=>!i.test(e));a.length>0&&(r.error(`${e.message}: ${a.slice(0,5).join(`, `)}${a.length>5?`...`:``}`),o=!0)}catch(t){r.error(`Failed to check directory naming rule: ${e.pattern}`,t),o=!0}return o||r.success(`Structure audit passed`),!o}async function J(t=process.cwd(),n=!1){let{config:i}=await e({cwd:t}),a=i.audit||{};r.start(`Running comprehensive project audit...`);let o=(await Promise.allSettled([G(t,a.dependencies,n),q(t,a.structure)])).filter(e=>e.status===`rejected`||e.status===`fulfilled`&&!e.value);return o.length===0?(r.success(`All audits passed`),!0):(r.error(`${o.length} audit(s) failed`),!1)}const Y=t({meta:{name:`audit`,description:`Audit code quality`},args:{dependencies:{type:`boolean`,description:`Dependencies audit`},structure:{type:`boolean`,description:`Project structure audit`},fix:{type:`boolean`,description:`Auto-fix issues`}},async run({args:e}){let t=process.cwd(),n=!0;if(!e.dependencies&&!e.structure)n=await J(t,e.fix);else{let r=[];e.dependencies&&r.push(()=>G(t,void 0,e.fix)),e.structure&&r.push(()=>q(t));for(let e of r)await e()||(n=!1)}n||(r.error(`Some audits failed`),process.exit(1))}}),X=t({meta:{name:`add`,description:`Add dependencies`},args:{dev:{type:`boolean`,description:`Add as dev dependency`,alias:`D`}},async run({args:e,rawArgs:t}){t.length===0&&(r.error(`Please specify at least one package name`),r.info(`Example: basis add lodash`),process.exit(1));let n=t.filter(e=>!e.startsWith(`-`));n.length===0&&(r.error(`Please specify at least one package name`),process.exit(1));try{e.dev?(await p(n,{cwd:process.cwd()}),r.success(`Added ${n.join(`, `)} as dev dependencies`)):(await f(n,{cwd:process.cwd()}),r.success(`Added ${n.join(`, `)} as dependencies`))}catch(e){r.error(`Add packages failed:`,e),process.exit(1)}}}),Z=t({meta:{name:`remove`,description:`Remove dependencies`},async run({rawArgs:e}){e.length===0&&(r.error(`Please specify at least one package name`),r.info(`Example: basis remove lodash`),process.exit(1));let t=e.filter(e=>!e.startsWith(`-`));t.length===0&&(r.error(`Please specify at least one package name`),process.exit(1));try{await g(t,{cwd:process.cwd()}),r.success(`Removed ${t.join(`, `)}`)}catch(e){r.error(`Remove packages failed:`,e),process.exit(1)}}}),Q=t({meta:{name:`dlx`,description:`Execute package without installation`},async run({rawArgs:e}){try{e.length===0&&(r.error(`Please specify a package to run`),process.exit(1));let[t,...n]=e;await h(t,{args:n,cwd:process.cwd()}),r.success(`Dlx completed`)}catch(e){r.error(`Dlx failed:`,e),process.exit(1)}}}),$=await i(import.meta.url);n(t({meta:{name:`basis`,description:$.description,version:$.version},subCommands:{init:ee,lint:E,fmt:D,check:O,build:k,git:L,run:R,version:B,publish:U,audit:Y,add:X,remove:Z,dlx:Q}})).catch(e=>{r.error(e),process.exit(1)});export{};
|
|
7
|
+
`).filter(Boolean));return t.filter(e=>!r.has(e))}catch{return[]}}async function N(t=process.cwd()){let{config:n}=await e({cwd:t}),i=n.git?.staged?.rules||{};if(Object.keys(i).length===0)return r.warn(`No staged rules configured. Add git.staged.rules to your basis.config.ts`),!0;let a=await M(t);if(a.length===0)return r.info(`No staged files to check`),!0;r.start(`Checking ${a.length} staged file(s)`);let o=!1,s=new Set;for(let[e,n]of Object.entries(i)){let i=a.filter(t=>!s.has(t)&&S(t,e));if(i.length!==0){r.info(`Running ${n} for ${i.length} file(s) matching ${e}`);try{let[e,...r]=n.split(` `);x(`${e} ${r.join(` `)}`,{cwd:t,stdio:`inherit`});let a=[];for(let e of i)try{await c(y(t,e)),a.push(e)}catch{}a.length>0&&await u([`add`,...a],t),i.forEach(e=>s.add(e))}catch(t){o=!0,r.error(`Staged check failed for pattern '${e}':`,t)}}}return o?(r.error(`Some staged files checks failed`),!1):(r.success(`Staged files check passed`),!0)}const P=[`feat`,`fix`,`docs`,`style`,`refactor`,`perf`,`test`,`build`,`ci`,`chore`,`revert`];function F(e){let t=e.trim().split(`
|
|
8
|
+
`)[0],n=t.match(/^(\w+)(\(([^)]+)\))?(!)?:\s*(.+)$/);if(!n)return null;let[,r,,i,,a]=n;return{type:r,scope:i,subject:a,isBreaking:t.includes(`!`)||e.includes(`BREAKING CHANGE:`)}}async function I(t=process.cwd()){let{config:n}=await e({cwd:t}),i=n.git?.commitMsg,a=i?.types||P,o=i?.maxLength||72,c=i?.minLength||10,l=i?.scopeRequired||!1,d=i?.allowedScopes||[],f;try{let e=y(t,`.git/COMMIT_EDITMSG`);try{f=(await s(e)).toString(`utf8`)}catch{f=(await u([`log`,`-1`,`--pretty=%B`],t)).stdout.trim()}}catch(e){return r.error(`Failed to read commit message:`,e),!1}let p=[],m=F(f);if(!m)return r.error(`Invalid commit format. Expected: type(scope): subject`),!1;a.includes(m.type)||p.push(`Invalid type '${m.type}'. Allowed: ${a.join(`, `)}`);let h=f.split(`
|
|
9
|
+
`)[0];return h.length>o&&p.push(`Header too long (${h.length} chars). Max: ${o}`),h.length<c&&p.push(`Header too short (${h.length} chars). Min: ${c}`),l&&!m.scope&&p.push(`Scope is required`),m.scope&&d.length>0&&!d.includes(m.scope)&&p.push(`Invalid scope '${m.scope}'. Allowed: ${d.join(`, `)}`),p.length>0?(r.error(`Invalid commit message:`),p.forEach(e=>r.error(` ${e}`)),!1):(r.success(`Commit message validation passed`),!0)}async function L(t=process.cwd()){let{config:n}=await e({cwd:t}),i=n.git?.hooks;if(!i||Object.keys(i).length===0)return r.warn(`No Git hooks configured`),!0;let a=y(t,`.git/hooks`);try{for(let[e,t]of Object.entries(i))await l(y(a,e),`#!/bin/sh\n${t}\n`,{mode:493}),r.success(`Created ${e} hook`);return!0}catch(e){return r.error(`Failed to setup Git hooks:`,e),!1}}async function R(e=process.cwd()){return r.start(`Setting up Git configuration`),await L(e)?(r.success(`Git setup completed`),!0):!1}const z=t({meta:{name:`git`,description:`Git operations`},subCommands:{staged:t({meta:{name:`staged`,description:`Check staged files`},async run(){await N()||process.exit(1)}}),"lint-commit":t({meta:{name:`lint-commit`,description:`Validate commit message`},async run(){await I()||process.exit(1)}}),setup:t({meta:{name:`setup`,description:`Setup Git hooks and configuration`},async run(){await R()||process.exit(1)}})},async run({rawArgs:e}){if(e.length===0){r.info(`Available subcommands: staged, lint-commit, setup`),r.info(`Git passthrough mode: basis git <git-command>`);return}let t=[`staged`,`lint-commit`,`setup`],n=e[0];if(!t.includes(n))try{let t=await u(e,process.cwd(),{processCallback:e=>{e.stdout?.on(`data`,e=>{process.stdout.write(e)}),e.stderr?.on(`data`,e=>{process.stderr.write(e)})}});if(t.exitCode!==0)throw Error(`git exited with code ${t.exitCode}`)}catch(e){r.error(`Git operation failed:`,e),process.exit(1)}}}),B=t({meta:{name:`run`,description:`Run scripts or files`},async run({rawArgs:t}){t.length===0&&(r.error(`Please specify a script name or file path`),process.exit(1));let[n,...i]=t,a=process.cwd(),{config:o}=await e({cwd:a}),s=o.run?.config;try{await _(n,{cwd:a,args:i});return}catch(e){try{await C(a,s).import(n);return}catch(t){r.error(`Run failed:`),r.error(` runScript error: ${String(e)}`),r.error(` jiti error: ${String(t)}`),r.info(`\nTried to run "${n}" as both a package.json script and a file, but both failed.`),process.exit(1)}}}});function V(e,t,n){if(t.version){if(w.valid(t.version))return t.version;throw Error(`Invalid version format: ${t.version}. Please use semantic versioning format (e.g., 1.0.0, 2.1.0-alpha.1)`)}if(!w.valid(e))throw Error(`Invalid current version format: ${e}. Please fix version in package.json to use semantic versioning format (e.g., 1.0.0)`);let r=w.prerelease(e),i=t.preid||(r&&typeof r[0]==`string`?r[0]:null)||n.preid||`edge`,a=`patch`;t.major?a=`major`:t.minor?a=`minor`:t.premajor?a=`premajor`:t.preminor?a=`preminor`:t.prepatch?a=`prepatch`:t.prerelease?a=r?`prerelease`:`prepatch`:t.fromGit&&(a=`patch`);let o=a===`prerelease`||a.startsWith(`pre`)?w.inc(e,a,i):w.inc(e,a);if(!o)throw Error(`Failed to calculate new version from ${e}. Please check your version increment options.`);return o}const H=t({meta:{name:`version`,description:`Update package version`},args:{version:{type:`positional`,description:`Version to set (patch, minor, major, prerelease, or specific version)`,required:!1},preid:{type:`string`,description:`Prerelease identifier (alpha, beta, rc)`},major:{type:`boolean`,description:`Bump major version`},minor:{type:`boolean`,description:`Bump minor version`},patch:{type:`boolean`,description:`Bump patch version`},premajor:{type:`boolean`,description:`Bump premajor version`},preminor:{type:`boolean`,description:`Bump preminor version`},prepatch:{type:`boolean`,description:`Bump prepatch version`},prerelease:{type:`boolean`,description:`Bump prerelease version`},"allow-same-version":{type:`boolean`,description:`Allow same version`}},async run({args:t}){try{let{config:n}=await e(),s={preid:t.preid,major:t.major,minor:t.minor,patch:t.patch||!t.major&&!t.minor&&!t.version,premajor:t.premajor,preminor:t.preminor,prepatch:t.prepatch,prerelease:t.prerelease,allowSameVersion:t[`allow-same-version`]};if(t.version){let e=t.version;[`patch`,`minor`,`major`,`prerelease`,`premajor`,`preminor`,`prepatch`].includes(e)?s[e]=!0:s.version=e}let c=process.cwd(),l=await i(c),u=l.version;if(!u)throw Error(`No version found in package.json`);let d=V(u,s,n.version||{});if(!s.allowSameVersion&&d===u)throw Error(`Version unchanged: ${u}. Use --allow-same-version to allow this.`);await o(await a(c),{...l,version:d}),r.success(`Version updated: ${u} → ${d}`)}catch(e){r.error(`Version update failed:`,e),process.exit(1)}}});async function U(e,t){let n=process.cwd(),a=await i(n),o=a.version,s=a.name;if(!s)throw Error(`Package name is required in package.json`);if(!o)throw Error(`Package version is required in package.json`);let c=(await m(n))?.name||`npm`,l={tag:`latest`,access:`public`,...t.npm},u=e.tag;if(!u&&o&&o.includes(`-`)){let e=o.match(/-(\w+)\.\d+$/);e&&(u=e[1])}u=u||l.tag||`latest`,x(`${c} publish ${(t=>{let n=[];e.tarball&&n.push(e.tarball),n.push(`--tag`,t);let r=e.access||l.access;return r&&n.push(`--access`,r),e.dryRun&&n.push(`--dry-run`),e.otp&&n.push(`--otp`,e.otp),n})(u).join(` `)}`,{stdio:`inherit`});let d=l.additionalTag;!e.dryRun&&d&&d!==u?x(`npm dist-tag add ${s}@${o} ${d}`,{cwd:n,stdio:`inherit`}):d&&r.info(`Skipping dist-tag ${d} (same as publish tag ${u})`)}async function W(e,t){let n=process.cwd(),r=t?.tagPrefix;if(!r)throw Error(`Git tagPrefix is required`);let i=`${r}${e}`,a=t?.message?t.message(e):`chore: release ${i}`;await u([`add`,`package.json`],n),await u([`commit`,`-m`,a],n),await u([`tag`,i,...t?.signTag?[`--sign`]:[]],n),t?.push&&(await u([`push`],n),await u([`push`,`--tags`],n))}const G=t({meta:{name:`publish`,description:`Publish to registry`},args:{tag:{type:`string`,description:`Publish tag`},git:{type:`boolean`,description:`Also create git tag and commit`},access:{type:`string`,description:`Package access level (public, restricted)`},"dry-run":{type:`boolean`,description:`Dry run mode`},otp:{type:`string`,description:`One-time password for 2FA`}},async run({args:t}){try{let n=process.cwd(),a;for(;n!==v(n);){let e=y(n,`basis.config.ts`);if(ee(e)){a=e;break}n=v(n)}let{config:o}=await e({cwd:a?v(a):process.cwd()});if(await U({tag:t.tag,git:t.git,access:t.access||void 0,dryRun:t[`dry-run`],otp:t.otp},o.publish||{}),r.success(`Package published successfully`),t.git&&o.publish?.git){r.info(`Creating git tag and commit...`);let e=(await i(process.cwd())).version;e&&(await W(e,o.publish.git),r.success(`Git operations completed`))}}catch(e){r.error(`Publish failed:`,e),process.exit(1)}}}),K={npm:{outdated:[`outdated`],audit:[`audit`]},yarn:{outdated:[`outdated`,`-c`],audit:[`audit`]},pnpm:{outdated:[`outdated`],audit:[`audit`]},bun:{outdated:[`outdated`],audit:[`audit`]},deno:{outdated:null,audit:null}};async function q(t=process.cwd(),n,o=!1){let{config:s}=await e({cwd:t,overrides:n?{audit:{dependencies:n}}:void 0}),c=s.audit?.dependencies||{};r.start(`Auditing dependencies...`);let l=!1;if(c.blocked&&c.blocked.length>0)try{let e=await i(t),n={...e.dependencies,...e.devDependencies},a=Object.keys(n).filter(e=>c.blocked?.includes(e));a.length>0&&(r.error(`Found ${a.length} blocked package(s): ${a.join(`, `)}`),l=!0)}catch(e){r.error(`Failed to check blocked packages:`,e),l=!0}if(c.outdated)try{let e=(await m(t))?.name||`npm`,n=K[e];if(!n.outdated)r.info(`Skipping outdated check for ${e}`);else try{x(`${e} ${n.outdated.join(` `)}`,{cwd:t,stdio:`inherit`})}catch{r.warn(`Some dependencies are outdated`)}}catch(e){r.error(`Failed to check outdated dependencies:`,e),l=!0}if(c.security)try{let e=(await m(t))?.name||`npm`,n=K[e];if(!n.audit)r.info(`Skipping security audit for ${e}`);else try{x(`${e} ${n.audit.join(` `)}`,{cwd:t,stdio:`inherit`})}catch{l=!0}}catch(e){r.error(`Failed to check security vulnerabilities:`,e),l=!0}if(c.licenses&&(c.licenses.allowed||c.licenses.blocked))try{let e=await a(t),n=await J(t),o=[];for(let t of n)try{let n=await i(t);if(!n.name||t===e)continue;if(n.license){let e=Array.isArray(n.license)?n.license.join(`, `):n.license;if(c.licenses.blocked&&c.licenses.blocked.some(t=>e.includes(t))){o.push(`${n.name}: ${e}`);continue}c.licenses.allowed&&c.licenses.allowed.length>0&&(c.licenses.allowed.some(t=>e.includes(t))||o.push(`${n.name}: ${e}`))}}catch{}o.length>0&&(r.error(`Packages with invalid licenses:`),o.forEach(e=>r.error(` ${e}`)),l=!0)}catch(e){r.error(`Failed to check licenses:`,e),l=!0}return l||r.success(`Dependencies audit passed`),!l}async function J(e){try{return await T([`node_modules/*/package.json`,`node_modules/@*/*/package.json`,`node_modules/@*/*/*/package.json`],{cwd:e,absolute:!0})}catch{return[]}}async function Y(t=process.cwd(),n){let{config:i}=await e({cwd:t,overrides:n?{audit:{structure:n}}:void 0}),a=i.audit?.structure||{};r.start(`Auditing project structure...`);let o=!1;if(a.required&&a.required.length>0){let e=[];for(let n of a.required)try{await c(y(t,n))}catch{n.includes(`*`)||n.includes(`?`)?(await T([n],{cwd:t})).length===0&&e.push(n):e.push(n)}e.length>0&&(r.error(`Missing required file(s)/director(ies): ${e.join(`, `)}`),o=!0)}if(a.files&&a.files.length>0)for(let e of a.files)try{let n=await T([e.pattern],{cwd:t}),i=new RegExp(e.rule),a=n.filter(e=>!i.test(e));a.length>0&&(r.error(`${e.message}: ${a.slice(0,5).join(`, `)}${a.length>5?`...`:``}`),o=!0)}catch(t){r.error(`Failed to check file naming rule: ${e.pattern}`,t),o=!0}if(a.dirs&&a.dirs.length>0)for(let e of a.dirs)try{let n=await T([e.pattern],{cwd:t}),i=new RegExp(e.rule),a=n.filter(e=>!i.test(e));a.length>0&&(r.error(`${e.message}: ${a.slice(0,5).join(`, `)}${a.length>5?`...`:``}`),o=!0)}catch(t){r.error(`Failed to check directory naming rule: ${e.pattern}`,t),o=!0}return o||r.success(`Structure audit passed`),!o}async function X(t=process.cwd(),n=!1){let{config:i}=await e({cwd:t}),a=i.audit||{};r.start(`Running comprehensive project audit...`);let o=(await Promise.allSettled([q(t,a.dependencies,n),Y(t,a.structure)])).filter(e=>e.status===`rejected`||e.status===`fulfilled`&&!e.value);return o.length===0?(r.success(`All audits passed`),!0):(r.error(`${o.length} audit(s) failed`),!1)}const Z=t({meta:{name:`audit`,description:`Audit code quality`},args:{dependencies:{type:`boolean`,description:`Dependencies audit`},structure:{type:`boolean`,description:`Project structure audit`},fix:{type:`boolean`,description:`Auto-fix issues`}},async run({args:e}){let t=process.cwd(),n=!0;if(!e.dependencies&&!e.structure)n=await X(t,e.fix);else{let r=[];e.dependencies&&r.push(()=>q(t,void 0,e.fix)),e.structure&&r.push(()=>Y(t));for(let e of r)await e()||(n=!1)}n||(r.error(`Some audits failed`),process.exit(1))}}),Q=t({meta:{name:`add`,description:`Add dependencies`},args:{dev:{type:`boolean`,description:`Add as dev dependency`,alias:`D`}},async run({args:e,rawArgs:t}){t.length===0&&(r.error(`Please specify at least one package name`),r.info(`Example: basis add lodash`),process.exit(1));let n=t.filter(e=>!e.startsWith(`-`));n.length===0&&(r.error(`Please specify at least one package name`),process.exit(1));try{e.dev?(await p(n,{cwd:process.cwd()}),r.success(`Added ${n.join(`, `)} as dev dependencies`)):(await f(n,{cwd:process.cwd()}),r.success(`Added ${n.join(`, `)} as dependencies`))}catch(e){r.error(`Add packages failed:`,e),process.exit(1)}}}),te=t({meta:{name:`remove`,description:`Remove dependencies`},async run({rawArgs:e}){e.length===0&&(r.error(`Please specify at least one package name`),r.info(`Example: basis remove lodash`),process.exit(1));let t=e.filter(e=>!e.startsWith(`-`));t.length===0&&(r.error(`Please specify at least one package name`),process.exit(1));try{await g(t,{cwd:process.cwd()}),r.success(`Removed ${t.join(`, `)}`)}catch(e){r.error(`Remove packages failed:`,e),process.exit(1)}}}),ne=t({meta:{name:`dlx`,description:`Execute package without installation`},async run({rawArgs:e}){try{e.length===0&&(r.error(`Please specify a package to run`),process.exit(1));let[t,...n]=e;await h(t,{args:n,cwd:process.cwd()}),r.success(`Dlx completed`)}catch(e){r.error(`Dlx failed:`,e),process.exit(1)}}}),$=await i(import.meta.url);n(t({meta:{name:`basis`,description:$.description,version:$.version},subCommands:{init:D,lint:O,fmt:k,check:A,build:j,git:z,run:B,version:H,publish:G,audit:Z,add:Q,remove:te,dlx:ne}})).catch(e=>{r.error(e),process.exit(1)});export{};
|
package/dist/commands/build.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineCommand as e}from"citty";import{consola as t}from"consola";import{
|
|
1
|
+
import{defineCommand as e}from"citty";import{consola as t}from"consola";import{resolve as n}from"pathe";import{build as r}from"@funish/build";import{loadConfig as i}from"c12";export const buildCommand=e({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 a=n(e.dir||`.`);try{let{config:n={}}=await i({name:`isbuild`,configFile:`build.config`,cwd:a}),o=(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}});(!o||o.length===0)&&(t.error(`No build entries specified in build.config.`),process.exit(1)),await r({cwd:a,...n,entries:o}),t.success(`Build completed`)}catch(e){t.error(`Build failed:`,e),process.exit(1)}}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineCommand as e}from"citty";import{consola as t}from"consola";import{readPackageJSON as n}from"pkg-types";import{
|
|
1
|
+
import{defineCommand as e}from"citty";import{consola as t}from"consola";import{readPackageJSON as n}from"pkg-types";import{resolve as r,dirname as i}from"pathe";import{existsSync as a}from"node:fs";import{loadConfig as o}from"../config.mjs";import{publishToNpm as s,publishGitOperations as c}from"../modules/publish.mjs";export const publishCommand=e({meta:{name:`publish`,description:`Publish to registry`},args:{tag:{type:`string`,description:`Publish tag`},git:{type:`boolean`,description:`Also create git tag and commit`},access:{type:`string`,description:`Package access level (public, restricted)`},"dry-run":{type:`boolean`,description:`Dry run mode`},otp:{type:`string`,description:`One-time password for 2FA`}},async run({args:e}){try{let l=process.cwd(),u;for(;l!==i(l);){let e=r(l,`basis.config.ts`);if(a(e)){u=e;break}l=i(l)}let{config:d}=await o({cwd:u?i(u):process.cwd()});if(await s({tag:e.tag,git:e.git,access:e.access||void 0,dryRun:e[`dry-run`],otp:e.otp},d.publish||{}),t.success(`Package published successfully`),e.git&&d.publish?.git){t.info(`Creating git tag and commit...`);let e=(await n(process.cwd())).version;e&&(await c(e,d.publish.git),t.success(`Git operations completed`))}}catch(e){t.error(`Publish failed:`,e),process.exit(1)}}});
|
package/dist/config.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as FmtConfig, c as LintConfig, d as RunConfig, h as VersionConfig, l as PublishConfig, n as BasisConfig, o as GitConfig, t as AuditConfig } from "./_chunks/types.mjs";
|
|
2
|
-
import { t as defineBuildConfig } from "./_chunks/libs/common.mjs";
|
|
3
2
|
import * as c12 from "c12";
|
|
4
3
|
import { LoadConfigOptions } from "c12";
|
|
4
|
+
import { defineBuildConfig } from "@funish/build/config";
|
|
5
5
|
|
|
6
6
|
//#region src/config.d.ts
|
|
7
7
|
/**
|
package/dist/config.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e,r as t,t as n}from"./_chunks/config.mjs";export{n as defineBasisConfig,e as defineBuildConfig,t as loadConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funish/basis",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
|
-
"url": "git+https://github.com/funish/basis.git"
|
|
39
|
+
"url": "git+https://github.com/funish/basis.git",
|
|
40
|
+
"directory": "packages/basis"
|
|
40
41
|
},
|
|
41
42
|
"bin": {
|
|
42
43
|
"basis": "dist/cli.mjs"
|
|
@@ -65,16 +66,17 @@
|
|
|
65
66
|
"citty": "0.2.1",
|
|
66
67
|
"consola": "3.4.2",
|
|
67
68
|
"dugite": "3.2.0",
|
|
68
|
-
"fast-glob": "3.3.3",
|
|
69
69
|
"jiti": "2.6.1",
|
|
70
|
-
"micromatch": "4.0.8",
|
|
71
70
|
"nypm": "0.6.5",
|
|
72
71
|
"pathe": "2.0.3",
|
|
72
|
+
"picomatch": "4.0.3",
|
|
73
73
|
"pkg-types": "2.3.0",
|
|
74
|
-
"semver": "7.7.4"
|
|
74
|
+
"semver": "7.7.4",
|
|
75
|
+
"tinyglobby": "0.2.15",
|
|
76
|
+
"@funish/build": "0.0.0"
|
|
75
77
|
},
|
|
76
78
|
"devDependencies": {
|
|
77
|
-
"@types/
|
|
79
|
+
"@types/picomatch": "4.0.2",
|
|
78
80
|
"@types/semver": "7.7.1",
|
|
79
81
|
"oxlint-tsgolint": "0.15.0"
|
|
80
82
|
},
|
|
@@ -87,7 +89,7 @@
|
|
|
87
89
|
}
|
|
88
90
|
},
|
|
89
91
|
"scripts": {
|
|
90
|
-
"dev": "
|
|
91
|
-
"build": "
|
|
92
|
+
"dev": "isbuild --stub",
|
|
93
|
+
"build": "isbuild"
|
|
92
94
|
}
|
|
93
95
|
}
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
# Licenses of Bundled Dependencies
|
|
2
|
-
|
|
3
|
-
The published artifact additionally contains code with the following licenses:
|
|
4
|
-
MIT
|
|
5
|
-
|
|
6
|
-
# Bundled Dependencies
|
|
7
|
-
|
|
8
|
-
## @oxc-project/types
|
|
9
|
-
|
|
10
|
-
License: MIT
|
|
11
|
-
By: Boshen and oxc contributors
|
|
12
|
-
Repository: https://github.com/oxc-project/oxc
|
|
13
|
-
|
|
14
|
-
> MIT License
|
|
15
|
-
>
|
|
16
|
-
> Copyright (c) 2024-present VoidZero Inc. & Contributors
|
|
17
|
-
> Copyright (c) 2023 Boshen
|
|
18
|
-
>
|
|
19
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
20
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
21
|
-
> in the Software without restriction, including without limitation the rights
|
|
22
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
23
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
24
|
-
> furnished to do so, subject to the following conditions:
|
|
25
|
-
>
|
|
26
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
27
|
-
> copies or substantial portions of the Software.
|
|
28
|
-
>
|
|
29
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
30
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
31
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
32
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
33
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
34
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
35
|
-
> SOFTWARE.
|
|
36
|
-
|
|
37
|
-
---------------------------------------
|
|
38
|
-
|
|
39
|
-
## @rolldown/pluginutils, rolldown
|
|
40
|
-
|
|
41
|
-
License: MIT
|
|
42
|
-
Repositories: https://github.com/rolldown/rolldown, https://github.com/rolldown/rolldown
|
|
43
|
-
|
|
44
|
-
> MIT License
|
|
45
|
-
>
|
|
46
|
-
> Copyright (c) 2024-present VoidZero Inc. & Contributors
|
|
47
|
-
>
|
|
48
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
49
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
50
|
-
> in the Software without restriction, including without limitation the rights
|
|
51
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
52
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
53
|
-
> furnished to do so, subject to the following conditions:
|
|
54
|
-
>
|
|
55
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
56
|
-
> copies or substantial portions of the Software.
|
|
57
|
-
>
|
|
58
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
59
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
60
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
61
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
62
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
63
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
64
|
-
> SOFTWARE.
|
|
65
|
-
>
|
|
66
|
-
> end of terms and conditions
|
|
67
|
-
>
|
|
68
|
-
> The licenses of externally maintained libraries from which parts of the Software is derived are listed [here](https://github.com/rolldown/rolldown/blob/main/THIRD-PARTY-LICENSE).
|
|
69
|
-
|
|
70
|
-
---------------------------------------
|
|
71
|
-
|
|
72
|
-
## exsolve
|
|
73
|
-
|
|
74
|
-
License: MIT
|
|
75
|
-
Repository: https://github.com/unjs/exsolve
|
|
76
|
-
|
|
77
|
-
> MIT License
|
|
78
|
-
>
|
|
79
|
-
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
80
|
-
>
|
|
81
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
82
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
83
|
-
> in the Software without restriction, including without limitation the rights
|
|
84
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
85
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
86
|
-
> furnished to do so, subject to the following conditions:
|
|
87
|
-
>
|
|
88
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
89
|
-
> copies or substantial portions of the Software.
|
|
90
|
-
>
|
|
91
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
92
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
93
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
94
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
95
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
96
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
97
|
-
> SOFTWARE.
|
|
98
|
-
>
|
|
99
|
-
> ---
|
|
100
|
-
>
|
|
101
|
-
> This is a derivative work based on:
|
|
102
|
-
> <https://github.com/unjs/mlly>.
|
|
103
|
-
>
|
|
104
|
-
> ---
|
|
105
|
-
>
|
|
106
|
-
> This is a derivative work based on:
|
|
107
|
-
> <https://github.com/wooorm/import-meta-resolve>.
|
|
108
|
-
>
|
|
109
|
-
> Which is licensed:
|
|
110
|
-
>
|
|
111
|
-
> """
|
|
112
|
-
> (The MIT License)
|
|
113
|
-
>
|
|
114
|
-
> Copyright (c) 2021 Titus Wormer <mailto:tituswormer@gmail.com>
|
|
115
|
-
>
|
|
116
|
-
> Permission is hereby granted, free of charge, to any person obtaining
|
|
117
|
-
> a copy of this software and associated documentation files (the
|
|
118
|
-
> 'Software'), to deal in the Software without restriction, including
|
|
119
|
-
> without limitation the rights to use, copy, modify, merge, publish,
|
|
120
|
-
> distribute, sublicense, and/or sell copies of the Software, and to
|
|
121
|
-
> permit persons to whom the Software is furnished to do so, subject to
|
|
122
|
-
> the following conditions:
|
|
123
|
-
>
|
|
124
|
-
> The above copyright notice and this permission notice shall be
|
|
125
|
-
> included in all copies or substantial portions of the Software.
|
|
126
|
-
>
|
|
127
|
-
> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
128
|
-
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
129
|
-
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
130
|
-
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
131
|
-
> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
132
|
-
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
133
|
-
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
134
|
-
> """
|
|
135
|
-
>
|
|
136
|
-
> ---
|
|
137
|
-
>
|
|
138
|
-
> This is a derivative work based on:
|
|
139
|
-
> <https://github.com/nodejs/node>.
|
|
140
|
-
>
|
|
141
|
-
> Which is licensed:
|
|
142
|
-
>
|
|
143
|
-
> """
|
|
144
|
-
> Copyright Node.js contributors. All rights reserved.
|
|
145
|
-
>
|
|
146
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
147
|
-
> of this software and associated documentation files (the "Software"), to
|
|
148
|
-
> deal in the Software without restriction, including without limitation the
|
|
149
|
-
> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
150
|
-
> sell copies of the Software, and to permit persons to whom the Software is
|
|
151
|
-
> furnished to do so, subject to the following conditions:
|
|
152
|
-
>
|
|
153
|
-
> The above copyright notice and this permission notice shall be included in
|
|
154
|
-
> all copies or substantial portions of the Software.
|
|
155
|
-
>
|
|
156
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
157
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
158
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
159
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
160
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
161
|
-
> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
162
|
-
> IN THE SOFTWARE.
|
|
163
|
-
> """
|
|
164
|
-
>
|
|
165
|
-
> This license applies to parts of Node.js originating from the
|
|
166
|
-
> https://github.com/joyent/node repository:
|
|
167
|
-
>
|
|
168
|
-
> """
|
|
169
|
-
> Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|
170
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
171
|
-
> of this software and associated documentation files (the "Software"), to
|
|
172
|
-
> deal in the Software without restriction, including without limitation the
|
|
173
|
-
> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
174
|
-
> sell copies of the Software, and to permit persons to whom the Software is
|
|
175
|
-
> furnished to do so, subject to the following conditions:
|
|
176
|
-
>
|
|
177
|
-
> The above copyright notice and this permission notice shall be included in
|
|
178
|
-
> all copies or substantial portions of the Software.
|
|
179
|
-
>
|
|
180
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
181
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
182
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
183
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
184
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
185
|
-
> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
186
|
-
> IN THE SOFTWARE.
|
|
187
|
-
> """
|
|
188
|
-
|
|
189
|
-
---------------------------------------
|
|
190
|
-
|
|
191
|
-
## get-tsconfig
|
|
192
|
-
|
|
193
|
-
License: MIT
|
|
194
|
-
By: Hiroki Osame
|
|
195
|
-
Repository: https://github.com/privatenumber/get-tsconfig
|
|
196
|
-
|
|
197
|
-
> MIT License
|
|
198
|
-
>
|
|
199
|
-
> Copyright (c) Hiroki Osame <hiroki.osame@gmail.com>
|
|
200
|
-
>
|
|
201
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
202
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
203
|
-
> in the Software without restriction, including without limitation the rights
|
|
204
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
205
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
206
|
-
> furnished to do so, subject to the following conditions:
|
|
207
|
-
>
|
|
208
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
209
|
-
> copies or substantial portions of the Software.
|
|
210
|
-
>
|
|
211
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
212
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
213
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
214
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
215
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
216
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
217
|
-
> SOFTWARE.
|
|
218
|
-
|
|
219
|
-
---------------------------------------
|
|
220
|
-
|
|
221
|
-
## obuild
|
|
222
|
-
|
|
223
|
-
License: MIT
|
|
224
|
-
Repository: https://github.com/unjs/obuild
|
|
225
|
-
|
|
226
|
-
> MIT License
|
|
227
|
-
>
|
|
228
|
-
> Copyright (c) Pooya Parsa <pooya@pi0.io>
|
|
229
|
-
>
|
|
230
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
231
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
232
|
-
> in the Software without restriction, including without limitation the rights
|
|
233
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
234
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
235
|
-
> furnished to do so, subject to the following conditions:
|
|
236
|
-
>
|
|
237
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
238
|
-
> copies or substantial portions of the Software.
|
|
239
|
-
>
|
|
240
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
241
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
242
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
243
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
244
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
245
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
246
|
-
> SOFTWARE.
|
|
247
|
-
|
|
248
|
-
---------------------------------------
|
|
249
|
-
|
|
250
|
-
## rolldown-plugin-dts
|
|
251
|
-
|
|
252
|
-
License: MIT
|
|
253
|
-
By: Kevin Deng
|
|
254
|
-
Repository: https://github.com/sxzz/rolldown-plugin-dts
|
|
255
|
-
|
|
256
|
-
> The MIT License (MIT)
|
|
257
|
-
>
|
|
258
|
-
> Copyright © 2025-PRESENT Kevin Deng (https://github.com/sxzz)
|
|
259
|
-
>
|
|
260
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
261
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
262
|
-
> in the Software without restriction, including without limitation the rights
|
|
263
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
264
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
265
|
-
> furnished to do so, subject to the following conditions:
|
|
266
|
-
>
|
|
267
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
268
|
-
> copies or substantial portions of the Software.
|
|
269
|
-
>
|
|
270
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
271
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
272
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
273
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
274
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
275
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
276
|
-
> SOFTWARE.
|