@tntstack/create-app 0.1.3 → 0.1.7

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -49
  3. package/dist/index.js +4 -4
  4. package/package.json +67 -61
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dest
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/README.md CHANGED
@@ -1,49 +1,49 @@
1
- # @tntstack/create
2
-
3
- The official scaffolding CLI for [**TNT Stack**](https://tnt.odest.tech). The ultimate stack for building cross-platform apps. Write your code once and deploy to Web, Windows, macOS, Linux, and Android.
4
-
5
- ## Usage
6
-
7
- ```bash
8
- npm create @tntstack/app@latest
9
- ```
10
-
11
- Or with other package managers:
12
-
13
- ```bash
14
- pnpm create @tntstack/app@latest
15
- yarn create @tntstack/app
16
- npx @tntstack/create-app
17
- bunx @tntstack/create-app
18
- ```
19
-
20
- ### Non-interactive
21
-
22
- ```bash
23
- npm create @tntstack/app@latest -- --name my-app --github-user myuser --no-install
24
- ```
25
-
26
- ### Options
27
-
28
- | Flag | Description |
29
- | -------------------------- | -------------------------------- |
30
- | `-n, --name <name>` | Project name |
31
- | `-d, --directory <dir>` | Output directory |
32
- | `-g, --github-user <user>` | GitHub username / org (optional) |
33
- | `-i, --identifier <id>` | App identifier (reverse-domain) |
34
- | `-v, --app-version <ver>` | Initial version |
35
- | `--no-install` | Skip dependency installation |
36
-
37
- ## What it does
38
-
39
- 1. Downloads the TNTStack core files from GitHub
40
- 2. Replaces all project identifiers with your values
41
- 3. Sets up Android package structure
42
- 4. Initialises a fresh git repository
43
- 5. Installs dependencies
44
-
45
- ## Links
46
-
47
- - [Documentation](https://tnt.odest.tech/docs)
48
- - [GitHub](https://github.com/odest/tntstack)
49
- - [Issues](https://github.com/odest/tntstack/issues)
1
+ # @tntstack/create-app
2
+
3
+ The official scaffolding CLI for [**TNT Stack**](https://tnt.odest.tech). The solid stack for building cross-platform apps. Write your code once and build for Web, Desktop, and Mobile.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npm create @tntstack/app@latest
9
+ ```
10
+
11
+ Or with other package managers:
12
+
13
+ ```bash
14
+ pnpm create @tntstack/app@latest
15
+ yarn create @tntstack/app
16
+ npx @tntstack/create-app
17
+ bunx @tntstack/create-app
18
+ ```
19
+
20
+ ### Non-interactive
21
+
22
+ ```bash
23
+ npm create @tntstack/app@latest -- --name my-app --github-user myuser --no-install
24
+ ```
25
+
26
+ ### Options
27
+
28
+ | Flag | Description |
29
+ | -------------------------- | -------------------------------- |
30
+ | `-n, --name <name>` | Project name |
31
+ | `-d, --directory <dir>` | Output directory |
32
+ | `-g, --github-user <user>` | GitHub username / org (optional) |
33
+ | `-i, --identifier <id>` | App identifier (reverse-domain) |
34
+ | `-v, --app-version <ver>` | Initial version |
35
+ | `--no-install` | Skip dependency installation |
36
+
37
+ ## What it does
38
+
39
+ 1. Downloads the TNTStack core files from GitHub
40
+ 2. Replaces all project identifiers with your values
41
+ 3. Sets up Android package structure
42
+ 4. Initialises a fresh git repository
43
+ 5. Installs dependencies
44
+
45
+ ## Links
46
+
47
+ - [Documentation](https://tnt.odest.tech/docs)
48
+ - [GitHub](https://github.com/odest/tntstack)
49
+ - [Issues](https://github.com/odest/tntstack/issues)
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'module';const require = createRequire(import.meta.url);
3
- import{Command as Q}from"commander";import x from"picocolors";import*as h from"@clack/prompts";import*as s from"@clack/prompts";import g from"picocolors";var b="github:odest/tntstack#master",w="0.1.0",u={name:"tntstack",namePascal:"TNTStack",identifier:"com.tntstack.app",githubUser:"odest"};var C=["node_modules",".git","target","dist",".turbo",".next","*.png","*.ico","*.icns","*.webp","*.woff","*.woff2","*.ttf","*.eot","*.jar","*.so","*.dylib","*.exe","*.dll","pnpm-lock.yaml"],N=["CHANGELOG.md","init-project.ps1","init-project.sh","packages/cli",".github/FUNDING.yml",".github/workflows/publish-cli.yml"],$=["release-please-config.json",".release-please-manifest.json"];function y(e){if(!e||e.length===0)return"Project name cannot be empty.";if(!/^[a-z0-9-_]+$/.test(e))return"Use only lowercase letters, numbers, hyphens, and underscores.";if(e.startsWith("-")||e.endsWith("-")||e.startsWith("_")||e.endsWith("_"))return"Cannot start or end with a hyphen or underscore."}function S(e){if(e&&!/^\d+\.\d+\.\d+$/.test(e))return"Must be a valid semver version (e.g. 0.1.0)."}function v(e){return e.replace(/-/g,"_")}function j(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}async function T(e){for(;;){let t=await s.text({message:"What is your project name?",placeholder:"my-awesome-app",validate:y});s.isCancel(t)&&(s.cancel("Setup cancelled."),process.exit(0));let n=e??`./${t}`,i=await s.text({message:"GitHub username / org (optional)?",placeholder:"your-github-username",defaultValue:"your-github-username"});s.isCancel(i)&&(s.cancel("Setup cancelled."),process.exit(0));let o=await s.text({message:"Initial version?",placeholder:w,defaultValue:w,validate:S});s.isCancel(o)&&(s.cancel("Setup cancelled."),process.exit(0));let c=await s.confirm({message:"Install dependencies?",initialValue:!0});s.isCancel(c)&&(s.cancel("Setup cancelled."),process.exit(0));let p={projectName:t,projectNamePascal:j(t),projectNameSnake:v(t),directory:n,githubUser:i,identifier:`com.${t}.app`,version:o,installDeps:c};s.note([`${g.bold("Project")} ${p.projectName}`,`${g.bold("Directory")} ${p.directory}`,`${g.bold("GitHub user")} ${p.githubUser}`,`${g.bold("Identifier")} ${p.identifier}`,`${g.bold("Version")} ${p.version}`,`${g.bold("Install deps")} ${p.installDeps?"yes":"no"}`].join(`
4
- `),"Summary");let r=await s.confirm({message:"Proceed with these settings?",initialValue:!0});if(s.isCancel(r)&&(s.cancel("Setup cancelled."),process.exit(0)),r)return p;s.log.info("Let's try that again...")}}import*as l from"@clack/prompts";import q from"path";import H from"fs-extra";import{downloadTemplate as M}from"giget";async function F(e){let{dir:t}=await M(b,{dir:e,force:!0});return t}import m from"path";import a from"fs-extra";import*as d from"@clack/prompts";function W(e){return[[u.identifier,e.identifier],["tntstack_lib",`${e.projectNameSnake}_lib`],[u.namePascal,e.projectNamePascal],[u.githubUser,e.githubUser],[u.name,e.projectName]]}function _(e){let t=e.replace(/\\/g,"/"),n=m.basename(e);return C.some(i=>i.startsWith("*.")?n.endsWith(i.slice(1)):n===i||t.includes(`/${i}/`))}async function O(e){let t=[],n=await a.readdir(e,{withFileTypes:!0});for(let i of n){let o=m.join(e,i.name);_(o)||(i.isDirectory()?t.push(...await O(o)):i.isFile()&&t.push(o))}return t}function z(e,t){let n=e;for(let[i,o]of t)n=n.replaceAll(i,o);return n}async function D(e,t){let n=W(t),i=await O(e);for(let o of i)try{let c=await a.readFile(o,"utf-8"),p=z(c,n);p!==c&&await a.writeFile(o,p,"utf-8")}catch(c){c instanceof Error&&!c.message.includes("is not valid UTF-8")&&d.log.warn(`Could not rename contents of ${o}: ${c.message}`)}await B(e,t),await K(e,t)}async function B(e,t){let n=u.identifier.split("."),i=t.identifier.split("."),o=m.join(e,"apps","native","src-tauri","gen","android");if(!await a.pathExists(o))return;let c=await R(o,"java");for(let p of c){let r=m.join(p,...n);if(!await a.pathExists(r))continue;let f=m.join(p,...i);await a.ensureDir(m.dirname(f)),await a.move(r,f,{overwrite:!0}),await I(m.dirname(r),p)}}async function R(e,t){let n=[],i=await a.readdir(e,{withFileTypes:!0});for(let o of i){if(!o.isDirectory())continue;let c=m.join(e,o.name);o.name===t?n.push(c):n.push(...await R(c,t))}return n}async function I(e,t){if(!(e===t||!e.startsWith(t)))try{(await a.readdir(e)).length===0&&(await a.rmdir(e),await I(m.dirname(e),t))}catch{}}async function K(e,t){let n=await A(e,"package.json");for(let r of n)try{let f=await a.readJson(r);f.version&&(f.version=t.version,await a.writeJson(r,f,{spaces:2}))}catch(f){d.log.warn(`Failed to update version in ${r}: ${f instanceof Error?f.message:String(f)}`)}let i=m.join(e,".release-please-manifest.json");if(await a.pathExists(i))try{let r=await a.readJson(i);for(let f of Object.keys(r))r[f]=t.version;await a.writeJson(i,r,{spaces:2})}catch(r){d.log.warn(`Failed to update .release-please-manifest.json: ${r instanceof Error?r.message:String(r)}`)}let o=m.join(e,"apps","native","src-tauri","Cargo.toml");if(await a.pathExists(o))try{let r=await a.readFile(o,"utf-8");r=r.replace(/^version\s*=\s*"[^"]*"/m,`version = "${t.version}"`),await a.writeFile(o,r,"utf-8")}catch(r){d.log.warn(`Failed to update Cargo.toml: ${r instanceof Error?r.message:String(r)}`)}let c=m.join(e,"apps","native","src-tauri","Cargo.lock");if(await a.pathExists(c))try{let r=await a.readFile(c,"utf-8"),f=new RegExp(`(name = "${t.projectName}"\\s+version = )([^\\s]+)`,"g");r=r.replace(f,`$1"${t.version}"`),await a.writeFile(c,r,"utf-8")}catch(r){d.log.warn(`Failed to update Cargo.lock: ${r instanceof Error?r.message:String(r)}`)}let p=m.join(e,"apps","native","src-tauri","tauri.conf.json");if(await a.pathExists(p))try{let r=await a.readJson(p);r.version&&(r.version=t.version),await a.writeJson(p,r,{spaces:2})}catch(r){d.log.warn(`Failed to update tauri.conf.json: ${r instanceof Error?r.message:String(r)}`)}}async function A(e,t){let n=[],i=await a.readdir(e,{withFileTypes:!0});for(let o of i){let c=m.join(e,o.name);if(o.isDirectory()){if(_(c))continue;n.push(...await A(c,t))}else o.name===t&&n.push(c)}return n}import U from"path";import k from"fs-extra";import*as L from"@clack/prompts";async function V(e){for(let t of N)await k.remove(U.join(e,t));for(let t of $){let n=U.join(e,t);if(await k.pathExists(n))try{let i=await k.readJson(n),o=!1;i.packages&&typeof i.packages=="object"&&i.packages["packages/cli"]&&(delete i.packages["packages/cli"],o=!0),i["packages/cli"]&&(delete i["packages/cli"],o=!0),o&&await k.writeJson(n,i,{spaces:2})}catch(i){L.log.warn(`Failed to clean JSON config at ${n}: ${i instanceof Error?i.message:String(i)}`)}}}import{execa as E}from"execa";async function G(e){await E("git",["init"],{cwd:e}),await E("git",["add","."],{cwd:e}),await E("git",["commit","-m","chore: initialize project using @tntstack/create-app"],{cwd:e})}import{execa as Y}from"execa";async function J(e){await Y("pnpm",["install"],{cwd:e})}async function P(e){let t=q.resolve(e.directory);if(await H.pathExists(t)&&(await H.readdir(t)).length>0){let o=await l.confirm({message:`Directory ${e.directory} is not empty. Overwrite?`,initialValue:!1});(l.isCancel(o)||!o)&&(l.cancel("Setup cancelled."),process.exit(1))}let n=l.spinner();n.start("Downloading TNTStack core files\u2026");try{await F(t)}catch(i){n.stop("Download failed."),l.cancel(i instanceof Error?i.message:"Failed to download core files."),process.exit(1)}n.stop("Core files downloaded."),n.start("Configuring project\u2026"),await D(t,e),n.stop("Project configured."),n.start("Cleaning up\u2026"),await V(t),n.stop("Done."),n.start("Initialising git\u2026");try{await G(t),n.stop("Git ready.")}catch(i){n.stop("Skipped git init."),l.log.warn(`Could not initialize git: ${i instanceof Error?i.message:String(i)}`)}if(e.installDeps){n.start("Installing dependencies\u2026");try{await J(t),n.stop("Dependencies installed.")}catch(i){n.stop("Dependency installation failed."),l.log.warn(`Could not install dependencies: ${i instanceof Error?i.message:String(i)}`)}}l.note([`cd ${e.directory}`,e.installDeps?"":"pnpm install","pnpm dev"].filter(Boolean).join(`
5
- `),"Next steps"),l.outro("Your TNTStack project is ready! \u{1F680}")}var X=`
3
+ import{Command as X}from"commander";import x from"picocolors";import*as h from"@clack/prompts";import*as p from"@clack/prompts";import g from"picocolors";var b="github:odest/tntstack#master",w="0.1.0",d={name:"tntstack",namePascal:"TNTStack",identifier:"com.tntstack.app",githubUser:"odest"};var C=["node_modules",".git","target","dist",".turbo",".next","*.png","*.ico","*.icns","*.webp","*.woff","*.woff2","*.ttf","*.eot","*.jar","*.so","*.dylib","*.exe","*.dll","pnpm-lock.yaml"],N=["CHANGELOG.md","packages/cli",".github/FUNDING.yml",".github/workflows/publish-cli.yml"],$=["release-please-config.json",".release-please-manifest.json"];function y(e){if(!e||e.length===0)return"Project name cannot be empty.";if(!/^[a-z0-9-_]+$/.test(e))return"Use only lowercase letters, numbers, hyphens, and underscores.";if(e.startsWith("-")||e.endsWith("-")||e.startsWith("_")||e.endsWith("_"))return"Cannot start or end with a hyphen or underscore."}function S(e){if(e&&!/^\d+\.\d+\.\d+$/.test(e))return"Must be a valid semver version (e.g. 0.1.0)."}function v(e){return e.replace(/-/g,"_")}function j(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}async function F(e){for(;;){let t=await p.text({message:"What is your project name?",placeholder:"my-awesome-app",validate:y});p.isCancel(t)&&(p.cancel("Setup cancelled."),process.exit(0));let a=e??`./${t}`,n=await p.text({message:"GitHub username / org (optional)?",placeholder:"your-github-username",defaultValue:"your-github-username"});p.isCancel(n)&&(p.cancel("Setup cancelled."),process.exit(0));let r=await p.text({message:"Initial version?",placeholder:w,defaultValue:w,validate:S});p.isCancel(r)&&(p.cancel("Setup cancelled."),process.exit(0));let o=await p.confirm({message:"Install dependencies?",initialValue:!0});p.isCancel(o)&&(p.cancel("Setup cancelled."),process.exit(0));let c={projectName:t,projectNamePascal:j(t),projectNameSnake:v(t),directory:a,githubUser:n,identifier:`com.${t}.app`,version:r,installDeps:o};p.note([`${g.bold("Project")} ${c.projectName}`,`${g.bold("Directory")} ${c.directory}`,`${g.bold("GitHub user")} ${c.githubUser}`,`${g.bold("Identifier")} ${c.identifier}`,`${g.bold("Version")} ${c.version}`,`${g.bold("Install deps")} ${c.installDeps?"yes":"no"}`].join(`
4
+ `),"Summary");let i=await p.confirm({message:"Proceed with these settings?",initialValue:!0});if(p.isCancel(i)&&(p.cancel("Setup cancelled."),process.exit(0)),i)return c;p.log.info("Let's try that again...")}}import*as m from"@clack/prompts";import Q from"path";import H from"fs-extra";import{downloadTemplate as M}from"giget";async function T(e){let{dir:t}=await M(b,{dir:e,force:!0});return t}import f from"path";import s from"fs-extra";import*as u from"@clack/prompts";function W(e){return[[d.identifier,e.identifier],["tntstack_lib",`${e.projectNameSnake}_lib`],[d.namePascal,e.projectNamePascal],[d.githubUser,e.githubUser],[d.name,e.projectName]]}function _(e){let t=e.replace(/\\/g,"/"),a=f.basename(e);return C.some(n=>n.startsWith("*.")?a.endsWith(n.slice(1)):a===n||t.includes(`/${n}/`))}async function O(e){let t=[],a=await s.readdir(e,{withFileTypes:!0});for(let n of a){let r=f.join(e,n.name);_(r)||(n.isDirectory()?t.push(...await O(r)):n.isFile()&&t.push(r))}return t}function B(e,t){let a=e;for(let[n,r]of t)a=a.replaceAll(n,r);return a}async function D(e,t){let a=W(t),n=await O(e);for(let r of n)try{let o=await s.readFile(r,"utf-8"),c=B(o,a);c!==o&&await s.writeFile(r,c,"utf-8")}catch(o){o instanceof Error&&!o.message.includes("is not valid UTF-8")&&u.log.warn(`Could not rename contents of ${r}: ${o.message}`)}await z(e,t),await K(e,t),await Y(e,t)}async function z(e,t){let a=d.identifier.split("."),n=t.identifier.split("."),r=f.join(e,"apps","native","src-tauri","gen","android");if(!await s.pathExists(r))return;let o=await A(r,"java");for(let c of o){let i=f.join(c,...a);if(!await s.pathExists(i))continue;let l=f.join(c,...n);await s.ensureDir(f.dirname(l)),await s.move(i,l,{overwrite:!0}),await R(f.dirname(i),c)}}async function A(e,t){let a=[],n=await s.readdir(e,{withFileTypes:!0});for(let r of n){if(!r.isDirectory())continue;let o=f.join(e,r.name);r.name===t?a.push(o):a.push(...await A(o,t))}return a}async function R(e,t){if(!(e===t||!e.startsWith(t)))try{(await s.readdir(e)).length===0&&(await s.rmdir(e),await R(f.dirname(e),t))}catch{}}async function K(e,t){let a=f.join(e,"apps","native","src-tauri","gen","apple");if(!await s.pathExists(a))return;let n=[];async function r(o){let c=await s.readdir(o,{withFileTypes:!0});for(let i of c){let l=f.join(o,i.name);n.push(l),i.isDirectory()&&await r(l)}}await r(a),n.sort((o,c)=>c.length-o.length);for(let o of n){if(!await s.pathExists(o))continue;let c=f.basename(o),i=c;if(i.includes(d.namePascal)&&(i=i.replaceAll(d.namePascal,t.projectNamePascal)),i.includes(d.name)&&(i=i.replaceAll(d.name,t.projectName)),i!==c){let l=f.join(f.dirname(o),i);await s.move(o,l,{overwrite:!0})}}}async function Y(e,t){let a=await I(e,"package.json");for(let i of a)try{let l=await s.readJson(i);l.version&&(l.version=t.version,await s.writeJson(i,l,{spaces:2}))}catch(l){u.log.warn(`Failed to update version in ${i}: ${l instanceof Error?l.message:String(l)}`)}let n=f.join(e,".release-please-manifest.json");if(await s.pathExists(n))try{let i=await s.readJson(n);for(let l of Object.keys(i))i[l]=t.version;await s.writeJson(n,i,{spaces:2})}catch(i){u.log.warn(`Failed to update .release-please-manifest.json: ${i instanceof Error?i.message:String(i)}`)}let r=f.join(e,"apps","native","src-tauri","Cargo.toml");if(await s.pathExists(r))try{let i=await s.readFile(r,"utf-8");i=i.replace(/^version\s*=\s*"[^"]*"/m,`version = "${t.version}"`),await s.writeFile(r,i,"utf-8")}catch(i){u.log.warn(`Failed to update Cargo.toml: ${i instanceof Error?i.message:String(i)}`)}let o=f.join(e,"apps","native","src-tauri","Cargo.lock");if(await s.pathExists(o))try{let i=await s.readFile(o,"utf-8"),l=new RegExp(`(name = "${t.projectName}"\\s+version = )([^\\s]+)`,"g");i=i.replace(l,`$1"${t.version}"`),await s.writeFile(o,i,"utf-8")}catch(i){u.log.warn(`Failed to update Cargo.lock: ${i instanceof Error?i.message:String(i)}`)}let c=f.join(e,"apps","native","src-tauri","tauri.conf.json");if(await s.pathExists(c))try{let i=await s.readJson(c);i.version&&(i.version=t.version),await s.writeJson(c,i,{spaces:2})}catch(i){u.log.warn(`Failed to update tauri.conf.json: ${i instanceof Error?i.message:String(i)}`)}}async function I(e,t){let a=[],n=await s.readdir(e,{withFileTypes:!0});for(let r of n){let o=f.join(e,r.name);if(r.isDirectory()){if(_(o))continue;a.push(...await I(o,t))}else r.name===t&&a.push(o)}return a}import U from"path";import E from"fs-extra";import*as L from"@clack/prompts";async function V(e){for(let t of N)await E.remove(U.join(e,t));for(let t of $){let a=U.join(e,t);if(await E.pathExists(a))try{let n=await E.readJson(a),r=!1;n.packages&&typeof n.packages=="object"&&n.packages["packages/cli"]&&(delete n.packages["packages/cli"],r=!0),n["packages/cli"]&&(delete n["packages/cli"],r=!0),r&&await E.writeJson(a,n,{spaces:2})}catch(n){L.log.warn(`Failed to clean JSON config at ${a}: ${n instanceof Error?n.message:String(n)}`)}}}import{execa as P}from"execa";async function G(e){await P("git",["init"],{cwd:e}),await P("git",["add","."],{cwd:e}),await P("git",["commit","-m","chore: initialize project using @tntstack/create-app"],{cwd:e})}import{execa as q}from"execa";async function J(e){await q("pnpm",["install"],{cwd:e})}async function k(e){let t=Q.resolve(e.directory);if(await H.pathExists(t)&&(await H.readdir(t)).length>0){let r=await m.confirm({message:`Directory ${e.directory} is not empty. Overwrite?`,initialValue:!1});(m.isCancel(r)||!r)&&(m.cancel("Setup cancelled."),process.exit(1))}let a=m.spinner();a.start("Downloading TNTStack core files\u2026");try{await T(t)}catch(n){a.stop("Download failed."),m.cancel(n instanceof Error?n.message:"Failed to download core files."),process.exit(1)}a.stop("Core files downloaded."),a.start("Configuring project\u2026"),await D(t,e),a.stop("Project configured."),a.start("Cleaning up\u2026"),await V(t),a.stop("Done."),a.start("Initialising git\u2026");try{await G(t),a.stop("Git ready.")}catch(n){a.stop("Skipped git init."),m.log.warn(`Could not initialize git: ${n instanceof Error?n.message:String(n)}`)}if(e.installDeps){a.start("Installing dependencies\u2026");try{await J(t),a.stop("Dependencies installed.")}catch(n){a.stop("Dependency installation failed."),m.log.warn(`Could not install dependencies: ${n instanceof Error?n.message:String(n)}`)}}m.note([`cd ${e.directory}`,e.installDeps?"":"pnpm install","pnpm dev"].filter(Boolean).join(`
5
+ `),"Next steps"),m.outro("Your TNTStack project is ready! \u{1F680}")}var Z=`
6
6
  \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557
7
7
  \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2551 \u2588\u2588\u2554\u255D
8
8
  \u2588\u2588\u2551 \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2554\u255D
9
9
  \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2588\u2588\u2557
10
10
  \u2588\u2588\u2551 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2557
11
11
  \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D
12
- `,Z=new Q().name("tntstack").description("Scaffold a new TNTStack project").version("0.1.2").option("-n, --name <name>","Project name").option("-d, --directory <dir>","Output directory").option("-g, --github-user <user>","GitHub username / org").option("-i, --identifier <id>","App identifier (reverse-domain)").option("-v, --app-version <ver>","Initial version").option("--no-install","Skip dependency installation").action(async e=>{if(console.clear(),console.log(x.cyan(X)),h.intro(x.bold(x.green("TNTStack Scaffold Tool"))),e.name){let t=y(e.name);if(t&&(h.cancel(t),process.exit(1)),e.appVersion){let n=S(e.appVersion);n&&(h.cancel(n),process.exit(1))}await P({projectName:e.name,projectNamePascal:j(e.name),projectNameSnake:v(e.name),directory:e.directory??`./${e.name}`,githubUser:e.githubUser??"your-github-username",identifier:e.identifier??`com.${e.name}.app`,version:e.appVersion??w,installDeps:e.install??!0})}else{let t=await T(e.directory);await P(t)}});Z.parse();
12
+ `,ee=new X().name("tntstack").description("Scaffold a new TNTStack project").version("0.1.2").option("-n, --name <name>","Project name").option("-d, --directory <dir>","Output directory").option("-g, --github-user <user>","GitHub username / org").option("-i, --identifier <id>","App identifier (reverse-domain)").option("-v, --app-version <ver>","Initial version").option("--no-install","Skip dependency installation").action(async e=>{if(console.clear(),console.log(x.cyan(Z)),h.intro(x.bold(x.green("TNTStack Scaffold Tool"))),e.name){let t=y(e.name);if(t&&(h.cancel(t),process.exit(1)),e.appVersion){let a=S(e.appVersion);a&&(h.cancel(a),process.exit(1))}await k({projectName:e.name,projectNamePascal:j(e.name),projectNameSnake:v(e.name),directory:e.directory??`./${e.name}`,githubUser:e.githubUser??"your-github-username",identifier:e.identifier??`com.${e.name}.app`,version:e.appVersion??w,installDeps:e.install??!0})}else{let t=await F(e.directory);await k(t)}});ee.parse();
package/package.json CHANGED
@@ -1,61 +1,67 @@
1
- {
2
- "name": "@tntstack/create-app",
3
- "version": "0.1.3",
4
- "description": "Scaffolding CLI for TNT Stack",
5
- "license": "GPL-3.0",
6
- "author": "odest",
7
- "keywords": [
8
- "tntstack",
9
- "tauri",
10
- "nextjs",
11
- "turborepo",
12
- "scaffold",
13
- "create",
14
- "cli",
15
- "monorepo",
16
- "template"
17
- ],
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/odest/tntstack.git",
21
- "directory": "packages/cli"
22
- },
23
- "bugs": {
24
- "url": "https://github.com/odest/tntstack/issues"
25
- },
26
- "homepage": "https://tnt.odest.tech",
27
- "type": "module",
28
- "files": [
29
- "dist"
30
- ],
31
- "bin": {
32
- "tntstack": "./dist/index.js"
33
- },
34
- "engines": {
35
- "node": ">=18"
36
- },
37
- "scripts": {
38
- "build": "tsup",
39
- "dev": "tsup --watch",
40
- "start": "node ./dist/index.js",
41
- "lint": "eslint .",
42
- "clean": "rm -rf dist"
43
- },
44
- "dependencies": {
45
- "@clack/prompts": "^1.1.0",
46
- "commander": "^14.0.3",
47
- "execa": "^9.6.1",
48
- "fs-extra": "^11.3.4",
49
- "giget": "^3.1.2",
50
- "picocolors": "^1.0.0"
51
- },
52
- "devDependencies": {
53
- "@types/fs-extra": "^11.0.4",
54
- "@types/node": "^20.0.0",
55
- "@workspace/eslint-config": "workspace:*",
56
- "@workspace/typescript-config": "workspace:*",
57
- "eslint": "^9.39.4",
58
- "tsup": "^8.0.2",
59
- "typescript": "^5.3.3"
60
- }
61
- }
1
+ {
2
+ "name": "@tntstack/create-app",
3
+ "version": "0.1.7",
4
+ "description": "Scaffolding CLI for TNT Stack",
5
+ "license": "MIT",
6
+ "author": "odest",
7
+ "publishConfig": {
8
+ "access": "public",
9
+ "registry": "https://registry.npmjs.org/"
10
+ },
11
+ "keywords": [
12
+ "tntstack",
13
+ "tauri",
14
+ "nextjs",
15
+ "turborepo",
16
+ "scaffold",
17
+ "create",
18
+ "cli",
19
+ "monorepo",
20
+ "template"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/odest/tntstack.git",
25
+ "directory": "packages/cli"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/odest/tntstack/issues"
29
+ },
30
+ "homepage": "https://tnt.odest.tech",
31
+ "type": "module",
32
+ "files": [
33
+ "dist"
34
+ ],
35
+ "bin": {
36
+ "tntstack": "./dist/index.js"
37
+ },
38
+ "engines": {
39
+ "node": ">=18"
40
+ },
41
+ "dependencies": {
42
+ "@clack/prompts": "^1.1.0",
43
+ "commander": "^14.0.3",
44
+ "execa": "^9.6.1",
45
+ "fs-extra": "^11.3.4",
46
+ "giget": "^3.1.2",
47
+ "picocolors": "^1.0.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/fs-extra": "^11.0.4",
51
+ "@types/node": "^20.0.0",
52
+ "eslint": "^9.39.4",
53
+ "tsup": "^8.0.2",
54
+ "typescript": "~5.9.3",
55
+ "@workspace/eslint-config": "1.0.0",
56
+ "@workspace/typescript-config": "1.0.0"
57
+ },
58
+ "scripts": {
59
+ "build": "tsup",
60
+ "dev": "tsup --watch",
61
+ "start": "node ./dist/index.js",
62
+ "lint": "eslint .",
63
+ "lint:fix": "eslint . --fix",
64
+ "check-types": "tsc --noEmit",
65
+ "clean": "rm -rf dist"
66
+ }
67
+ }