Skip to content

Commit 6771ee4

Browse files
committed
fix plop templates
1 parent aeb95c5 commit 6771ee4

File tree

8 files changed

+64
-71
lines changed

8 files changed

+64
-71
lines changed

plop-templates/bits/end/package.json.hbs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ build:locales && pnpm build:pkg && pnpm build:types", "build:pkg": "node
1515
--project tsconfig.build.json --declaration --emitDeclarationOnly" },
1616
"dependencies": { "@bitflow/core": "workspace:*" }, "peerDependencies": {
1717
"@emotion/cache": "11.x", "@emotion/react": "11.x", "@emotion/styled": "11.x",
18-
"@openpatch/patches": "5.x", "@vocab/core": "1.x", "@vocab/react": "1.x",
19-
"react": "17.x", "react-dom": "17.x", "react-hook-form": "7.x", "zod": "3.x" } }
18+
"@openpatch/patches": "6.x", "@vocab/core": "1.x", "@vocab/react": "1.x",
19+
"react": "18.x", "react-dom": "18.x", "react-hook-form": "7.x", "zod": "3.x" },
20+
"devDependencies": { "@babel/core": "7.18.9", "@emotion/cache": "11.9.3",
21+
"@emotion/react": "11.9.3", "@emotion/styled": "11.9.3", "@openpatch/patches":
22+
"6.0.1", "@types/react": "18.0.15", "@types/react-dom": "18.0.6", "@vocab/core":
23+
"1.1.0", "@vocab/react": "1.1.2", "react": "18.2.0", "react-dom": "18.2.0",
24+
"react-hook-form": "7.33.1", "zod": "3.17.9" } }

plop-templates/bits/input/package.json.hbs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ build:locales && pnpm build:pkg && pnpm build:types", "build:pkg": "node
1515
--project tsconfig.build.json --declaration --emitDeclarationOnly" },
1616
"dependencies": { "@bitflow/core": "workspace:*" }, "peerDependencies": {
1717
"@emotion/cache": "11.x", "@emotion/react": "11.x", "@emotion/styled": "11.x",
18-
"@openpatch/patches": "5.x", "@vocab/core": "1.x", "@vocab/react": "1.x",
19-
"react": "17.x", "react-dom": "17.x", "react-hook-form": "7.x", "zod": "3.x" } }
18+
"@openpatch/patches": "6.x", "@vocab/core": "1.x", "@vocab/react": "1.x",
19+
"react": "18.x", "react-dom": "18.x", "react-hook-form": "7.x", "zod": "3.x" },
20+
"devDependencies": { "@babel/core": "7.18.9", "@emotion/cache": "11.9.3",
21+
"@emotion/react": "11.9.3", "@emotion/styled": "11.9.3", "@openpatch/patches":
22+
"6.0.1", "@types/react": "18.0.15", "@types/react-dom": "18.0.6", "@vocab/core":
23+
"1.1.0", "@vocab/react": "1.1.2", "react": "18.2.0", "react-dom": "18.2.0",
24+
"react-hook-form": "7.33.1", "zod": "3.17.9" } }

plop-templates/bits/start/package.json.hbs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ build:locales && pnpm build:pkg && pnpm build:types", "build:pkg": "node
1515
--project tsconfig.build.json --declaration --emitDeclarationOnly" },
1616
"dependencies": { "@bitflow/core": "workspace:*" }, "peerDependencies": {
1717
"@emotion/cache": "11.x", "@emotion/react": "11.x", "@emotion/styled": "11.x",
18-
"@openpatch/patches": "5.x", "@vocab/core": "1.x", "@vocab/react": "1.x",
19-
"react": "17.x", "react-dom": "17.x", "react-hook-form": "7.x", "zod": "3.x" } }
18+
"@openpatch/patches": "6.x", "@vocab/core": "1.x", "@vocab/react": "1.x",
19+
"react": "18.x", "react-dom": "18.x", "react-hook-form": "7.x", "zod": "3.x" },
20+
"devDependencies": { "@babel/core": "7.18.9", "@emotion/cache": "11.9.3",
21+
"@emotion/react": "11.9.3", "@emotion/styled": "11.9.3", "@openpatch/patches":
22+
"6.0.1", "@types/react": "18.0.15", "@types/react-dom": "18.0.6", "@vocab/core":
23+
"1.1.0", "@vocab/react": "1.1.2", "react": "18.2.0", "react-dom": "18.2.0",
24+
"react-hook-form": "7.33.1", "zod": "3.17.9" } }

