create-atom.io 0.0.11 → 0.0.13

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.
@@ -131,4 +131,4 @@ function getPkgManager() {
131
131
 
132
132
  //#endregion
133
133
  export { createAtom as t };
134
- //# sourceMappingURL=create-atom-C-qP8t8P.js.map
134
+ //# sourceMappingURL=create-atom-C8iE4nKO.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-atom-C-qP8t8P.js","names":["pico: Colors","opts: CreateAtomOptions","fs","dependencies: string[]","devDependencies: string[]"],"sources":["../src/create-atom.ts"],"sourcesContent":["import { existsSync, promises as fs } from \"node:fs\"\nimport { resolve } from \"node:path\"\n\nimport * as prompts from \"@clack/prompts\"\nimport { getPackageInfo } from \"local-pkg\"\nimport picocolors from \"picocolors\"\nimport type { Colors } from \"picocolors/types\"\nimport { x } from \"tinyexec\"\n\nconst pico: Colors = picocolors.createColors(true)\n\nconst s = prompts.spinner()\n\nexport type PackageManager = `bun` | `npm` | `pnpm` | `yarn`\nexport type TemplateName = `preact-svg-editor` | `react-node-backend`\n\nexport type CreateAtomOptions = {\n\tpackageManager: PackageManager\n\ttemplateName: TemplateName\n}\n\nexport type CreateAtomOptionsPreloaded = {\n\t[K in keyof CreateAtomOptions]?: CreateAtomOptions[K] | undefined\n} & { skipHints?: boolean | undefined }\n\nexport async function createAtom(\n\targDir: string | undefined,\n\toptions: CreateAtomOptionsPreloaded,\n): Promise<void> {\n\tconst skipHint = options.skipHints ?? false\n\tconst packageManager = options.packageManager ?? getPkgManager()\n\n\tprompts.intro(pico.greenBright(`atom.io - Data Components for TypeScript`))\n\n\tconst { dir, templateName } = await prompts.group(\n\t\t{\n\t\t\ttemplateName: () =>\n\t\t\t\tprompts.select<TemplateName>({\n\t\t\t\t\tmessage: `Template:`,\n\t\t\t\t\tinitialValue: `preact-svg-editor`,\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: `Preact SVG Editor`,\n\t\t\t\t\t\t\tvalue: `preact-svg-editor`,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: `React Node Backend`,\n\t\t\t\t\t\t\tvalue: `react-node-backend`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\tdir: () =>\n\t\t\t\targDir\n\t\t\t\t\t? Promise.resolve(argDir)\n\t\t\t\t\t: prompts.text({\n\t\t\t\t\t\t\tmessage: `Project directory:`,\n\t\t\t\t\t\t\tplaceholder: `my-app`,\n\t\t\t\t\t\t\tvalidate(value) {\n\t\t\t\t\t\t\t\tif (value.length === 0) {\n\t\t\t\t\t\t\t\t\treturn `Directory name is required!`\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (existsSync(value)) {\n\t\t\t\t\t\t\t\t\treturn `Refusing to overwrite existing directory or file! Please provide a non-clashing name.`\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tonCancel: () => {\n\t\t\t\tprompts.cancel(pico.yellow(`Cancelled`))\n\t\t\t\tprocess.exit(0)\n\t\t\t},\n\t\t},\n\t)\n\tconst targetDir = resolve(process.cwd(), dir)\n\tconst opts: CreateAtomOptions = { packageManager, templateName }\n\n\tawait useSpinner(\n\t\t`Setting up your project directory...`,\n\t\t() => scaffold(targetDir, opts),\n\t\t`Set up project directory`,\n\t)\n\n\tawait useSpinner(\n\t\t`Installing project dependencies...`,\n\t\t() => installDeps(targetDir, opts),\n\t\t`Installed project dependencies`,\n\t)\n\n\tif (skipHint === false) {\n\t\tconst gettingStarted = `\n\t\t\t${pico.dim(`$`)} ${pico.blueBright(`cd ${dir}`)}\n\t\t\t${pico.dim(`$`)} ${pico.blueBright(\n\t\t\t\t`${\n\t\t\t\t\tpackageManager === `npm`\n\t\t\t\t\t\t? `npm run`\n\t\t\t\t\t\t: packageManager === `bun`\n\t\t\t\t\t\t\t? `bun run`\n\t\t\t\t\t\t\t: packageManager\n\t\t\t\t} dev`,\n\t\t\t)}\n\t\t`\n\t\tprompts.note(\n\t\t\tgettingStarted.trim().replace(/^\\t\\t\\t/gm, ``),\n\t\t\t`Getting Started`,\n\t\t)\n\t}\n\n\tprompts.outro(pico.green(`You're all set!`))\n}\n\nasync function useSpinner(\n\tstartMessage: string,\n\tfn: () => Promise<void>,\n\tfinishMessage: string,\n): Promise<void> {\n\ts.start(startMessage)\n\tawait fn()\n\ts.stop(pico.green(finishMessage))\n}\n\nasync function scaffold(to: string, opts: CreateAtomOptions): Promise<void> {\n\tawait fs.mkdir(to, { recursive: true })\n\n\tconst templateInfo = await getPackageInfo(\n\t\t`@atom.io/template-${opts.templateName}`,\n\t\t{\n\t\t\tpaths: [process.cwd(), import.meta.dirname],\n\t\t},\n\t)\n\tif (!templateInfo) throw new Error(`Could not find template package`)\n\tconst { rootPath } = templateInfo\n\tawait templateDir(rootPath, to, opts)\n\tconst nodeDirPath = resolve(to, `node`)\n\n\ttry {\n\t\tawait fs.access(nodeDirPath)\n\t} catch {\n\t\treturn\n\t}\n\n\tconst nodeDir = await fs.stat(nodeDirPath)\n\tif (!nodeDir.isDirectory()) return\n\n\tconst nodeFiles = await fs.readdir(nodeDirPath, { withFileTypes: true })\n\n\tawait Promise.all(\n\t\tnodeFiles.map(async (dirent) => {\n\t\t\tif (!dirent.isFile()) return\n\t\t\tconst filename = resolve(nodeDirPath, dirent.name)\n\t\t\tawait fs.chmod(filename, 0o755)\n\t\t}),\n\t)\n}\n\n/**\n * Recursive fs copy, swiped from `create-wmr`:\n * https://github.com/preactjs/wmr/blob/3c5672ecd2f958c8eaf372d33c084dc69228ae3f/packages/create-wmr/src/index.js#L108-L124\n */\nasync function templateDir(\n\tfrom: string,\n\tto: string,\n\topts: CreateAtomOptions,\n): Promise<void[]> {\n\tconst files = await fs.readdir(from)\n\tconst results = await Promise.all(\n\t\tfiles.map(async (f) => {\n\t\t\tif (f === `.` || f === `..`) return\n\t\t\tconst filename = resolve(from, f)\n\t\t\tif ((await fs.stat(filename)).isDirectory()) {\n\t\t\t\tawait fs.mkdir(resolve(to, f), { recursive: true })\n\t\t\t\treturn templateDir(filename, resolve(to, f), opts)\n\t\t\t}\n\t\t\tif (opts.packageManager !== `npm` && f === `README.md`) {\n\t\t\t\tawait fs.writeFile(\n\t\t\t\t\tresolve(to, f),\n\t\t\t\t\t(await fs.readFile(filename, `utf-8`)).replace(\n\t\t\t\t\t\t/npm run/g,\n\t\t\t\t\t\topts.packageManager === `bun` ? `bun run` : opts.packageManager,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Publishing to npm renames the .gitignore to .npmignore\n\t\t\t// https://github.com/npm/npm/issues/7252#issuecomment-253339460\n\t\t\tif (f === `_gitignore`) f = `.gitignore`\n\t\t\tawait fs.copyFile(filename, resolve(to, f))\n\t\t}),\n\t)\n\treturn results.flat(99)\n}\n\nasync function installDeps(to: string, opts: CreateAtomOptions) {\n\tconst dependencies: string[] = []\n\tconst devDependencies: string[] = []\n\n\tconst installOpts = {\n\t\tpackageManager: opts.packageManager,\n\t\tto,\n\t}\n\n\tawait installPackages(dependencies, { ...installOpts })\n\tdevDependencies.length &&\n\t\t(await installPackages(devDependencies, { ...installOpts, dev: true }))\n}\n\ntype InstallOptions = {\n\tpackageManager: `bun` | `npm` | `pnpm` | `yarn`\n\tto: string\n\tdev?: boolean\n}\n\nfunction installPackages(pkgs: string[], opts: InstallOptions) {\n\treturn x(\n\t\topts.packageManager,\n\t\t[\n\t\t\t// `yarn add` will fail if nothing is provided\n\t\t\topts.packageManager === `yarn` ? (pkgs.length ? `add` : ``) : `install`,\n\t\t\topts.dev ? `-D` : ``,\n\t\t\t...pkgs,\n\t\t].filter(Boolean),\n\t\t{\n\t\t\tnodeOptions: {\n\t\t\t\tstdio: `ignore`,\n\t\t\t\tcwd: opts.to,\n\t\t\t},\n\t\t},\n\t)\n}\n\nfunction getPkgManager(): `bun` | `npm` | `pnpm` | `yarn` {\n\tconst userAgent = process.env[`npm_config_user_agent`] ?? ``\n\tif (userAgent.startsWith(`yarn`)) return `yarn`\n\tif (userAgent.startsWith(`pnpm`)) return `pnpm`\n\tif (userAgent.startsWith(`bun`)) return `bun`\n\treturn `npm`\n}\n"],"mappings":";;;;;;;;AASA,MAAMA,OAAe,WAAW,aAAa,KAAK;AAElD,MAAM,IAAI,QAAQ,SAAS;AAc3B,eAAsB,WACrB,QACA,SACgB;CAChB,MAAM,WAAW,QAAQ,aAAa;CACtC,MAAM,iBAAiB,QAAQ,kBAAkB,eAAe;AAEhE,SAAQ,MAAM,KAAK,YAAY,2CAA2C,CAAC;CAE3E,MAAM,EAAE,KAAK,iBAAiB,MAAM,QAAQ,MAC3C;EACC,oBACC,QAAQ,OAAqB;GAC5B,SAAS;GACT,cAAc;GACd,SAAS,CACR;IACC,OAAO;IACP,OAAO;IACP,EACD;IACC,OAAO;IACP,OAAO;IACP,CACD;GACD,CAAC;EACH,WACC,SACG,QAAQ,QAAQ,OAAO,GACvB,QAAQ,KAAK;GACb,SAAS;GACT,aAAa;GACb,SAAS,OAAO;AACf,QAAI,MAAM,WAAW,EACpB,QAAO;AAER,QAAI,WAAW,MAAM,CACpB,QAAO;;GAGT,CAAC;EACL,EACD,EACC,gBAAgB;AACf,UAAQ,OAAO,KAAK,OAAO,YAAY,CAAC;AACxC,UAAQ,KAAK,EAAE;IAEhB,CACD;CACD,MAAM,YAAY,QAAQ,QAAQ,KAAK,EAAE,IAAI;CAC7C,MAAMC,OAA0B;EAAE;EAAgB;EAAc;AAEhE,OAAM,WACL,8CACM,SAAS,WAAW,KAAK,EAC/B,2BACA;AAED,OAAM,WACL,4CACM,YAAY,WAAW,KAAK,EAClC,iCACA;AAED,KAAI,aAAa,OAAO;EACvB,MAAM,iBAAiB;KACpB,KAAK,IAAI,IAAI,CAAC,GAAG,KAAK,WAAW,MAAM,MAAM,CAAC;KAC9C,KAAK,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AO;AACxC,QAAO"}
1
+ {"version":3,"file":"create-atom-C8iE4nKO.js","names":["pico: Colors","opts: CreateAtomOptions","fs","dependencies: string[]","devDependencies: string[]"],"sources":["../src/create-atom.ts"],"sourcesContent":["import { existsSync, promises as fs } from \"node:fs\"\nimport { resolve } from \"node:path\"\n\nimport * as prompts from \"@clack/prompts\"\nimport { getPackageInfo } from \"local-pkg\"\nimport picocolors from \"picocolors\"\nimport type { Colors } from \"picocolors/types\"\nimport { x } from \"tinyexec\"\n\nconst pico: Colors = picocolors.createColors(true)\n\nconst s = prompts.spinner()\n\nexport type PackageManager = `bun` | `npm` | `pnpm` | `yarn`\nexport type TemplateName = `preact-svg-editor` | `react-node-backend`\n\nexport type CreateAtomOptions = {\n\tpackageManager: PackageManager\n\ttemplateName: TemplateName\n}\n\nexport type CreateAtomOptionsPreloaded = {\n\t[K in keyof CreateAtomOptions]?: CreateAtomOptions[K] | undefined\n} & { skipHints?: boolean | undefined }\n\nexport async function createAtom(\n\targDir: string | undefined,\n\toptions: CreateAtomOptionsPreloaded,\n): Promise<void> {\n\tconst skipHint = options.skipHints ?? false\n\tconst packageManager = options.packageManager ?? getPkgManager()\n\n\tprompts.intro(pico.greenBright(`atom.io - Data Components for TypeScript`))\n\n\tconst { dir, templateName } = await prompts.group(\n\t\t{\n\t\t\ttemplateName: () =>\n\t\t\t\tprompts.select<TemplateName>({\n\t\t\t\t\tmessage: `Template:`,\n\t\t\t\t\tinitialValue: `preact-svg-editor`,\n\t\t\t\t\toptions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: `Preact SVG Editor`,\n\t\t\t\t\t\t\tvalue: `preact-svg-editor`,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: `React Node Backend`,\n\t\t\t\t\t\t\tvalue: `react-node-backend`,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\tdir: () =>\n\t\t\t\targDir\n\t\t\t\t\t? Promise.resolve(argDir)\n\t\t\t\t\t: prompts.text({\n\t\t\t\t\t\t\tmessage: `Project directory:`,\n\t\t\t\t\t\t\tplaceholder: `my-app`,\n\t\t\t\t\t\t\tvalidate(value) {\n\t\t\t\t\t\t\t\tif (value.length === 0) {\n\t\t\t\t\t\t\t\t\treturn `Directory name is required!`\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (existsSync(value)) {\n\t\t\t\t\t\t\t\t\treturn `Refusing to overwrite existing directory or file! Please provide a non-clashing name.`\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tonCancel: () => {\n\t\t\t\tprompts.cancel(pico.yellow(`Cancelled`))\n\t\t\t\tprocess.exit(0)\n\t\t\t},\n\t\t},\n\t)\n\tconst targetDir = resolve(process.cwd(), dir)\n\tconst opts: CreateAtomOptions = { packageManager, templateName }\n\n\tawait useSpinner(\n\t\t`Setting up your project directory...`,\n\t\t() => scaffold(targetDir, opts),\n\t\t`Set up project directory`,\n\t)\n\n\tawait useSpinner(\n\t\t`Installing project dependencies...`,\n\t\t() => installDeps(targetDir, opts),\n\t\t`Installed project dependencies`,\n\t)\n\n\tif (skipHint === false) {\n\t\tconst gettingStarted = `\n\t\t\t${pico.dim(`$`)} ${pico.blueBright(`cd ${dir}`)}\n\t\t\t${pico.dim(`$`)} ${pico.blueBright(\n\t\t\t\t`${\n\t\t\t\t\tpackageManager === `npm`\n\t\t\t\t\t\t? `npm run`\n\t\t\t\t\t\t: packageManager === `bun`\n\t\t\t\t\t\t\t? `bun run`\n\t\t\t\t\t\t\t: packageManager\n\t\t\t\t} dev`,\n\t\t\t)}\n\t\t`\n\t\tprompts.note(\n\t\t\tgettingStarted.trim().replace(/^\\t\\t\\t/gm, ``),\n\t\t\t`Getting Started`,\n\t\t)\n\t}\n\n\tprompts.outro(pico.green(`You're all set!`))\n}\n\nasync function useSpinner(\n\tstartMessage: string,\n\tfn: () => Promise<void>,\n\tfinishMessage: string,\n): Promise<void> {\n\ts.start(startMessage)\n\tawait fn()\n\ts.stop(pico.green(finishMessage))\n}\n\nasync function scaffold(to: string, opts: CreateAtomOptions): Promise<void> {\n\tawait fs.mkdir(to, { recursive: true })\n\n\tconst templateInfo = await getPackageInfo(\n\t\t`@atom.io/template-${opts.templateName}`,\n\t\t{\n\t\t\tpaths: [process.cwd(), import.meta.dirname],\n\t\t},\n\t)\n\tif (!templateInfo) throw new Error(`Could not find template package`)\n\tconst { rootPath } = templateInfo\n\tawait templateDir(rootPath, to, opts)\n\tconst nodeDirPath = resolve(to, `node`)\n\n\ttry {\n\t\tawait fs.access(nodeDirPath)\n\t} catch {\n\t\treturn\n\t}\n\n\tconst nodeDir = await fs.stat(nodeDirPath)\n\tif (!nodeDir.isDirectory()) return\n\n\tconst nodeFiles = await fs.readdir(nodeDirPath, { withFileTypes: true })\n\n\tawait Promise.all(\n\t\tnodeFiles.map(async (dirent) => {\n\t\t\tif (!dirent.isFile()) return\n\t\t\tconst filename = resolve(nodeDirPath, dirent.name)\n\t\t\tawait fs.chmod(filename, 0o755)\n\t\t}),\n\t)\n}\n\n/**\n * Recursive fs copy, swiped from `create-wmr`:\n * https://github.com/preactjs/wmr/blob/3c5672ecd2f958c8eaf372d33c084dc69228ae3f/packages/create-wmr/src/index.js#L108-L124\n */\nasync function templateDir(\n\tfrom: string,\n\tto: string,\n\topts: CreateAtomOptions,\n): Promise<void[]> {\n\tconst files = await fs.readdir(from)\n\tconst results = await Promise.all(\n\t\tfiles.map(async (f) => {\n\t\t\tif (f === `.` || f === `..`) return\n\t\t\tconst filename = resolve(from, f)\n\t\t\tif ((await fs.stat(filename)).isDirectory()) {\n\t\t\t\tawait fs.mkdir(resolve(to, f), { recursive: true })\n\t\t\t\treturn templateDir(filename, resolve(to, f), opts)\n\t\t\t}\n\t\t\tif (opts.packageManager !== `npm` && f === `README.md`) {\n\t\t\t\tawait fs.writeFile(\n\t\t\t\t\tresolve(to, f),\n\t\t\t\t\t(await fs.readFile(filename, `utf-8`)).replace(\n\t\t\t\t\t\t/npm run/g,\n\t\t\t\t\t\topts.packageManager === `bun` ? `bun run` : opts.packageManager,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Publishing to npm renames the .gitignore to .npmignore\n\t\t\t// https://github.com/npm/npm/issues/7252#issuecomment-253339460\n\t\t\tif (f === `_gitignore`) f = `.gitignore`\n\t\t\tawait fs.copyFile(filename, resolve(to, f))\n\t\t}),\n\t)\n\treturn results.flat(99)\n}\n\nasync function installDeps(to: string, opts: CreateAtomOptions) {\n\tconst dependencies: string[] = []\n\tconst devDependencies: string[] = []\n\n\tconst installOpts = {\n\t\tpackageManager: opts.packageManager,\n\t\tto,\n\t}\n\n\tawait installPackages(dependencies, { ...installOpts })\n\tdevDependencies.length &&\n\t\t(await installPackages(devDependencies, { ...installOpts, dev: true }))\n}\n\ntype InstallOptions = {\n\tpackageManager: `bun` | `npm` | `pnpm` | `yarn`\n\tto: string\n\tdev?: boolean\n}\n\nfunction installPackages(pkgs: string[], opts: InstallOptions) {\n\treturn x(\n\t\topts.packageManager,\n\t\t[\n\t\t\t// `yarn add` will fail if nothing is provided\n\t\t\topts.packageManager === `yarn` ? (pkgs.length ? `add` : ``) : `install`,\n\t\t\topts.dev ? `-D` : ``,\n\t\t\t...pkgs,\n\t\t].filter(Boolean),\n\t\t{\n\t\t\tnodeOptions: {\n\t\t\t\tstdio: `ignore`,\n\t\t\t\tcwd: opts.to,\n\t\t\t},\n\t\t},\n\t)\n}\n\nfunction getPkgManager(): `bun` | `npm` | `pnpm` | `yarn` {\n\tconst userAgent = process.env[`npm_config_user_agent`] ?? ``\n\tif (userAgent.startsWith(`yarn`)) return `yarn`\n\tif (userAgent.startsWith(`pnpm`)) return `pnpm`\n\tif (userAgent.startsWith(`bun`)) return `bun`\n\treturn `npm`\n}\n"],"mappings":";;;;;;;;AASA,MAAMA,OAAe,WAAW,aAAa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BAAmB,SAAS,MAAM,aAAa;AACvD,SAAMA,SAAG,UACR,QAAQ,IAAI,EAAE,GACb,MAAMA,SAAG,SAAS,UAAU,QAAQ,EAAE,QACtC,YACA,KAAK,mBAAmB,QAAQ,YAAY,KAAK,eACjD,CACD;AACD;;AAID,MAAI,MAAM,aAAc,KAAI;AAC5B,QAAMA,SAAG,SAAS,UAAU,QAAQ,IAAI,EAAE,CAAC;GAC1C,CACF,EACc,KAAK,GAAG;;AAGxB,eAAe,YAAY,IAAY,MAAyB;CAC/D,MAAMC,eAAyB,EAAE;CACjC,MAAMC,kBAA4B,EAAE;CAEpC,MAAM,cAAc;EACnB,gBAAgB,KAAK;EACrB;EACA;AAED,OAAM,gBAAgB,cAAc,EAAE,GAAG,aAAa,CAAC;AACvD,iBAAgB,UACd,MAAM,gBAAgB,iBAAiB;EAAE,GAAG;EAAa,KAAK;EAAM,CAAC;;AASxE,SAAS,gBAAgB,MAAgB,MAAsB;AAC9D,QAAO,EACN,KAAK,gBACL;EAEC,KAAK,mBAAmB,SAAU,KAAK,SAAS,QAAQ,KAAM;EAC9D,KAAK,MAAM,OAAO;EAClB,GAAG;EACH,CAAC,OAAO,QAAQ,EACjB,EACC,aAAa;EACZ,OAAO;EACP,KAAK,KAAK;EACV,EACD,CACD;;AAGF,SAAS,gBAAiD;CACzD,MAAM,YAAY,QAAQ,IAAI,4BAA4B;AAC1D,KAAI,UAAU,WAAW,OAAO,CAAE,QAAO;AACzC,KAAI,UAAU,WAAW,OAAO,CAAE,QAAO;AACzC,KAAI,UAAU,WAAW,MAAM,CAAE,QAAO;AACxC,QAAO"}
@@ -1,3 +1,3 @@
1
- import { t as createAtom } from "./create-atom-C-qP8t8P.js";
1
+ import { t as createAtom } from "./create-atom-C8iE4nKO.js";
2
2
 
3
3
  export { createAtom };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as createAtom } from "./create-atom-C-qP8t8P.js";
