@jxsuite/create 1.5.4 → 1.5.5

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.
package/generate.ts CHANGED
@@ -12,6 +12,7 @@ import type { TemplateId } from "./templates";
12
12
  import type { JsonObject } from "./scaffold";
13
13
 
14
14
  import TEMPLATE_VERSIONS from "./template-versions.json";
15
+ import { PROJECT_FILE_NAME, serializeProjectFile } from "@jxsuite/schema/project-file";
15
16
 
16
17
  const __dirname = import.meta.dirname;
17
18
  const TEMPLATE_DIR = join(__dirname, "template");
@@ -199,7 +200,7 @@ async function populateProject(destPath: string, opts: ProjectOptions) {
199
200
  const packageJson = buildPackageJson({ adapter, description, name });
200
201
 
201
202
  const writes = [
202
- writeFile(join(destPath, "project.json"), `${JSON.stringify(projectJson, null, "\t")}\n`),
203
+ writeFile(join(destPath, PROJECT_FILE_NAME), serializeProjectFile(projectJson, null)),
203
204
  writeFile(join(destPath, "package.json"), `${JSON.stringify(packageJson, null, " ")}\n`),
204
205
  cp(join(TEMPLATE_DIR, "gitignore"), join(destPath, ".gitignore")),
205
206
  cp(join(TEMPLATE_DIR, "layouts"), join(destPath, "layouts"), { recursive: true }),
@@ -273,8 +274,9 @@ async function scaffoldFromStarter(
273
274
 
274
275
  // Re-stamp project.json with the new project's identity, keeping the starter's design tokens,
275
276
  // Content types, image pipeline, and head.
276
- const projectPath = join(destPath, "project.json");
277
- const project = parseJson(await readFile(projectPath, "utf8"));
277
+ const projectPath = join(destPath, PROJECT_FILE_NAME);
278
+ const starterText = await readFile(projectPath, "utf8");
279
+ const project = parseJson(starterText);
278
280
  if (!isJsonObject(project)) {
279
281
  throw new TypeError(`Starter "${starter}" has a project.json that is not a JSON object`);
280
282
  }
@@ -291,7 +293,7 @@ async function scaffoldFromStarter(
291
293
  if (design) {
292
294
  applyDesign(project, design, { starter: true });
293
295
  }
294
- await writeFile(projectPath, `${JSON.stringify(project, null, "\t")}\n`);
296
+ await writeFile(projectPath, serializeProjectFile(project, starterText));
295
297
 
296
298
  // Rebuild package.json so scaffolded projects get current dep ranges and scripts regardless of
297
299
  // What the in-repo starter pinned.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/create",
3
- "version": "1.5.4",
3
+ "version": "1.5.5",
4
4
  "description": "Scaffold a new Jx project",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,6 +37,7 @@
37
37
  "test:coverage": "bun test --isolate --coverage"
38
38
  },
39
39
  "dependencies": {
40
- "@jxsuite/starters": "^3.3.0"
40
+ "@jxsuite/schema": "^5.3.0",
41
+ "@jxsuite/starters": "^3.3.1"
41
42
  }
42
43
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "parser": "^4.3.0",
3
- "compiler": "^8.2.0",
4
- "runtime": "^6.1.0",
5
- "server": "^8.3.0"
2
+ "parser": "^4.3.1",
3
+ "compiler": "^8.3.0",
4
+ "runtime": "^6.2.0",
5
+ "server": "^8.4.0"
6
6
  }