create-conformal 0.3.4 → 0.4.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # create-conformal
2
+
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 07e7800: Default to Rust 2024 edition
8
+ - 07e7800: Use workspace to control edition
9
+
10
+ ### Patch Changes
11
+
12
+ - 07e7800: Lock rust version in bootstrap github action
13
+ - Updated dependencies [07e7800]
14
+ - Updated dependencies [07e7800]
15
+ - @conformal/create-plugin@0.4.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-conformal",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "Project generator script for conformal projects",
5
5
  "homepage": "https://russellmcc.github.io/conformal",
6
6
  "bugs": "https://github.com/russellmcc/conformal/issues",
@@ -14,8 +14,8 @@
14
14
  "bin": "./src/index.ts",
15
15
  "type": "module",
16
16
  "dependencies": {
17
- "@conformal/stamp": "^0.3.4",
18
- "@conformal/create-plugin": "^0.3.4",
17
+ "@conformal/stamp": "workspace:^0.3.5",
18
+ "@conformal/create-plugin": "workspace:^0.4.0",
19
19
  "@commander-js/extra-typings": "^12.1.0",
20
20
  "commander": "^12.1.0"
21
21
  }
package/package.json.bak CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-conformal",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "Project generator script for conformal projects",
5
5
  "homepage": "https://russellmcc.github.io/conformal",
6
6
  "bugs": "https://github.com/russellmcc/conformal/issues",
@@ -14,8 +14,8 @@
14
14
  "bin": "./src/index.ts",
15
15
  "type": "module",
16
16
  "dependencies": {
17
- "@conformal/stamp": "^0.3.4",
18
- "@conformal/create-plugin": "^0.3.4",
17
+ "@conformal/stamp": "workspace:^0.3.5",
18
+ "@conformal/create-plugin": "workspace:^0.4.0",
19
19
  "@commander-js/extra-typings": "^12.1.0",
20
20
  "commander": "^12.1.0"
21
21
  }
package/src/config.ts CHANGED
@@ -2,7 +2,6 @@ import { ConfigMetadata, stampTemplate } from "@conformal/stamp";
2
2
  import {
3
3
  Config as PlugConfig,
4
4
  metadatas as plugMetadatas,
5
- toEnv,
6
5
  toTemplate,
7
6
  postBuild as plugPostBuild,
8
7
  } from "@conformal/create-plugin";
@@ -23,8 +22,11 @@ export const metadatas: Record<keyof Config, ConfigMetadata> = {
23
22
  },
24
23
  };
25
24
 