2
+ import { t as createAtom } from "./create-atom-C8iE4nKO.js";
3
3
  import { type } from "arktype";
4
4
  import { cli, optional, options, parseBooleanOption } from "comline";
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-atom.io",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Jeremy Banka",
@@ -26,24 +26,24 @@
26
26
  "bin": "./bin/create-atom.bin.js",
27
27
  "dependencies": {
28
28
  "@clack/prompts": "0.11.0",
29
- "arktype": "2.1.25",
29
+ "arktype": "2.1.26",
30
30
  "local-pkg": "1.1.2",
31
31
  "picocolors": "1.1.1",
32
32
  "tinyexec": "1.0.2",
33
- "@atom.io/template-preact-svg-editor": "0.0.3",
34
- "@atom.io/template-react-node-backend": "0.0.4",
35
- "comline": "0.4.3"
33
+ "@atom.io/template-preact-svg-editor": "0.0.4",
34
+ "comline": "0.4.3",
35
+ "@atom.io/template-react-node-backend": "0.0.6"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/bun": "npm:bun-types@1.3.2",
39
- "@types/node": "24.10.0",
39
+ "@types/node": "24.10.1",
40
40
  "@types/tmp": "0.2.6",
41
- "@typescript/native-preview": "7.0.0-dev.20251110.1",
41
+ "@typescript/native-preview": "7.0.0-dev.20251113.1",
42
42
  "concurrently": "9.2.1",
43
43
  "eslint": "9.39.1",
44
44
  "rimraf": "6.1.0",
45
45
  "tmp": "0.2.5",
46
- "tsdown": "0.16.1"
46
+ "tsdown": "0.16.4"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsdown && rm -f dist/*.x.d.ts",