newcandies 0.1.16 → 0.1.18

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 (2) hide show
  1. package/dist/index.js +21 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -140,10 +140,20 @@ async function main() {
140
140
  const templateAppPath = path.join(__dirname, "..", "templates", selectedItem.path, "app.json");
141
141
  if (await fs.pathExists(templatePkgPath)) {
142
142
  const tmplPkg = await fs.readJSON(templatePkgPath);
143
- basePkg.dependencies = { ...basePkg.dependencies, ...tmplPkg.dependencies };
144
- basePkg.devDependencies = { ...basePkg.devDependencies, ...tmplPkg.devDependencies };
145
- basePkg.scripts = { ...basePkg.scripts, ...tmplPkg.scripts };
146
- await fs.writeJSON(path.join(dest, "package.json"), basePkg, { spaces: 2 });
143
+ const isFullPackageJson = tmplPkg.scripts || tmplPkg.main || tmplPkg.version;
144
+ if (isFullPackageJson) {
145
+ const finalPkg = {
146
+ ...tmplPkg,
147
+ dependencies: { ...basePkg.dependencies, ...tmplPkg.dependencies },
148
+ devDependencies: { ...basePkg.devDependencies, ...tmplPkg.devDependencies }
149
+ };
150
+ await fs.writeJSON(path.join(dest, "package.json"), finalPkg, { spaces: 2 });
151
+ } else {
152
+ basePkg.dependencies = { ...basePkg.dependencies, ...tmplPkg.dependencies };
153
+ basePkg.devDependencies = { ...basePkg.devDependencies, ...tmplPkg.devDependencies };
154
+ basePkg.scripts = { ...basePkg.scripts, ...tmplPkg.scripts };
155
+ await fs.writeJSON(path.join(dest, "package.json"), basePkg, { spaces: 2 });
156
+ }
147
157
  }
148
158
  if (await fs.pathExists(templateAppPath) && baseApp) {
149
159
  const tmplApp = await fs.readJSON(templateAppPath);
@@ -197,8 +207,13 @@ async function main() {
197
207
  }
198
208
  async function installDeps(pm, cwd) {
199
209
  const cmd = pm === "bun" ? "bun" : pm;
200
- const args = pm === "bun" ? ["install"] : ["install"];
201
- await execa(cmd, args, { cwd, stdio: "inherit" });
210
+ let args = ["install"];
211
+ if (pm === "npm") {
212
+ args.push("--no-audit", "--no-fund", "--loglevel=error");
213
+ } else if (pm === "pnpm") {
214
+ args.push("--no-optional");
215
+ }
216
+ await execa(cmd, args, { cwd, stdio: "pipe" });
202
217
  }
203
218
  main().catch((e) => {
204
219
  p.log.error(e?.message ?? String(e));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newcandies",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Scaffold Expo Router + Uniwind React Native apps with layered templates.",
5
5
  "type": "module",
6
6
  "bin": {