26
- export const postBuild = async (config: Config, root?: string) => {
27
- const env = await toEnv(config);
25
+ export const postBuild = async (
26
+ config: Config,
27
+ env: Record<string, string>,
28
+ root?: string,
29
+ ) => {
28
30
  const template = await toTemplate(config);
29
31
  const dest =
30
32
  root === undefined ? config.proj_slug : path.join(root, config.proj_slug);
@@ -34,8 +34,13 @@ describe("create-conformal template", () => {
34
34
  const rewireDeps = async (dest: string) => {
35
35
  // Note we use perl as a sed replacement because of https://github.com/oven-sh/bun/issues/13197,
36
36
  // which makes sed unusable on macOS.
37
- const perl_command = `s!"\\@conformal/([^"]+)": "workspace:\\*"!"\\@conformal/$1": "file://${tmpDir}/conformal-$1-0.0.0.tgz"!`;
37
+ const perl_command = `s!"\\@conformal/([^"]+)": "[^"]+"!"\\@conformal/$1": "file://${tmpDir}/conformal-$1-0.0.0.tgz"!`;
38
38
  await $`perl -pi -e ${perl_command} package.json`.cwd(dest);
39
+
40
+ // Replace the version with 0.0.0
41
+ await $`perl -pi -e 's!"version": "[^"]+"!"version": "0.0.0"!' package.json`.cwd(
42
+ dest,
43
+ );
39
44
  };
40
45
 
41
46
  // Note that bun skips dependencies when installing packages from local paths :'(,
@@ -51,7 +56,17 @@ describe("create-conformal template", () => {
51
56
  await $`npm pack --pack-destination=${tmpDir}`.cwd(
52
57
  path.join(workspacePath, "web", dep),
53
58
  );
54
- const tgzPath = path.join(tmpDir, `conformal-${dep}-0.0.0.tgz`);
59
+ const tgzGlob = new Bun.Glob(`conformal-${dep}-*.tgz`);
60
+ let tgzPath: string | undefined;
61
+ for await (const tgzPathCandidate of tgzGlob.scan(tmpDir)) {
62
+ if (tgzPath !== undefined) {
63
+ throw new Error(`Found multiple tarballs for ${dep}`);
64
+ }
65
+ tgzPath = path.join(tmpDir, tgzPathCandidate);
66
+ }
67
+ if (tgzPath === undefined) {
68
+ throw new Error(`No tarball found for ${dep}`);
69
+ }
55
70
  expect(Bun.file(tgzPath).exists()).resolves.toBe(true);
56
71
 
57
72
  // Extract the tarball to a sub-directory of tmpDir
@@ -83,19 +98,25 @@ describe("create-conformal template", () => {
83
98
  await unlink(tgzPath);
84
99
  // Re-pack the tarball
85
100
  await $`npm pack --pack-destination=${tmpDir}`.cwd(extractDir);
86
- expect(Bun.file(tgzPath).exists()).resolves.toBe(true);
101
+
102
+ const rewiredTgzPath = path.join(
103
+ tmpDir,
104
+ `conformal-${dep}-0.0.0.tgz`,
105
+ );
106
+ expect(Bun.file(rewiredTgzPath).exists()).resolves.toBe(true);
87
107
 
88
108
  await rm(extractDir, { recursive: true });
89
109
  }
90
110
 
91
111
  // stamp the template
92
112
  const dest = path.join(tmpDir, TEST_CONFIG.proj_slug);
113
+ const env = await toEnv(TEST_CONFIG, { rustVersionMode: "mock" });
93
114
  await stampTemplate(
94
115
  dest,
95
116
  path.join(workspacePath, "web", "create", "template"),
96
- await toEnv(TEST_CONFIG),
117
+ env,
97
118
  );
98
- await postBuild(TEST_CONFIG, tmpDir);
119
+ await postBuild(TEST_CONFIG, env, tmpDir);
99
120
 
100
121
  await rewireDeps(dest);
101
122
 
@@ -116,7 +137,7 @@ describe("create-conformal template", () => {
116
137
  const createDependencies = ["component", "vst_wrapper", "poly"];
117
138
  for (const dep of createDependencies) {
118
139
  const crateVersion = `{ path = "${path.join(workspacePath, "rust", dep.replace("_", "-"))}" }`;
119
- await $`find rust -type f -exec perl -pi -e 's!conformal_${dep} = "0.0.0"!conformal_${dep} = ${crateVersion}!' {} +`.cwd(
140
+ await $`find rust -type f -exec perl -pi -e 's!conformal_${dep} = "[^"]+"!conformal_${dep} = ${crateVersion}!' {} +`.cwd(
120
141
  dest,
121
142
  );
122
143
  }
@@ -7,5 +7,5 @@ runs:
7
7
  shell: bash
8
8
  - run: bun install --frozen-lockfile
9
9
  shell: bash
10
- - run: bun run bootstrap
10
+ - run: bun run bootstrap --rust-version 1.85.0
11
11
  shell: bash
@@ -3,7 +3,8 @@ resolver = "2"
3
3
  members = []
4
4
 
5
5
  [workspace.package]
6
- rust-version = "1.84.1"
6
+ rust-version = "1.85.0"
7
+ edition = "2024"
7
8
 
8
9
  [workspace.lints.rust]
9
10
  nonstandard_style = "warn"
@@ -31,7 +31,7 @@
31
31
  "@vitejs/plugin-react-swc": "^3.6.0",
32
32
  "@types/react": "^18.2.79",
33
33
  "@types/react-dom": "^18.2.25",
34
- "eslint": "^8.57.0",
34
+ "eslint": "^8.57.1",
35
35
  "eslint-plugin-prefer-arrow-functions": "^3.3.2",
36
36
  "eslint-plugin-react": "^7.34.1",
37
37
  "eslint-plugin-react-hooks": "^4.6.0",
@@ -41,8 +41,8 @@
41
41
  "react-dom": "^18.2.0",
42
42
  "typescript": "^5.4.5",
43
43
  "vite": "^5.2.9",
44
- "@conformal/scripts": "^0.3.4",
45
- "@conformal/plugin": "^0.3.4",
44
+ "@conformal/scripts": "^0.3.5",
45
+ "@conformal/plugin": "^0.3.5",
46
46
  "rollup-plugin-license": "^3.4.0"
47
47
  }
48
48
  }