create-universal
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -1,6 +0,3 @@ | ||
export default function app({ name, options, }?: { | ||
export default function app({ name, }?: { | ||
name?: string; | ||
options?: { | ||
gluestack?: boolean; | ||
}; | ||
}): Promise<void>; |
@@ -39,6 +39,5 @@ import { execSync as nodeExecSync, } from 'child_process'; | ||
} | ||
export default async function app({ name, options, } = {}) { | ||
export default async function app({ name, } = {}) { | ||
const isYarn = process.env.npm_config_user_agent?.includes('yarn'); | ||
let appName = name; | ||
const gluestack = options?.gluestack ?? false; | ||
if (!name) { | ||
@@ -125,31 +124,2 @@ const rl = createInterface({ input: stdin, output: stdout }); | ||
success('Dependencies were installed.'); | ||
if (gluestack) { | ||
log('Installing gluestack...'); | ||
try { | ||
execSync('npx gluestack-ui@latest init'); | ||
} | ||
catch { | ||
console.error('An error occurred while installing gluestack.'); | ||
exit(1); | ||
} | ||
commit({ | ||
body: `Generated by ${packageName} ${packageVersion}`, | ||
message: 'Install gluestack', | ||
}); | ||
success('Gluestack was installed.'); | ||
log('Adding gluestack components...'); | ||
// Add all available gluestack components | ||
try { | ||
execSync('npx gluestack-ui@latest add --all'); | ||
} | ||
catch { | ||
console.error('An error occurred while adding gluestack components.'); | ||
exit(1); | ||
} | ||
commit({ | ||
body: `Generated by ${packageName} ${packageVersion}`, | ||
message: 'Add all available gluestack components', | ||
}); | ||
success('GlueStack components were added.'); | ||
} | ||
log('Copying template files...'); | ||
@@ -185,17 +155,4 @@ // Overlay template files | ||
success('Files were formatted.'); | ||
// Apply patch | ||
try { | ||
const patchFilePath = resolve(dirname(fileURLToPath(import.meta.url)), 'patches', 'fix-gluestack-import.patch'); | ||
execSync(`git apply "${patchFilePath}"`); | ||
} | ||
catch { | ||
console.error('An error occurred while applying gluestack import patch.'); | ||
} | ||
commit({ | ||
body: `Generated by ${packageName} ${packageVersion}`, | ||
message: 'Apply gluestack import patch', | ||
}); | ||
success('Gluestack import patch was applied.'); | ||
console.log(`\n🎉 Project created in ${appName}! Run:`); | ||
console.log(`cd ${appName} && ${isYarn ? 'yarn' : 'npm'} start`); | ||
} |
@@ -7,2 +7,2 @@ #!/usr/bin/env node | ||
const main = (await import('./index.js')).default; | ||
main(); | ||
await main(); |
import { execSync } from 'child_process'; | ||
import { readFileSync, writeFileSync } from 'fs'; | ||
import { resolve } from 'path'; | ||
// @ts-ignore: Ignore that this is outside rootDir (since it'll exist in build) | ||
import packageJson from '../package.json' with { type: 'json' }; | ||
@@ -6,0 +5,0 @@ export const packageVersion = packageJson.version; |
@@ -1,6 +0,5 @@ | ||
import { Command } from '@commander-js/extra-typings'; | ||
import { program } from '@commander-js/extra-typings'; | ||
import app from './app.js'; | ||
import { packageDescription, packageVersion } from './helpers.js'; | ||
export default async function main() { | ||
const program = new Command(); | ||
program | ||
@@ -10,9 +9,6 @@ .name('npm create universal') | ||
.description(packageDescription); | ||
program | ||
.command('app [name]') | ||
.option('--gluestack', 'Include gluestack-ui and components') | ||
.action((name, options) => { | ||
app({ name, options }); | ||
program.command('app [name]').action(async (name) => { | ||
await app({ name }); | ||
}); | ||
await program.parseAsync(process.argv); | ||
} |
{ | ||
"name": "create-universal", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Cross-platform Expo app generator (iOS/Android/web) with TypeScript, formatting, and gluestack/tailwind", | ||
@@ -20,19 +20,18 @@ "homepage": "https://github.com/vine77/create-universal", | ||
"prepublishOnly": "npm run build", | ||
"lint": "eslint . --ignore-path .gitignore", | ||
"format": "eslint . --fix --ignore-path .gitignore" | ||
"lint": "eslint .", | ||
"format": "eslint . --fix" | ||
}, | ||
"dependencies": { | ||
"commander": "^13.0.0", | ||
"suppress-experimental-warnings": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.8.10", | ||
"eslint": "^8.52.0", | ||
"eslint-config-universe": "^13.0.0", | ||
"@commander-js/extra-typings": "^13.0.0", | ||
"@types/node": "^22.10.2", | ||
"eslint": "^8.57.1", | ||
"eslint-config-universe": "^14.0.0", | ||
"eslint-plugin-perfectionist": "^2.11.0", | ||
"prettier": "^3.0.3", | ||
"prettier": "^3.4.2", | ||
"typescript": "^5.7.2" | ||
}, | ||
"dependencies": { | ||
"@commander-js/extra-typings": "^11.1.0", | ||
"commander": "^11.1.0", | ||
"hygen": "^6.2.11", | ||
"suppress-experimental-warnings": "^1.1.17" | ||
} | ||
} |
2
18926
7
20
385
+ Addedcommander@13.1.0(transitive)
+ Addedsuppress-experimental-warnings@2.0.0(transitive)
- Removed@commander-js/extra-typings@^11.1.0
- Removedhygen@^6.2.11
- Removed@commander-js/extra-typings@11.1.0(transitive)
- Removed@types/node@17.0.45(transitive)
- Removedansi-colors@4.1.3(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedargparse@1.0.10(transitive)
- Removedasync@3.2.6(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbl@4.1.0(transitive)
- Removedbrace-expansion@1.1.112.0.1(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedcamel-case@3.0.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedchange-case@3.1.0(transitive)
- Removedcli-cursor@3.1.0(transitive)
- Removedcli-spinners@2.9.2(transitive)
- Removedclone@1.0.4(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcommander@11.1.0(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconstant-case@2.0.0(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddefaults@1.0.4(transitive)
- Removeddegit@2.8.4(transitive)
- Removeddot-case@2.1.1(transitive)
- Removedejs@3.1.10(transitive)
- Removedenquirer@2.4.1(transitive)
- Removedesprima@4.0.1(transitive)
- Removedexeca@5.1.1(transitive)
- Removedfilelist@1.0.4(transitive)
- Removedfront-matter@4.0.2(transitive)
- Removedfs-extra@10.1.0(transitive)
- Removedget-stream@6.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedheader-case@1.0.1(transitive)
- Removedhuman-signals@2.1.0(transitive)
- Removedhygen@6.2.11(transitive)
- Removedieee754@1.2.1(transitive)
- Removedignore-walk@4.0.1(transitive)
- Removedinflection@1.13.4(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-interactive@1.0.0(transitive)
- Removedis-lower-case@1.1.3(transitive)
- Removedis-stream@2.0.1(transitive)
- Removedis-unicode-supported@0.1.0(transitive)
- Removedis-upper-case@1.1.2(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjake@10.9.2(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedjsonfile@6.1.0(transitive)
- Removedlog-symbols@4.1.0(transitive)
- Removedlower-case@1.1.4(transitive)
- Removedlower-case-first@1.0.2(transitive)
- Removedmerge-stream@2.0.0(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removedminimatch@3.1.25.1.6(transitive)
- Removedms@2.1.3(transitive)
- Removedno-case@2.3.2(transitive)
- Removednpm-run-path@4.0.1(transitive)
- Removedonetime@5.1.2(transitive)
- Removedora@5.4.1(transitive)
- Removedparam-case@2.1.1(transitive)
- Removedpascal-case@2.0.1(transitive)
- Removedpath-case@2.1.1(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedrestore-cursor@3.1.0(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsentence-case@2.1.1(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsnake-case@2.1.0(transitive)
- Removedsprintf-js@1.0.3(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedstrip-final-newline@2.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedsuppress-experimental-warnings@1.1.17(transitive)
- Removedswap-case@1.1.2(transitive)
- Removedtitle-case@2.1.1(transitive)
- Removeduniversalify@2.0.1(transitive)
- Removedupper-case@1.1.3(transitive)
- Removedupper-case-first@1.1.2(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwcwidth@1.0.1(transitive)
- Removedwhich@2.0.2(transitive)
- Removedyargs-parser@21.1.1(transitive)
Updatedcommander@^13.0.0