create-projx 1.7.7 → 1.8.0

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.
@@ -8,8 +8,8 @@ import {
8
8
  matchesSkip,
9
9
  saveBaselineRef,
10
10
  writeTemplateToDir
11
- } from "./chunk-OH6QQNPO.js";
12
- import "./chunk-N66CVDEV.js";
11
+ } from "./chunk-NXIFRWTX.js";
12
+ import "./chunk-GZUJ235K.js";
13
13
  export {
14
14
  BASELINE_REF,
15
15
  applyTemplate,
@@ -395,17 +395,11 @@ async function writeProjxConfig(cwd, data) {
395
395
  if (!Array.isArray(out.skip)) out.skip = [];
396
396
  await writeFile(path, JSON.stringify(out, null, 2) + "\n");
397
397
  }
398
- var DEFAULT_ROOT_SKIP_PATTERNS = [
398
+ var INSTANCE_AWARE_SHARED = [
399
399
  "docker-compose.yml",
400
- "README.md",
401
- ".githooks/pre-commit",
402
400
  ".github/workflows/ci.yml",
403
- "scripts/ci-local.sh",
404
- "scripts/ci-runner-gc.sh",
405
- "scripts/check-bundle-size.sh",
406
- "scripts/setup.sh",
407
- "scripts/setup-docker.sh",
408
- "scripts/setup-ssl.sh"
401
+ ".githooks/pre-commit",
402
+ "scripts/setup.sh"
409
403
  ];
410
404
  var DEFAULT_COMPONENT_SKIP_PATTERNS = {
411
405
  fastapi: ["pyproject.toml"],
@@ -627,7 +621,7 @@ export {
627
621
  upsertComponentMarker,
628
622
  readProjxConfig,
629
623
  writeProjxConfig,
630
- DEFAULT_ROOT_SKIP_PATTERNS,
624
+ INSTANCE_AWARE_SHARED,
631
625
  DEFAULT_COMPONENT_SKIP_PATTERNS,
632
626
  discoverComponentPaths,
633
627
  discoverComponentsFromMarkers,
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  DEFAULT_COMPONENT_SKIP_PATTERNS,
3
- DEFAULT_ROOT_SKIP_PATTERNS,
4
3
  copyComponent,
5
4
  copyStaticFiles,
6
5
  readComponentMarker,
@@ -13,7 +12,7 @@ import {
13
12
  toSnake,
14
13
  upsertComponentMarker,
15
14
  writeProjxConfig
16
- } from "./chunk-N66CVDEV.js";
15
+ } from "./chunk-GZUJ235K.js";
17
16
 
18
17
  // src/baseline.ts
19
18
  import { existsSync, writeFileSync, unlinkSync } from "fs";
@@ -161,7 +160,7 @@ function generateVscodeSettings(vars) {
161
160
  // src/baseline.ts
162
161
  var BASELINE_REF = "refs/projx/baseline";
163
162
  async function migrateComponentMarkers(cwd, components, componentPaths, applyDefaults) {
164
- const { readComponentMarker: readComponentMarker2, writeComponentMarker } = await import("./utils-QQUKUZKQ.js");
163
+ const { readComponentMarker: readComponentMarker2, writeComponentMarker } = await import("./utils-NVIN3FSZ.js");
165
164
  for (const component of components) {
166
165
  const dir = componentPaths[component];
167
166
  const markerDir = join2(cwd, dir);
@@ -192,9 +191,7 @@ async function writeManagedProjx(cwd, version, vars, applyDefaults) {
192
191
  if (typeof vars.orm === "string" && !merged.orm) {
193
192
  merged.orm = vars.orm;
194
193
  }
195
- if (applyDefaults && !merged.defaultsApplied) {
196
- const userSkip = Array.isArray(merged.skip) ? merged.skip : [];
197
- merged.skip = [.../* @__PURE__ */ new Set([...userSkip, ...DEFAULT_ROOT_SKIP_PATTERNS])];
194
+ if (applyDefaults) {
198
195
  merged.defaultsApplied = true;
199
196
  }
200
197
  await writeProjxConfig(cwd, merged);
@@ -452,10 +449,8 @@ async function writeTemplateToDir(dest, repoDir, components, componentPaths, var
452
449
  }
453
450
  const hasBackend = components.includes("fastapi") || components.includes("fastify") || components.includes("express");
454
451
  const userSkip = rootSkip ?? [];
455
- const defaultRootSkip = applyDefaults ? DEFAULT_ROOT_SKIP_PATTERNS : [];
456
- const effectiveSkip = [.../* @__PURE__ */ new Set([...userSkip, ...defaultRootSkip])];
457
452
  const shouldWrite = (file) => {
458
- if (!matchesSkip(file, effectiveSkip)) return true;
453
+ if (!matchesSkip(file, userSkip)) return true;
459
454
  return !existsSync(join2(realCwd, file));
460
455
  };
461
456
  if (hasBackend || components.includes("frontend") || components.includes("admin-panel")) {
package/dist/index.js CHANGED
@@ -9,12 +9,12 @@ import {
9
9
  matchesSkip,
10
10
  saveBaselineRef,
11
11
  writeTemplateToDir
12
- } from "./chunk-OH6QQNPO.js";
12
+ } from "./chunk-NXIFRWTX.js";
13
13
  import {
14
14
  COMPONENTS,
15
15
  COMPONENT_MARKER,
16
- DEFAULT_ROOT_SKIP_PATTERNS,
17
16
  EXCLUDE,
17
+ INSTANCE_AWARE_SHARED,
18
18
  KNOWN_FEATURES,
19
19
  ORM_PROVIDERS,
20
20
  PACKAGE_MANAGERS,
@@ -37,7 +37,7 @@ import {
37
37
  toSnake,
38
38
  writeComponentMarker,
39
39
  writeProjxConfig
40
- } from "./chunk-N66CVDEV.js";
40
+ } from "./chunk-GZUJ235K.js";
41
41
 
42
42
  // src/index.ts
43
43
  import { existsSync as existsSync11 } from "fs";
@@ -903,7 +903,7 @@ function hasUncommittedChanges(cwd) {
903
903
  async function findPinnedFilesWithUpdates(cwd, repoDir, components, componentPaths, vars, version, componentSkips, rootSkip) {
904
904
  const { mkdtemp: mkdtemp2, rm: rm2, readFile: readFile8 } = await import("fs/promises");
905
905
  const { tmpdir: tmpdir2 } = await import("os");
906
- const { writeTemplateToDir: writeTemplateToDir2 } = await import("./baseline-DT3CWKOO.js");
906
+ const { writeTemplateToDir: writeTemplateToDir2 } = await import("./baseline-ACCRNHE4.js");
907
907
  const config = await readProjxConfig(cwd);
908
908
  const rootPinned = Array.isArray(config.skip) ? config.skip : [];
909
909
  const componentPinned = [];
@@ -1088,6 +1088,17 @@ import { copyFileSync as copyFileSync2, existsSync as existsSync4 } from "fs";
1088
1088
  import { readFile as readFile4 } from "fs/promises";
1089
1089
  import { join as join4 } from "path";
1090
1090
  import * as p4 from "@clack/prompts";
1091
+ function reportPinnedShared(cwd, rootSkip, wiringTarget) {
1092
+ const pinned = INSTANCE_AWARE_SHARED.filter(
1093
+ (f) => matchesSkip(f, rootSkip) && existsSync4(join4(cwd, f))
1094
+ );
1095
+ if (pinned.length === 0) return;
1096
+ p4.log.warn(
1097
+ `${pinned.length} shared file(s) are in .projx "skip" and were left untouched \u2014 wire ${wiringTarget} in by hand, or unpin then re-run add:`
1098
+ );
1099
+ for (const f of pinned) p4.log.info(` ${f}`);
1100
+ p4.log.info(`Unpin: npx create-projx unpin ${pinned.join(" ")}`);
1101
+ }
1091
1102
  async function add(cwd, newComponents, localRepo, skipInstall = false, customName, features) {
1092
1103
  p4.intro("projx add");
1093
1104
  const isLocal = !!localRepo;
@@ -1164,6 +1175,12 @@ async function add(cwd, newComponents, localRepo, skipInstall = false, customNam
1164
1175
  await readFile4(join4(repoDir, "cli/package.json"), "utf-8")
1165
1176
  );
1166
1177
  const version = pkg.version;
1178
+ const rootSkip = Array.isArray(config.skip) ? config.skip : [];
1179
+ const componentSkips = {};
1180
+ for (const inst of existingInstances) {
1181
+ const m = await readComponentMarker(join4(cwd, inst.path));
1182
+ if (m?.skip && m.skip.length > 0) componentSkips[inst.type] = m.skip;
1183
+ }
1167
1184
  const spinner6 = p4.spinner();
1168
1185
  spinner6.start("Adding components");
1169
1186
  await writeTemplateToDir(
@@ -1173,9 +1190,10 @@ async function add(cwd, newComponents, localRepo, skipInstall = false, customNam
1173
1190
  paths,
1174
1191
  vars,
1175
1192
  version,
1176
- { realCwd: cwd }
1193
+ { componentSkips, rootSkip, realCwd: cwd }
1177
1194
  );
1178
1195
  spinner6.stop("Components added.");
1196
+ reportPinnedShared(cwd, rootSkip, toAdd.join(", "));
1179
1197
  if (features && Object.keys(features).length > 0) {
1180
1198
  const featSpinner = p4.spinner();
1181
1199
  featSpinner.start("Applying features");
@@ -1246,14 +1264,7 @@ async function addInstance(cwd, type, customName, config, existing, localRepo, s
1246
1264
  await readFile4(join4(repoDir, "cli/package.json"), "utf-8")
1247
1265
  );
1248
1266
  const version = pkg.version;
1249
- const INSTANCE_AWARE_ROOT = /* @__PURE__ */ new Set([
1250
- ".github/workflows/ci.yml",
1251
- ".githooks/pre-commit",
1252
- "scripts/setup.sh",
1253
- "docker-compose.yml"
1254
- ]);
1255
- const rawSkip = Array.isArray(config.skip) ? config.skip : [];
1256
- const rootSkip = rawSkip.filter((p10) => !INSTANCE_AWARE_ROOT.has(p10));
1267
+ const rootSkip = Array.isArray(config.skip) ? config.skip : [];
1257
1268
  const componentSkips = {};
1258
1269
  for (const inst of existingInstances) {
1259
1270
  const m = await readComponentMarker(join4(cwd, inst.path));
@@ -1275,6 +1286,7 @@ async function addInstance(cwd, type, customName, config, existing, localRepo, s
1275
1286
  [newInstance]
1276
1287
  );
1277
1288
  spinner6.stop(`Scaffolded ${customName}/.`);
1289
+ reportPinnedShared(cwd, rootSkip, customName);
1278
1290
  if (result.status === "merged") {
1279
1291
  p4.log.success(
1280
1292
  `${result.mergedFiles?.length ?? 0} root file(s) merged cleanly.`
@@ -1553,7 +1565,7 @@ async function init(cwd, localRepo) {
1553
1565
  );
1554
1566
  let pm = "npm";
1555
1567
  if (hasJs) {
1556
- const detected2 = detectPackageManager(cwd);
1568
+ const detected2 = detectPackageManagerFromComponents(cwd, paths);
1557
1569
  if (detected2) {
1558
1570
  pm = detected2;
1559
1571
  p5.log.info(`Detected package manager: ${pm}`);
@@ -1660,7 +1672,7 @@ async function writeBareProjx(cwd, localRepo, isLocal, pm) {
1660
1672
  version: pkg.version,
1661
1673
  createdAt: today,
1662
1674
  updatedAt: today,
1663
- skip: [...DEFAULT_ROOT_SKIP_PATTERNS],
1675
+ skip: [],
1664
1676
  defaultsApplied: true
1665
1677
  };
1666
1678
  if (pm) config.packageManager = pm;
@@ -2,8 +2,8 @@ import {
2
2
  COMPONENTS,
3
3
  COMPONENT_MARKER,
4
4
  DEFAULT_COMPONENT_SKIP_PATTERNS,
5
- DEFAULT_ROOT_SKIP_PATTERNS,
6
5
  EXCLUDE,
6
+ INSTANCE_AWARE_SHARED,
7
7
  KNOWN_FEATURES,
8
8
  ORM_PROVIDERS,
9
9
  PACKAGE_MANAGERS,
@@ -36,13 +36,13 @@ import {
36
36
  upsertComponentMarker,
37
37
  writeComponentMarker,
38
38
  writeProjxConfig
39
- } from "./chunk-N66CVDEV.js";
39
+ } from "./chunk-GZUJ235K.js";
40
40
  export {
41
41
  COMPONENTS,
42
42
  COMPONENT_MARKER,
43
43
  DEFAULT_COMPONENT_SKIP_PATTERNS,
44
- DEFAULT_ROOT_SKIP_PATTERNS,
45
44
  EXCLUDE,
45
+ INSTANCE_AWARE_SHARED,
46
46
  KNOWN_FEATURES,
47
47
  ORM_PROVIDERS,
48
48
  PACKAGE_MANAGERS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-projx",
3
- "version": "1.7.7",
3
+ "version": "1.8.0",
4
4
  "description": "Scaffold production-grade fullstack projects in seconds. FastAPI, Fastify, Express, React, Flutter, Terraform — with auth, database, CI/CD, E2E tests, and Docker. One command, ready to deploy.",
5
5
  "type": "module",
6
6
  "bin": {