plop-templates/bits/task/package.json.hbs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ build:locales && pnpm build:pkg && pnpm build:types", "build:pkg": "node
1515
--project tsconfig.build.json --declaration --emitDeclarationOnly" },
1616
"dependencies": { "@bitflow/core": "workspace:*", "immer": "^9.0.3" },
1717
"peerDependencies": { "@emotion/cache": "11.x", "@emotion/react": "11.x",
18-
"@emotion/styled": "11.x", "@openpatch/patches": "5.x", "@vocab/core": "1.x",
19-
"@vocab/react": "1.x", "react": "17.x", "react-dom": "17.x", "react-hook-form":
20-
"7.x", "zod": "3.x" } }
18+
"@emotion/styled": "11.x", "@openpatch/patches": "6.x", "@vocab/core": "1.x",
19+
"@vocab/react": "1.x", "react": "18.x", "react-dom": "18.x", "react-hook-form":
20+
"7.x", "zod": "3.x" }, "devDependencies": { "@babel/core": "7.18.9",
21+
"@emotion/cache": "11.9.3", "@emotion/react": "11.9.3", "@emotion/styled":
22+
"11.9.3", "@openpatch/patches": "6.0.1", "@types/react": "18.0.15",
23+
"@types/react-dom": "18.0.6", "@vocab/core": "1.1.0", "@vocab/react": "1.1.2",
24+
"react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "7.33.1", "zod":
25+
"3.17.9" } }

