create-conformal 0.6.2 → 0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # create-conformal
2
2
 
3
+ ## 0.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 739063e: use isolated installs
8
+ - bf6b0e1: update template to eslint 9
9
+ - 34ed385: support react compiler and bump to react 19
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [739063e]
14
+ - Updated dependencies [bf6b0e1]
15
+ - Updated dependencies [34ed385]
16
+ - @conformal/create-plugin@0.8.0
17
+
18
+ ## 0.7.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 2b139f7: Support check-licenses script
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [2b139f7]
27
+ - @conformal/create-plugin@0.7.0
28
+
3
29
  ## 0.6.2
4
30
 
5
31
  ### Patch Changes
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from "eslint/config";
2
+ import config from "eslint-config-custom";
3
+
4
+ export default defineConfig([
5
+ config,
6
+ {
7
+ ignores: ["template/**"],
8
+ },
9
+ {
10
+ files: ["**/*.ts", "**/*.tsx"],
11
+ languageOptions: {
12
+ parserOptions: {
13
+ project: ["./tsconfig.json"],
14
+ tsconfigRootDir: import.meta.dirname,
15
+ },
16
+ },
17
+ },
18
+ ]);
package/package.json CHANGED
@@ -1,22 +1,26 @@
1
1
  {
2
+ "dependencies": {
3
+ "@conformal/stamp": "^0.3.5",
4
+ "@conformal/create-plugin": "^0.8.0",
5
+ "@commander-js/extra-typings": "^12.1.0",
6
+ "commander": "^12.1.0"
7
+ },
2
8
  "name": "create-conformal",
3
- "version": "0.6.2",
9
+ "version": "0.8.0",
4
10
  "description": "Project generator script for conformal projects",
5
11
  "homepage": "https://russellmcc.github.io/conformal",
6
12
  "bugs": "https://github.com/russellmcc/conformal/issues",
7
13
  "repository": "github:russellmcc/conformal",
8
14
  "license": "ISC",
9
15
  "scripts": {
10
- "lint": "tsc && eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
16
+ "lint": "tsc && eslint . --max-warnings 0",
11
17
  "check-format": "prettier -c .",
12
18
  "format": "prettier --write ."
13
19
  },
14
20
  "bin": "./src/index.ts",
15
21
  "type": "module",
16
- "dependencies": {
17
- "@conformal/stamp": "^0.3.5",
18
- "@conformal/create-plugin": "^0.6.0",
19
- "@commander-js/extra-typings": "^12.1.0",
20
- "commander": "^12.1.0"
22
+ "devDependencies": {
23
+ "tmp-promise": "catalog:",
24
+ "zod": "catalog:"
21
25
  }
22
26
  }
package/package.json.bak CHANGED
@@ -1,22 +1,27 @@
1
1
  {
2
+ "dependencies": {
3
+ "@conformal/stamp": "^0.3.5",
4
+ "@conformal/create-plugin": "^0.8.0",
5
+ "@commander-js/extra-typings": "^12.1.0",
6
+ "commander": "^12.1.0"
7
+ },
2
8
  "name": "create-conformal",
3
- "version": "0.6.2",
9
+ "version": "0.8.0",
4
10
  "description": "Project generator script for conformal projects",
5
11
  "homepage": "https://russellmcc.github.io/conformal",
6
12
  "bugs": "https://github.com/russellmcc/conformal/issues",
7
13
  "repository": "github:russellmcc/conformal",
8
14
  "license": "ISC",
9
15
  "scripts": {
10
- "lint": "tsc && eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
16
+ "lint": "tsc && eslint . --max-warnings 0",
11
17
  "check-format": "prettier -c .",
12
18
  "format": "prettier --write ."
13
19
  },
14
20
  "bin": "./src/index.ts",
15
21
  "type": "module",
16
- "dependencies": {
17
- "@conformal/stamp": "^0.3.5",
18
- "@conformal/create-plugin": "^0.6.0",
19
- "@commander-js/extra-typings": "^12.1.0",
20
- "commander": "^12.1.0"
22
+ "devDependencies": {
23
+ "tmp-promise": "catalog:",
24
+ "eslint-config-custom": "workspace:*",
25
+ "zod": "catalog:"
21
26
  }
22
- }
27
+ }
@@ -6,6 +6,7 @@ import { $ } from "bun";
6
6
  import { Config, postBuild } from "./config";
7
7
  import { stampTemplate } from "@conformal/stamp";
8
8
  import { toEnv } from "@conformal/create-plugin";
9
+ import { z } from "zod";
9
10
 
10
11
  const TEST_CONFIG: Config = {
11
12
  proj_slug: "test",
@@ -17,6 +18,22 @@ const TEST_CONFIG: Config = {
17
18
 
18
19
  const MINUTE = 60_000;
19
20
 
21
+ const packageJsonSchema = z
22
+ .object({
23
+ catalog: z.optional(z.record(z.string(), z.string())),
24
+ dependencies: z.optional(z.record(z.string(), z.string())),
25
+ devDependencies: z.optional(z.record(z.string(), z.string())),
26
+ scripts: z.optional(
27
+ z
28
+ .object({
29
+ prepack: z.optional(z.string()),
30
+ postpack: z.optional(z.string()),
31
+ })
32
+ .passthrough(),
33
+ ),
34
+ })
35
+ .passthrough();
36
+
20
37
  describe("create-conformal template", () => {
21
38
  test(
22
39
  "passes CI",
@@ -31,15 +48,53 @@ describe("create-conformal template", () => {
31
48
  "..",
32
49
  );
33
50
 
34
- const rewireDeps = async (dest: string) => {
35
- // Note we use perl as a sed replacement because of https://github.com/oven-sh/bun/issues/13197,
36
- // which makes sed unusable on macOS.
37
- const perl_command = `s!"\\@conformal/([^"]+)": "[^"]+"!"\\@conformal/$1": "file://${tmpDir}/conformal-$1-0.0.0.tgz"!`;
38
- await $`perl -pi -e ${perl_command} package.json`.cwd(dest);
51
+ type RewireDepsOptions = {
52
+ fixCatalog: boolean;
53
+ };
54
+ const rewireDeps = async (
55
+ dest: string,
56
+ { fixCatalog }: RewireDepsOptions = { fixCatalog: true },
57
+ ) => {
58
+ const rootPackageJson = packageJsonSchema.parse(
59
+ await Bun.file(`package.json`).json(),
60
+ );
39
61
 
40
- // Replace the version with 0.0.0
41
- await $`perl -pi -e 's!"version": "[^"]+"!"version": "0.0.0"!' package.json`.cwd(
42
- dest,
62
+ const packageJson = packageJsonSchema.parse(
63
+ await Bun.file(`${dest}/package.json`).json(),
64
+ );
65
+
66
+ packageJson.version = "0.0.0";
67
+
68
+ const cleanupDict = (dict: Record<string, string>) => {
69
+ for (const [key, version] of Object.entries(dict)) {
70
+ if (key.startsWith("@conformal/")) {
71
+ dict[key] =
72
+ `file://${tmpDir}/conformal-${key.split("/")[1]}-0.0.0.tgz`;
73
+ }
74
+ if (version === "catalog:" && fixCatalog) {
75
+ const catalogVersion = rootPackageJson.catalog?.[key];
76
+ if (!catalogVersion) {
77
+ throw new Error(
78
+ `Catalog dependency ${key} not found in root package.json`,
79
+ );
80
+ }
81
+ dict[key] = catalogVersion;
82
+ }
83
+ }
84
+ };
85
+ for (const dict of [
86
+ packageJson.dependencies,
87
+ packageJson.catalog,
88
+ packageJson.devDependencies,
89
+ ]) {
90
+ if (dict) {
91
+ cleanupDict(dict);
92
+ }
93
+ }
94
+
95
+ await Bun.write(
96
+ `${dest}/package.json`,
97
+ JSON.stringify(packageJson, null, 2),
43
98
  );
44
99
  };
45
100
 
@@ -76,18 +131,13 @@ describe("create-conformal template", () => {
76
131
  await rewireDeps(extractDir);
77
132
 
78
133
  // Remove any "prepack" and "postpack" scripts as these have already been run
79
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
80
- const packageJson = await Bun.file(
81
- `${extractDir}/package.json`,
82
- ).json();
83
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
134
+ const packageJson = packageJsonSchema.parse(
135
+ await Bun.file(`${extractDir}/package.json`).json(),
136
+ );
84
137
  if (packageJson.scripts?.prepack) {
85
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
86
138
  delete packageJson.scripts.prepack;
87
139
  }
88
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
89
140
  if (packageJson.scripts?.postpack) {
90
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
91
141
  delete packageJson.scripts.postpack;
92
142
  }
93
143
  await Bun.write(
@@ -118,12 +168,13 @@ describe("create-conformal template", () => {
118
168
  );
119
169
  await postBuild(TEST_CONFIG, env, tmpDir);
120
170
 
121
- await rewireDeps(dest);
171
+ // We want to use the catalog from the template
172
+ await rewireDeps(dest, { fixCatalog: false });
122
173
 
123
174
  await $`bun install`.cwd(dest);
124
175
 
125
176
  // Add a synth target
126
- await $`bun x conformal-scripts create-plugin --plug_type synth --plug_slug test_synth --vendor_name "Test Vendor" --plug_name "Test Synth"`.cwd(
177
+ await $`bun run create-plugin --plug_type synth --plug_slug test_synth --vendor_name "Test Vendor" --plug_name "Test Synth"`.cwd(
127
178
  dest,
128
179
  );
129
180
 
@@ -132,6 +183,9 @@ describe("create-conformal template", () => {
132
183
  dest,
133
184
  );
134
185
 
186
+ // We have to re-install after adding new packages, now that dependencies are isolated.
187
+ await $`bun install`.cwd(dest);
188
+
135
189
  // In CI, we will have a 0.0.0 version for the conformal crates.
136
190
  // Replace these with a link to the local crate
137
191
  const createDependencies = ["component", "vst_wrapper", "poly"];
@@ -10,6 +10,7 @@
10
10
  "check-lfs": "conformal-scripts check-lfs",
11
11
  "check-todo": "conformal-scripts check-todo",
12
12
  "check-format": "conformal-scripts check-format",
13
+ "check-licenses": "conformal-scripts check-licenses",
13
14
  "create-plugin": "conformal-scripts create-plugin",
14
15
  "format": "conformal-scripts format",
15
16
  "web-dev": "conformal-scripts web-script -s dev",
@@ -26,23 +27,29 @@
26
27
  },
27
28
  "devDependencies": {
28
29
  "@types/bun": "^1.2.22",
29
- "@typescript-eslint/eslint-plugin": "^8.28.0",
30
- "@typescript-eslint/parser": "^8.28.0",
31
- "@vitejs/plugin-react-swc": "^3.6.0",
32
- "@types/react": "^18.2.79",
33
- "@types/react-dom": "^18.2.25",
34
- "eslint": "^8.57.1",
35
- "eslint-plugin-prefer-arrow-functions": "^3.6.2",
36
- "eslint-plugin-react": "^7.37.4",
37
- "eslint-plugin-react-hooks": "^5.2.0",
38
- "eslint-plugin-react-refresh": "^0.4.19",
30
+ "eslint": "^9.39.1",
39
31
  "prettier": "^3.2.5",
40
- "react": "^18.2.0",
41
- "react-dom": "^18.2.0",
42
32
  "typescript": "^5.4.5",
43
- "vite": "^5.2.9",
44
33
  "@conformal/scripts": "^0.3.5",
34
+ "tsconfig": "workspace:*"
35
+ },
36
+ "catalog": {
45
37
  "@conformal/plugin": "^0.3.5",
46
- "rollup-plugin-license": "^3.4.0"
38
+ "rollup-plugin-license": "^3.4.0",
39
+ "react": "^19.2.0",
40
+ "react-dom": "^19.2.0",
41
+ "@types/react": "^19.2.0",
42
+ "@types/react-dom": "^19.2.0",
43
+ "eslint-plugin-react": "^7.37.5",
44
+ "eslint-plugin-react-hooks": "^7.0.1",
45
+ "eslint-plugin-react-refresh": "^0.4.24",
46
+ "eslint-plugin-prefer-arrow-functions": "^3.9.1",
47
+ "typescript-eslint": "^8.46.3",
48
+ "vite": "^5.2.9",
49
+ "jotai": "^2.14.0",
50
+ "globals": "^16.5.0",
51
+ "@eslint/js": "^9.39.1",
52
+ "@vitejs/plugin-react": "^5.1.0",
53
+ "babel-plugin-react-compiler": "^1.0.0"
47
54
  }
48
55
  }
@@ -0,0 +1,4 @@
1
+ import { defineConfig } from "eslint/config";
2
+ import config from "eslint-config-custom";
3
+
4
+ export default defineConfig([config]);
@@ -0,0 +1,81 @@
1
+ import { defineConfig } from "eslint/config";
2
+ import globals from "globals";
3
+ import js from "@eslint/js";
4
+ import ts from "typescript-eslint";
5
+ import reactHooks from "eslint-plugin-react-hooks";
6
+ import reactRefresh from "eslint-plugin-react-refresh";
7
+ import react from "eslint-plugin-react";
8
+ import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
9
+
10
+ export default defineConfig([
11
+ js.configs.recommended,
12
+ {
13
+ files: ["**/*.ts", "**/*.tsx"],
14
+ extends: [
15
+ ts.configs.recommended,
16
+ ts.configs.strictTypeChecked,
17
+ ts.configs.stylisticTypeChecked,
18
+ ],
19
+ rules: {
20
+ "@typescript-eslint/no-empty-function": "off",
21
+ "@typescript-eslint/no-unused-vars": [
22
+ "error",
23
+ {
24
+ argsIgnorePattern: "^_",
25
+ },
26
+ ],
27
+ "@typescript-eslint/no-non-null-assertion": "off",
28
+ "@typescript-eslint/restrict-template-expressions": [
29
+ "error",
30
+ { allowNumber: true },
31
+ ],
32
+ "@typescript-eslint/no-unnecessary-condition": [
33
+ "error",
34
+ { allowConstantLoopConditions: true },
35
+ ],
36
+ "@typescript-eslint/consistent-type-definitions": ["error", "type"],
37
+ },
38
+ },
39
+ react.configs.flat.recommended ?? [],
40
+ react.configs.flat["jsx-runtime"] ?? [],
41
+ reactHooks.configs.flat.recommended,
42
+ reactRefresh.configs.recommended,
43
+ preferArrowFunctions.configs.all,
44
+ {
45
+ ignores: ["dist"],
46
+ },
47
+ {
48
+ linterOptions: {
49
+ reportUnusedDisableDirectives: true,
50
+ },
51
+ rules: {
52
+ "react-refresh/only-export-components": [
53
+ "warn",
54
+ { allowConstantExport: true },
55
+ ],
56
+ "react-hooks/exhaustive-deps": "error",
57
+ "prefer-arrow-functions/prefer-arrow-functions": [
58
+ "error",
59
+ {
60
+ returnStyle: "implicit",
61
+ },
62
+ ],
63
+ "no-warning-comments": "error",
64
+ },
65
+ settings: {
66
+ react: {
67
+ version: "detect",
68
+ },
69
+ },
70
+ languageOptions: {
71
+ ecmaVersion: "latest",
72
+ globals: {
73
+ ...globals.browser,
74
+ __dirname: "readonly",
75
+ },
76
+ parserOptions: {
77
+ sourceType: "module",
78
+ },
79
+ },
80
+ },
81
+ ]);
@@ -1,5 +1,22 @@
1
1
  {
2
2
  "name": "eslint-config-custom",
3
- "main": "config.cjs",
4
- "private": true
3
+ "exports": {
4
+ ".": {
5
+ "default": "./index.mjs"
6
+ }
7
+ },
8
+ "type": "module",
9
+ "private": true,
10
+ "scripts": {
11
+ "lint": "eslint . --max-warnings 0"
12
+ },
13
+ "dependencies": {
14
+ "globals": "catalog:",
15
+ "@eslint/js": "catalog:",
16
+ "eslint-plugin-react": "catalog:",
17
+ "eslint-plugin-react-hooks": "catalog:",
18
+ "eslint-plugin-react-refresh": "catalog:",
19
+ "eslint-plugin-prefer-arrow-functions": "catalog:",
20
+ "typescript-eslint": "catalog:"
21
+ }
5
22
  }
package/.eslintrc.cjs DELETED
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ["eslint-config-custom"],
4
- parserOptions: {
5
- project: ["./tsconfig.json"],
6
- tsconfigRootDir: __dirname,
7
- },
8
- ignorePatterns: ["template/**"],
9
- };
@@ -1,2 +0,0 @@
1
- [install]
2
- linker = "hoisted"
@@ -1,54 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: { browser: true, es2020: true },
4
- extends: [
5
- "eslint:recommended",
6
- "plugin:@typescript-eslint/strict-type-checked",
7
- "plugin:@typescript-eslint/stylistic-type-checked",
8
- "plugin:react-hooks/recommended",
9
- "plugin:react/recommended",
10
- "plugin:react/jsx-runtime",
11
- ],
12
- ignorePatterns: ["dist", ".eslintrc.cjs"],
13
- parser: "@typescript-eslint/parser",
14
- parserOptions: {
15
- ecmaVersion: "latest",
16
- sourceType: "module",
17
- },
18
- plugins: ["react-refresh", "prefer-arrow-functions"],
19
- rules: {
20
- "@typescript-eslint/no-unused-vars": [
21
- "error",
22
- {
23
- argsIgnorePattern: "^_",
24
- },
25
- ],
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
- ],
35
- "react-refresh/only-export-components": [
36
- "warn",
37
- { allowConstantExport: true },
38
- ],
39
- "react-hooks/exhaustive-deps": "error",
40
- "prefer-arrow-functions/prefer-arrow-functions": [
41
- "error",
42
- {
43
- returnStyle: "implicit",
44
- },
45
- ],
46
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
47
- "no-warning-comments": "error",
48
- },
49
- settings: {
50
- react: {
51
- version: "detect",
52
- },
53
- },
54
- };