Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@stricli/create-app

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stricli/create-app - npm Package Compare versions

Comparing version
1.0.1
to
1.1.0
+1
dist/chunk-KM6MPGDF.js
var i={name:"@stricli/create-app",version:"1.1.0",description:"Generate a new Stricli application",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/bloomberg/stricli/tree/main/packages/create-app"},author:"Michael Molisani <mmolisani@bloomberg.net>",files:["dist"],type:"module",bin:{"create-app":"dist/cli.js"},engines:{node:">=18.x"},scripts:{format:"prettier --config ../../.prettierrc -w .","format:check":"prettier --config ../../.prettierrc -c .",lint:"eslint src","lint:fix":"eslint src tests --fix",typecheck:"tsc -p tsconfig.json --noEmit",test:"mocha","test:clear-baseline":"node scripts/clear_baseline","test:accept-baseline":"node scripts/accept_baseline",coverage:"c8 npm test",build:"tsup",prepublishOnly:"npm run build"},mocha:{import:"tsx/esm",spec:"tests/**/*.spec.ts"},c8:{reporter:["text","lcovonly"],"check-coverage":!0,"skip-full":!0},tsup:{entry:["src/bin/cli.ts"],format:["esm"],tsconfig:"src/tsconfig.json",clean:!0,splitting:!0,minify:!0},dependencies:{"@stricli/auto-complete":"^1.1.0","@stricli/core":"^1.1.0"},devDependencies:{"@types/chai":"^4.3.16","@types/mocha":"^10.0.6","@types/node":"^18.19.33","@types/sinon":"^17.0.3","@typescript-eslint/eslint-plugin":"^8.2.0","@typescript-eslint/parser":"^8.2.0",c8:"^9.1.0",chai:"^5.1.1",eslint:"^8.57.0","eslint-plugin-prettier":"^5.1.3","fs-extra":"^11.2.0",memfs:"^4.9.2",mocha:"^10.4.0",prettier:"^3.2.5",sinon:"^18.0.0",tsup:"^6.7.0",tsx:"^4.8.2","type-fest":"^3.5.4",typescript:"5.6.x"}};export{i as a};
import{a as c}from"./chunk-KM6MPGDF.js";var b=`# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Dependency directories
node_modules/
jspm_packages/
*.tsbuildinfo
dist
`,C=`import type { CommandContext } from "@stricli/core";
export interface LocalContext extends CommandContext {
readonly process: NodeJS.Process;
// ...
}
export function buildContext(process: NodeJS.Process): LocalContext {
return {
process,
};
}
`,x=`import type { CommandContext } from "@stricli/core";
import type { StricliAutoCompleteContext } from "@stricli/auto-complete";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
export interface LocalContext extends CommandContext, StricliAutoCompleteContext {
readonly process: NodeJS.Process;
// ...
}
export function buildContext(process: NodeJS.Process): LocalContext {
return {
process,
os,
fs,
path,
};
}
`,g=`import type { LocalContext } from "./context";
interface CommandFlags {
readonly count: number;
}
export default async function(this: LocalContext, flags: CommandFlags, name: string): Promise<void> {
this.process.stdout.write(\`Hello \${name}!\\n\`.repeat(flags.count));
}
`,y=`import { buildApplication, buildCommand, numberParser } from "@stricli/core";
import { name, version, description } from "../package.json";
const command = buildCommand({
loader: async () => import("./impl"),
parameters: {
positional: {
kind: "tuple",
parameters: [
{
brief: "Your name",
parse: String,
},
],
},
flags: {
count: {
kind: "parsed",
brief: "Number of times to say hello",
parse: numberParser,
},
},
},
docs: {
brief: description,
},
});
export const app = buildApplication(command, {
name,
versionInfo: {
currentVersion: version,
},
});
`,v=`import type { LocalContext } from "../../context";
interface SubdirCommandFlags {
// ...
}
export default async function(this: LocalContext, flags: SubdirCommandFlags): Promise<void> {
// ...
}
`,h=`import { buildCommand } from "@stricli/core";
export const subdirCommand = buildCommand({
loader: async () => import("./impl"),
parameters: {
positional: {
kind: "tuple",
parameters: [],
},
},
docs: {
brief: "Command in subdirectory",
},
});
`,P=`import type { LocalContext } from "../../context";
interface FooCommandFlags {
// ...
}
export async function foo(this: LocalContext, flags: FooCommandFlags): Promise<void> {
// ...
}
interface BarCommandFlags {
// ...
}
export async function bar(this: LocalContext, flags: BarCommandFlags): Promise<void> {
// ...
}
`,T=`import { buildCommand, buildRouteMap } from "@stricli/core";
export const fooCommand = buildCommand({
loader: async () => {
const { foo } = await import("./impl");
return foo;
},
parameters: {
positional: {
kind: "tuple",
parameters: [],
},
},
docs: {
brief: "Nested foo command",
},
});
export const barCommand = buildCommand({
loader: async () => {
const { bar } = await import("./impl");
return bar;
},
parameters: {
positional: {
kind: "tuple",
parameters: [],
},
},
docs: {
brief: "Nested bar command",
},
});
export const nestedRoutes = buildRouteMap({
routes: {
foo: fooCommand,
bar: barCommand,
},
docs: {
brief: "Nested commands",
},
});
`,w=`import { buildApplication, buildRouteMap } from "@stricli/core";
import { name, version, description } from "../package.json";
import { subdirCommand } from "./commands/subdir/command";
import { nestedRoutes } from "./commands/nested/commands";
const routes = buildRouteMap({
routes: {
subdir: subdirCommand,
nested: nestedRoutes,
},
docs: {
brief: description,
},
});
export const app = buildApplication(routes, {
name,
versionInfo: {
currentVersion: version,
},
});
`;function N(e,t){return`import { buildApplication, buildRouteMap } from "@stricli/core";
import { buildInstallCommand, buildUninstallCommand } from "@stricli/auto-complete";
import { name, version, description } from "../package.json";
import { subdirCommand } from "./commands/subdir/command";
import { nestedRoutes } from "./commands/nested/commands";
const routes = buildRouteMap({
routes: {
subdir: subdirCommand,
nested: nestedRoutes,
install: buildInstallCommand("${e}", { bash: "${t}" }),
uninstall: buildUninstallCommand("${e}", { bash: true }),
},
docs: {
brief: description,
hideRoute: {
install: true,
uninstall: true,
},
},
});
export const app = buildApplication(routes, {
name,
versionInfo: {
currentVersion: version,
},
});
`}var k=`#!/usr/bin/env node
import { run } from "@stricli/core";
import { buildContext } from "../context";
import { app } from "../app";
await run(app, process.argv.slice(2), buildContext(process));
`,S=`#!/usr/bin/env node
import { run } from "@stricli/core";
import { buildContext } from "../context";
import { app } from "../app";
void run(app, process.argv.slice(2), buildContext(process));
`,j=`#!/usr/bin/env node
import { proposeCompletions } from "@stricli/core";
import { buildContext } from "../context";
import { app } from "../app";
const inputs = process.argv.slice(3);
if (process.env["COMP_LINE"]?.endsWith(" ")) {
inputs.push("");
}
await proposeCompletions(app, inputs, buildContext(process));
try {
for (const { completion } of await proposeCompletions(app, inputs, buildContext(process))) {
process.stdout.write(\`\${completion}\\n\`);
}
} catch {
// ignore
}
`,A=`#!/usr/bin/env node
import { proposeCompletions } from "@stricli/core";
import { buildContext } from "../context";
import { app } from "../app";
const inputs = process.argv.slice(3);
if (process.env["COMP_LINE"]?.endsWith(" ")) {
inputs.push("");
}
void proposeCompletions(app, inputs, buildContext(process)).then((completions) => {
for (const { completion } of completions) {
process.stdout.write(\`\${completion}\\n\`);
}
}, () => {
// ignore
});
`;import V from"node:child_process";function J(e){if(e.env.NPM_CONFIG_REGISTRY)return e.env.NPM_CONFIG_REGISTRY;if(e.env.NPM_EXECPATH)return V.execFileSync(e.execPath,[e.env.NPM_EXECPATH,"config","get","registry"],{encoding:"utf-8"}).trim()}async function M(e,t){let n=e+(e.endsWith("/")?t:`/${t}`),o=await(await fetch(n)).json();if(typeof o=="object"&&o&&"versions"in o&&typeof o.versions=="object")return Object.keys(o.versions??{})}var _=22;async function R(e){let t=Number(e.versions.node.split(".")[0]),n;if(t>_){let i=J(e),o=i&&await M(i,"@types/node");if(o?.includes(e.versions.node))n=`^${e.versions.node}`;else if(o){let s=new Set(o.map(r=>Number(r.split(".")[0])));if(s.has(t))n=`${t}.x`;else{let r=[...s].filter(a=>a%2===0).toSorted().at(-1);r&&(n=`${r}.x`,e.stderr.write(`No version of @types/node found with major ${t}, falling back to ${n}
`),e.stderr.write("Rerun this command with the hidden flag --node-version to manually specify the Node.js major version"))}}}else n=`${t}.x`;return n||(n=`${t}.x`,e.stderr.write(`Unable to determine version of @types/node for ${e.versions.node}, assuming ${n}
`),e.stderr.write("Rerun this command with the hidden flag --node-version to manually specify the Node.js major version")),{engine:`>=${t}`,types:n}}var p={compilerOptions:{noEmit:!0,rootDir:"..",types:["node"],resolveJsonModule:!0,target:"esnext",module:"esnext",moduleResolution:"bundler",lib:["esnext"],skipLibCheck:!0,strict:!0,isolatedModules:!0,forceConsistentCasingInFileNames:!0,noImplicitOverride:!0,noPropertyAccessFromIndexSignature:!0,noUncheckedIndexedAccess:!0,verbatimModuleSyntax:!0},exclude:[],include:["**/*"]};function O(e){return`__${e}_bash_complete`}function E(e,t,n){return{...e,version:"0.0.0",files:["dist"],bin:{[t]:"dist/cli.js"},engines:{node:n.engine},scripts:{prebuild:"tsc -p src/tsconfig.json",build:"tsup",prepublishOnly:"npm run build"},tsup:{entry:["src/bin/cli.ts"],format:[e.type==="commonjs"?"cjs":"esm"],tsconfig:"src/tsconfig.json",clean:!0,splitting:!0,minify:!0},dependencies:{"@stricli/core":c.dependencies["@stricli/core"]},devDependencies:{"@types/node":n.types,tsup:c.devDependencies.tsup,typescript:c.devDependencies.typescript}}}function B(e,t){return{...e,dependencies:{...e.dependencies,"@stricli/auto-complete":c.dependencies["@stricli/auto-complete"]},bin:{...e.bin,[t]:"dist/bash-complete.js"},tsup:{...e.tsup,entry:[...e.tsup?.entry??[],"src/bin/bash-complete.ts"]}}}function I(e,t){return{...e,scripts:{...e.scripts,postinstall:t}}}async function Q(e,t){let{fs:n,path:i}=this;await n.promises.mkdir(t,{recursive:!0});let o=async(u,f)=>{let $=i.join(t,u);await n.promises.writeFile($,f)},s=async u=>{let f=i.join(t,u);await n.promises.mkdir(f,{recursive:!0})};await s("src");let r=e.name??i.basename(t),a=e.command??r,d;e.nodeVersion?d={engine:`>=${e.nodeVersion}`,types:`${e.nodeVersion}.x`}:d=await R(this.process);let m=E({name:r,author:e.author,description:e.description,license:e.license,type:e.type},a,d),l=O(a);e.autoComplete?(m=B(m,l),e.template==="multi"?m=I(m,`${a} install`):m=I(m,`npx @stricli/auto-complete@latest install ${a} ${l}`),await o("src/context.ts",x)):await o("src/context.ts",C),await o("package.json",JSON.stringify(m,void 0,4)),await o(".gitignore",b);let L={compilerOptions:p.compilerOptions,include:p.include,exclude:p.exclude};await o("src/tsconfig.json",JSON.stringify(L,void 0,4)),e.template==="single"?(await o("src/impl.ts",g),await o("src/app.ts",y)):(await s("src/commands/subdir"),await o("src/commands/subdir/impl.ts",v),await o("src/commands/subdir/command.ts",h),await s("src/commands/nested"),await o("src/commands/nested/impl.ts",P),await o("src/commands/nested/commands.ts",T),e.autoComplete?await o("src/app.ts",N(a,l)):await o("src/app.ts",w)),await s("src/bin"),await o("src/bin/cli.ts",e.type==="module"?k:S),e.autoComplete&&await o("src/bin/bash-complete.ts",e.type==="module"?j:A)}export{Q as default};
+1
-1
#!/usr/bin/env node
import{a as e}from"./chunk-BQDCJA27.js";import{run as l}from"@stricli/core";import i from"node:fs";import a from"node:os";import n from"node:path";function o(t){return{process:t,os:a,fs:i,path:n}}import{buildApplication as p,buildCommand as s}from"@stricli/core";var m=s({loader:async()=>import("./impl-L5ILUK2G.js"),parameters:{positional:{kind:"tuple",parameters:[{brief:"Target path of new package directory",parse(t){return this.path.join(this.process.cwd(),t)},placeholder:"path"}]},flags:{type:{kind:"enum",brief:"Package type, controls output format of JS files",values:["commonjs","module"],default:"module"},template:{kind:"enum",brief:"Application template to generate",values:["single","multi"],default:"multi"},autoComplete:{kind:"boolean",brief:"Include auto complete postinstall script",default:!0},name:{kind:"parsed",brief:"Package name, if different from directory",parse:String,optional:!0},command:{kind:"parsed",brief:"Intended bin command, if different from name",parse:String,optional:!0},description:{kind:"parsed",brief:"Package description",parse:String,default:"Stricli command line application"},license:{kind:"parsed",brief:"Package license",parse:String,default:"MIT"},author:{kind:"parsed",brief:"Package author",parse:String,default:""}},aliases:{n:"name",d:"description"}},docs:{brief:e.description}}),r=p(m,{name:e.name,versionInfo:{currentVersion:e.version},scanner:{caseStyle:"allow-kebab-for-camel"},documentation:{useAliasInUsageLine:!0}});await l(r,process.argv.slice(2),o(process));
import{a as e}from"./chunk-KM6MPGDF.js";import{run as l}from"@stricli/core";import i from"node:fs";import a from"node:os";import n from"node:path";function r(o){return{process:o,os:a,fs:i,path:n}}import{buildApplication as s,buildCommand as p,numberParser as m}from"@stricli/core";var d=p({loader:async()=>import("./impl-WMK7M73K.js"),parameters:{positional:{kind:"tuple",parameters:[{brief:"Target path of new package directory",parse(o){return this.path.join(this.process.cwd(),o)},placeholder:"path"}]},flags:{type:{kind:"enum",brief:"Package type, controls output format of JS files",values:["commonjs","module"],default:"module"},template:{kind:"enum",brief:"Application template to generate",values:["single","multi"],default:"multi"},autoComplete:{kind:"boolean",brief:"Include auto complete postinstall script",default:!0},name:{kind:"parsed",brief:"Package name, if different from directory",parse:String,optional:!0},command:{kind:"parsed",brief:"Intended bin command, if different from name",parse:String,optional:!0},description:{kind:"parsed",brief:"Package description",parse:String,default:"Stricli command line application"},license:{kind:"parsed",brief:"Package license",parse:String,default:"MIT"},author:{kind:"parsed",brief:"Package author",parse:String,default:""},nodeVersion:{kind:"parsed",brief:"Node.js major version to use for engines.node minimum and @types/node, bypasses version discovery logic",parse:m,optional:!0,hidden:!0}},aliases:{n:"name",d:"description"}},docs:{brief:e.description}}),t=s(d,{name:e.name,versionInfo:{currentVersion:e.version},scanner:{caseStyle:"allow-kebab-for-camel"},documentation:{useAliasInUsageLine:!0}});await l(t,process.argv.slice(2),r(process));
{
"name": "@stricli/create-app",
"version": "1.0.1",
"version": "1.1.0",
"description": "Generate a new Stricli application",

@@ -59,4 +59,4 @@ "license": "Apache-2.0",

"dependencies": {
"@stricli/auto-complete": "^1.0.1",
"@stricli/core": "^1.0.1"
"@stricli/auto-complete": "^1.1.0",
"@stricli/core": "^1.1.0"
},

@@ -63,0 +63,0 @@ "devDependencies": {

var i={name:"@stricli/create-app",version:"1.0.1",description:"Generate a new Stricli application",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/bloomberg/stricli/tree/main/packages/create-app"},author:"Michael Molisani <mmolisani@bloomberg.net>",files:["dist"],type:"module",bin:{"create-app":"dist/cli.js"},engines:{node:">=18.x"},scripts:{format:"prettier --config ../../.prettierrc -w .","format:check":"prettier --config ../../.prettierrc -c .",lint:"eslint src","lint:fix":"eslint src tests --fix",typecheck:"tsc -p tsconfig.json --noEmit",test:"mocha","test:clear-baseline":"node scripts/clear_baseline","test:accept-baseline":"node scripts/accept_baseline",coverage:"c8 npm test",build:"tsup",prepublishOnly:"npm run build"},mocha:{import:"tsx/esm",spec:"tests/**/*.spec.ts"},c8:{reporter:["text","lcovonly"],"check-coverage":!0,"skip-full":!0},tsup:{entry:["src/bin/cli.ts"],format:["esm"],tsconfig:"src/tsconfig.json",clean:!0,splitting:!0,minify:!0},dependencies:{"@stricli/auto-complete":"^1.0.1","@stricli/core":"^1.0.1"},devDependencies:{"@types/chai":"^4.3.16","@types/mocha":"^10.0.6","@types/node":"^18.19.33","@types/sinon":"^17.0.3","@typescript-eslint/eslint-plugin":"^8.2.0","@typescript-eslint/parser":"^8.2.0",c8:"^9.1.0",chai:"^5.1.1",eslint:"^8.57.0","eslint-plugin-prettier":"^5.1.3","fs-extra":"^11.2.0",memfs:"^4.9.2",mocha:"^10.4.0",prettier:"^3.2.5",sinon:"^18.0.0",tsup:"^6.7.0",tsx:"^4.8.2","type-fest":"^3.5.4",typescript:"5.6.x"}};export{i as a};
import{a as r}from"./chunk-BQDCJA27.js";var C=`# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Dependency directories
node_modules/
jspm_packages/
*.tsbuildinfo
dist
`,b=`import type { CommandContext } from "@stricli/core";
export interface LocalContext extends CommandContext {
readonly process: NodeJS.Process;
// ...
}
export function buildContext(process: NodeJS.Process): LocalContext {
return {
process,
};
}
`,x=`import type { CommandContext } from "@stricli/core";
import type { StricliAutoCompleteContext } from "@stricli/auto-complete";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
export interface LocalContext extends CommandContext, StricliAutoCompleteContext {
readonly process: NodeJS.Process;
// ...
}
export function buildContext(process: NodeJS.Process): LocalContext {
return {
process,
os,
fs,
path,
};
}
`,f=`import type { LocalContext } from "./context";
interface CommandFlags {
readonly count: number;
}
export default async function(this: LocalContext, flags: CommandFlags, name: string): Promise<void> {
this.process.stdout.write(\`Hello \${name}!\\n\`.repeat(flags.count));
}
`,g=`import { buildApplication, buildCommand, numberParser } from "@stricli/core";
import { name, version, description } from "../package.json";
const command = buildCommand({
loader: async () => import("./impl"),
parameters: {
positional: {
kind: "tuple",
parameters: [
{
brief: "Your name",
parse: String,
},
],
},
flags: {
count: {
kind: "parsed",
brief: "Number of times to say hello",
parse: numberParser,
},
},
},
docs: {
brief: description,
},
});
export const app = buildApplication(command, {
name,
versionInfo: {
currentVersion: version,
},
});
`,y=`import type { LocalContext } from "../../context";
interface SubdirCommandFlags {
// ...
}
export default async function(this: LocalContext, flags: SubdirCommandFlags): Promise<void> {
// ...
}
`,v=`import { buildCommand } from "@stricli/core";
export const subdirCommand = buildCommand({
loader: async () => import("./impl"),
parameters: {
positional: {
kind: "tuple",
parameters: [],
},
},
docs: {
brief: "Command in subdirectory",
},
});
`,h=`import type { LocalContext } from "../../context";
interface FooCommandFlags {
// ...
}
export async function foo(this: LocalContext, flags: FooCommandFlags): Promise<void> {
// ...
}
interface BarCommandFlags {
// ...
}
export async function bar(this: LocalContext, flags: BarCommandFlags): Promise<void> {
// ...
}
`,T=`import { buildCommand, buildRouteMap } from "@stricli/core";
export const fooCommand = buildCommand({
loader: async () => {
const { foo } = await import("./impl");
return foo;
},
parameters: {
positional: {
kind: "tuple",
parameters: [],
},
},
docs: {
brief: "Nested foo command",
},
});
export const barCommand = buildCommand({
loader: async () => {
const { bar } = await import("./impl");
return bar;
},
parameters: {
positional: {
kind: "tuple",
parameters: [],
},
},
docs: {
brief: "Nested bar command",
},
});
export const nestedRoutes = buildRouteMap({
routes: {
foo: fooCommand,
bar: barCommand,
},
docs: {
brief: "Nested commands",
},
});
`,P=`import { buildApplication, buildRouteMap } from "@stricli/core";
import { name, version, description } from "../package.json";
import { subdirCommand } from "./commands/subdir/command";
import { nestedRoutes } from "./commands/nested/commands";
const routes = buildRouteMap({
routes: {
subdir: subdirCommand,
nested: nestedRoutes,
},
docs: {
brief: description,
},
});
export const app = buildApplication(routes, {
name,
versionInfo: {
currentVersion: version,
},
});
`;function k(e,t){return`import { buildApplication, buildRouteMap } from "@stricli/core";
import { buildInstallCommand, buildUninstallCommand } from "@stricli/auto-complete";
import { name, version, description } from "../package.json";
import { subdirCommand } from "./commands/subdir/command";
import { nestedRoutes } from "./commands/nested/commands";
const routes = buildRouteMap({
routes: {
subdir: subdirCommand,
nested: nestedRoutes,
install: buildInstallCommand("${e}", { bash: "${t}" }),
uninstall: buildUninstallCommand("${e}", { bash: true }),
},
docs: {
brief: description,
hideRoute: {
install: true,
uninstall: true,
},
},
});
export const app = buildApplication(routes, {
name,
versionInfo: {
currentVersion: version,
},
});
`}var w=`#!/usr/bin/env node
import { run } from "@stricli/core";
import { buildContext } from "../context";
import { app } from "../app";
await run(app, process.argv.slice(2), buildContext(process));
`,S=`#!/usr/bin/env node
import { run } from "@stricli/core";
import { buildContext } from "../context";
import { app } from "../app";
void run(app, process.argv.slice(2), buildContext(process));
`,J=`#!/usr/bin/env node
import { proposeCompletions } from "@stricli/core";
import { buildContext } from "../context";
import { app } from "../app";
const inputs = process.argv.slice(3);
if (process.env["COMP_LINE"]?.endsWith(" ")) {
inputs.push("");
}
await proposeCompletions(app, inputs, buildContext(process));
try {
for (const { completion } of await proposeCompletions(app, inputs, buildContext(process))) {
process.stdout.write(\`\${completion}\\n\`);
}
} catch {
// ignore
}
`,L=`#!/usr/bin/env node
import { proposeCompletions } from "@stricli/core";
import { buildContext } from "../context";
import { app } from "../app";
const inputs = process.argv.slice(3);
if (process.env["COMP_LINE"]?.endsWith(" ")) {
inputs.push("");
}
void proposeCompletions(app, inputs, buildContext(process)).then((completions) => {
for (const { completion } of completions) {
process.stdout.write(\`\${completion}\\n\`);
}
}, () => {
// ignore
});
`;var m={compilerOptions:{noEmit:!0,rootDir:"..",types:["node"],resolveJsonModule:!0,target:"esnext",module:"esnext",moduleResolution:"bundler",lib:["esnext"],skipLibCheck:!0,strict:!0,isolatedModules:!0,forceConsistentCasingInFileNames:!0,noImplicitOverride:!0,noPropertyAccessFromIndexSignature:!0,noUncheckedIndexedAccess:!0,verbatimModuleSyntax:!0},exclude:[],include:["**/*"]};function F(e){return`__${e}_bash_complete`}function R(e,t,i){return{...e,version:"0.0.0",files:["dist"],bin:{[t]:"dist/cli.js"},engines:{node:`>=${i}`},scripts:{prebuild:"tsc -p src/tsconfig.json",build:"tsup",prepublishOnly:"npm run build"},tsup:{entry:["src/bin/cli.ts"],format:[e.type==="commonjs"?"cjs":"esm"],tsconfig:"src/tsconfig.json",clean:!0,splitting:!0,minify:!0},dependencies:{"@stricli/core":r.dependencies["@stricli/core"]},devDependencies:{"@types/node":`${i}.x`,tsup:r.devDependencies.tsup,typescript:r.devDependencies.typescript}}}function $(e,t){return{...e,dependencies:{...e.dependencies,"@stricli/auto-complete":r.dependencies["@stricli/auto-complete"]},bin:{...e.bin,[t]:"dist/bash-complete.js"},tsup:{...e.tsup,entry:[...e.tsup?.entry??[],"src/bin/bash-complete.ts"]}}}function A(e,t){return{...e,scripts:{...e.scripts,postinstall:t}}}async function W(e,t){let{fs:i,path:p}=this;await i.promises.mkdir(t,{recursive:!0});let o=async(l,d)=>{let I=p.join(t,l);await i.promises.writeFile(I,d)},a=async l=>{let d=p.join(t,l);await i.promises.mkdir(d,{recursive:!0})};await a("src");let u=e.name??p.basename(t),s=e.command??u,N=this.process.versions.node.split(".").map(Number)[0],n=R({name:u,author:e.author,description:e.description,license:e.license,type:e.type},s,N),c=F(s);e.autoComplete?(n=$(n,c),e.template==="multi"?n=A(n,`${s} install`):n=A(n,`npx @stricli/auto-complete@latest install ${s} ${c}`),await o("src/context.ts",x)):await o("src/context.ts",b),await o("package.json",JSON.stringify(n,void 0,4)),await o(".gitignore",C);let j={compilerOptions:m.compilerOptions,include:m.include,exclude:m.exclude};await o("src/tsconfig.json",JSON.stringify(j,void 0,4)),e.template==="single"?(await o("src/impl.ts",f),await o("src/app.ts",g)):(await a("src/commands/subdir"),await o("src/commands/subdir/impl.ts",y),await o("src/commands/subdir/command.ts",v),await a("src/commands/nested"),await o("src/commands/nested/impl.ts",h),await o("src/commands/nested/commands.ts",T),e.autoComplete?await o("src/app.ts",k(s,c)):await o("src/app.ts",P)),await a("src/bin"),await o("src/bin/cli.ts",e.type==="module"?w:S),e.autoComplete&&await o("src/bin/bash-complete.ts",e.type==="module"?J:L)}export{W as default};