newcandies 0.1.16 → 0.1.17

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 +14 -4
  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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newcandies",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Scaffold Expo Router + Uniwind React Native apps with layered templates.",
5
5
  "type": "module",
6
6
  "bin": {