plop-templates/bits/title/package.json.hbs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ build:locales && pnpm build:pkg && pnpm build:types", "build:pkg": "node
1515
--project tsconfig.build.json --declaration --emitDeclarationOnly" },
1616
"dependencies": { "@bitflow/core": "workspace:*" }, "peerDependencies": {
1717
"@emotion/cache": "11.x", "@emotion/react": "11.x", "@emotion/styled": "11.x",
18-
"@openpatch/patches": "5.x", "@vocab/core": "1.x", "@vocab/react": "1.x",
19-
"react": "17.x", "react-dom": "17.x", "react-hook-form": "7.x", "zod": "3.x" } }
18+
"@openpatch/patches": "6.x", "@vocab/core": "1.x", "@vocab/react": "1.x",
19+
"react": "18.x", "react-dom": "18.x", "react-hook-form": "7.x", "zod": "3.x" },
20+
"devDependencies": { "@babel/core": "7.18.9", "@emotion/cache": "11.9.3",
21+
"@emotion/react": "11.9.3", "@emotion/styled": "11.9.3", "@openpatch/patches":
22+
"6.0.1", "@types/react": "18.0.15", "@types/react-dom": "18.0.6", "@vocab/core":
23+
"1.1.0", "@vocab/react": "1.1.2", "react": "18.2.0", "react-dom": "18.2.0",
24+
"react-hook-form": "7.33.1", "zod": "3.17.9" } }
Lines changed: 22 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,22 @@
1-
{
2-
"name": "@bitflow/{{dashCase name}}",
3-
"version": "0.0.0",
4-
"author": "Mike Barkmin",
5-
"homepage": "https://github.com/openpatch/bitflow#readme",
6-
"license": "MIT",
7-
"main": "dist/index.cjs.js",
8-
"module": "dist/index.esm.mjs",
9-
"types": "dist/index.d.ts",
10-
"typings": "dist/index.d.ts",
11-
"sideEffects": false,
12-
"exports": {
13-
".": {
14-
"require": "./dist/index.cjs.js",
15-
"default": "./dist/index.esm.mjs"
16-
}
17-
},
18-
"files": [
19-
"dist"
20-
],
21-
"publishConfig": {
22-
"access": "public"
23-
},
24-
"repository": {
25-
"type": "git",
26-
"url": "git+https://github.com/openpatch/bitflow.git",
27-
"directory": "packages/{{dashCase name }}"
28-
},
29-
"bugs": {
30-
"url": "https://github.com/openpatch/bitflow/issues"
31-
},
32-
"scripts": {
33-
"prebuild": "rimraf dist",
34-
"version": "pnpm build",
35-
"lint": "tsc --noEmit",
36-
"test": "jest --env=jsdom --passWithNoTests",
37-
"build": "pnpm build:pkg && pnpm build:types",
38-
"build:pkg": "node ../../scripts/build.mjs",
39-
"build:types": "tsc --project tsconfig.build.json --declaration --emitDeclarationOnly"
40-
},
41-
"dependencies": {
42-
"@bitflow/core": "workspace:*"
43-
},
44-
"peerDependencies": {
45-
"@emotion/cache": "11.x",
46-
"@emotion/react": "11.x",
47-
"@emotion/styled": "11.x",
48-
"@openpatch/patches": "5.x",
49-
"@vocab/core": "1.x",
50-
"@vocab/react": "1.x",
51-
"react": "17.x",
52-
"react-dom": "17.x",
53-
"zod": "3.x"
54-
}
55-
}
1+
{ "name": "@bitflow/{{dashCase name}}", "version": "0.0.0", "author": "Mike
2+
Barkmin", "homepage": "https://github.com/openpatch/bitflow#readme", "license":
3+
"MIT", "main": "dist/index.cjs.js", "module": "dist/index.esm.mjs", "types":
4+
"dist/index.d.ts", "typings": "dist/index.d.ts", "sideEffects": false,
5+
"exports": { ".": { "require": "./dist/index.cjs.js", "default":
6+
"./dist/index.esm.mjs" } }, "files": [ "dist" ], "publishConfig": { "access":
7+
"public" }, "repository": { "type": "git", "url":
8+
"git+https://github.com/openpatch/bitflow.git", "directory": "packages/{{dashCase
9+
name
10+
}}" }, "bugs": { "url": "https://github.com/openpatch/bitflow/issues" },
11+
"scripts": { "prebuild": "rimraf dist", "version": "pnpm build", "lint": "tsc
12+
--noEmit", "test": "jest --env=jsdom --passWithNoTests", "build": "pnpm
13+
build:pkg && pnpm build:types", "build:pkg": "node ../../scripts/build.mjs",
14+
"build:types": "tsc --project tsconfig.build.json --declaration
15+
--emitDeclarationOnly" }, "dependencies": { "@bitflow/core": "workspace:*" },
16+
"peerDependencies": { "@emotion/cache": "11.x", "@emotion/react": "11.x",
17+
"@emotion/styled": "11.x", "@openpatch/patches": "6.x", "@vocab/core": "1.x",
18+
"@vocab/react": "1.x", "react": "18.x", "react-dom": "18.x", "zod": "3.x" },
19+
"devDependencies": { "@emotion/cache": "11.9.3", "@emotion/react": "11.9.3",
20+
"@emotion/styled": "11.9.3", "@openpatch/patches": "6.0.1", "@types/react":
21+
"18.0.15", "@types/react-dom": "18.0.6", "@vocab/core": "1.1.0", "@vocab/react":
22+
"1.1.2", "react": "18.2.0", "react-dom": "18.2.0", "zod": "3.17.9" } }

plopfile.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {updateBitsPackage} from "./scripts/updateBitsPackage.mjs";
1+
import { updateBitsPackage } from "./scripts/updateBitsPackage.mjs";
22
import { execSync } from "child_process";
33

44
export default function (plop) {
@@ -24,9 +24,9 @@ export default function (plop) {
2424
base: "plop-templates/bits/{{ type }}",
2525
},
2626
() => {
27-
updateBitsPackage(plop)()
28-
execSync("pnpm i");
29-
}
27+
updateBitsPackage(plop)();
28+
execSync("pnpm i");
29+
},
3030
],
3131
});
3232
plop.setGenerator("component package", {

scripts/updateBitsPackage.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export function updateBitsPackage(plop) {
88
plop.setHelper("single", (l) => l.length === 1);
99

1010
function bitData(dir) {
11-
const [type, key] = dir.split("-", 2);
11+
const i = dir.indexOf("-");
12+
const [type, key] = [dir.slice(0, i), dir.slice(i + 1)];
1213
return {
1314
key,
1415
name: `${properCase(type)}${properCase(key)}`,

0 commit comments

Comments
 (0)