create-conformal 0.1.7 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-conformal",
3
- "version": "0.1.7",
3
+ "version": "0.2.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",
package/package.json.bak CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-conformal",
3
- "version": "0.1.7",
3
+ "version": "0.2.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",
package/src/config.ts CHANGED
@@ -18,13 +18,23 @@ type ConfigMetadata = {
18
18
 
19
19
  export const toEnv = (
20
20
  config: Config,
21
- { skipTodo } = { skipTodo: false },
21
+ {
22
+ skipTodo,
23
+ component_crate_version,
24
+ vst_crate_version,
25
+ }: {
26
+ skipTodo?: boolean;
27
+ component_crate_version: string;
28
+ vst_crate_version: string;
29
+ },
22
30
  ): Record<string, string> => ({
23
31
  ...config,
24
32
  class_id: uuidHex(),
25
33
  edit_class_id: uuidHex(),
26
34
  gitignore: ".gitignore",
27
- task_marker: skipTodo ? "DONE" : "TOD" + "O",
35
+ component_crate_version,
36
+ vst_crate_version,
37
+ task_marker: (skipTodo ?? false) ? "DONE" : "TOD" + "O",
28
38
  });
29
39
 
30
40
  const metadatas: ConfigMetadata[] = [
package/src/index.ts CHANGED
@@ -7,10 +7,21 @@ import { $ } from "bun";
7
7
 
8
8
  const config = await getConfig();
9
9
  const dest = config.proj_slug;
10
+
11
+ // Update the rust versions by grabbing our own package.json,
12
+ // This is valid because we version all crates and packages together.
13
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
14
+ const version: string =
15
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
16
+ (await Bun.file(path.join(__dirname, "..", "package.json")).json()).version;
17
+
10
18
  await stampTemplate(
11
19
  dest,
12
20
  path.join(path.dirname(import.meta.path), "..", "template"),
13
- toEnv(config),
21
+ toEnv(config, {
22
+ component_crate_version: `"${version}"`,
23
+ vst_crate_version: `"${version}"`,
24
+ }),
14
25
  );
15
26
 
16
27
  await $`git init`.cwd(dest);
@@ -48,7 +48,11 @@ describe("create-conformal template", () => {
48
48
  await stampTemplate(
49
49
  dest,
50
50
  path.join(workspacePath, "web", "create", "template"),
51
- toEnv(TEST_CONFIG, { skipTodo: true }),
51
+ toEnv(TEST_CONFIG, {
52
+ skipTodo: true,
53
+ component_crate_version: `{ path = "${path.join(workspacePath, "rust", "component")}" }`,
54
+ vst_crate_version: `{ path = "${path.join(workspacePath, "rust", "vst-wrapper")}" }`,
55
+ }),
52
56
  );
53
57
  await $`git init`.cwd(dest);
54
58
 
@@ -40,8 +40,8 @@
40
40
  "react-dom": "^18.2.0",
41
41
  "typescript": "^5.4.5",
42
42
  "vite": "^5.2.9",
43
- "@conformal/scripts": "^0.1.7",
44
- "@conformal/plugin": "^0.1.7",
43
+ "@conformal/scripts": "^0.2.0",
44
+ "@conformal/plugin": "^0.2.0",
45
45
  "rollup-plugin-license": "^3.4.0"
46
46
  }
47
47
  }
@@ -5,4 +5,4 @@ rust-version = "1.79.0"
5
5
  publish = false
6
6
 
7
7
  [dependencies]
8
- conformal_component = "0.1.0"
8
+ conformal_component = {{{component_crate_version}}}
@@ -34,7 +34,7 @@ const PARAMETERS: [InfoRef<'static, &'static str>; 2] = [
34
34
  type_specific: TypeSpecificInfoRef::Numeric {
35
35
  default: 100.,
36
36
  valid_range: 0f32..=100.,
37
- units: "%",
37
+ units: Some("%"),
38
38
  },
39
39
  },
40
40
  ];
@@ -8,6 +8,6 @@ publish = false
8
8
  crate-type = ["cdylib"]
9
9
 
10
10
  [dependencies]
11
- conformal_vst_wrapper = "0.1.0"
11
+ conformal_vst_wrapper = {{{vst_crate_version}}}
12
12
  vst3 = "0.1.2"
13
13
  {{plug_slug}}_component = { path = "../component" }
@@ -24,6 +24,14 @@ module.exports = {
24
24
  },
25
25
  ],
26
26
  "@typescript-eslint/no-non-null-assertion": "off",
27
+ "@typescript-eslint/restrict-template-expressions": [
28
+ "error",
29
+ { allowNumber: true },
30
+ ],
31
+ "@typescript-eslint/no-unnecessary-condition": [
32
+ "error",
33
+ { allowConstantLoopConditions: true },
34
+ ],
27
35
  "react-refresh/only-export-components": [
28
36
  "warn",
29
37
  { allowConstantExport: true },