Skip to content

Commit 05bff0b

Browse files
committed
add npm plugins
1 parent 9fa454a commit 05bff0b

File tree

167 files changed

+4774
-1649
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+4774
-1649
lines changed

client/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default {
2-
projects: ["<rootDir>/packages/*"],
2+
projects: ["<rootDir>/packages/openblocks", "<rootDir>/packages/openblocks-core"],
33
};

client/packages/create-openblocks-comps/README.md

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# create-openblocks-plugin
2+
3+
## Usage
4+
5+
```bash
6+
yarn create openblocks-plugin my-openblocks-plugin
7+
8+
# or
9+
10+
npm create openblocks-plugin my-openblocks-plugin
11+
```

client/packages/create-openblocks-comps/index.js renamed to client/packages/create-openblocks-plugin/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,11 @@ async function createProject(projectName, options) {
129129
await install([
130130
cliPackageName,
131131
sdkPackageName,
132-
"openblocks-design",
133-
"openblocks-core",
134132
"react@17",
135133
"react-dom@17",
136134
"@types/react@17",
137135
"@types/react-dom@17",
136+
"vite",
138137
]);
139138

140139
await executeNodeScript(
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
2-
"name": "create-openblocks-comps",
3-
"version": "0.0.7",
2+
"name": "create-openblocks-plugin",
3+
"version": "0.0.2",
44
"bin": "./index.js",
55
"type": "module",
66
"dependencies": {
77
"chalk": "4",
88
"commander": "^9.4.1",
99
"fs-extra": "^10.1.0",
1010
"openblocks-dev-utils": "workspace:^"
11-
}
11+
},
12+
"license": "MIT",
13+
"keywords": [
14+
"openblocks"
15+
]
1216
}
Lines changed: 10 additions & 0 deletions
Loading
Binary file not shown.

client/packages/openblocks-cli-template-typescript/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openblocks-cli-template-typescript",
3-
"version": "0.0.9",
3+
"version": "0.0.11",
44
"type": "module",
55
"scripts": {
66
"start": "vite",
@@ -11,7 +11,7 @@
1111
"comps": {
1212
"hello_world": {
1313
"name": "__i18n_helloWorldCompName__",
14-
"icon": "./icons/hello_world.png"
14+
"icon": "./icons/demo-icon.png"
1515
}
1616
}
1717
},
@@ -21,5 +21,8 @@
2121
"typescript": "^4.8.4",
2222
"vite": "^3.2.4"
2323
},
24+
"keywords": [
25+
"openblocks"
26+
],
2427
"license": "MIT"
2528
}

client/packages/openblocks-cli-template-typescript/src/HelloWorldComp.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
withMethodExposing,
1212
} from "openblocks-sdk";
1313

14+
import styles from "./styles.module.css";
15+
1416
const { Button } = antd;
1517

1618
const childrenMap = {
@@ -25,10 +27,10 @@ const childrenMap = {
2527
]),
2628
};
2729

28-
const HelloWorldCompBase = new UICompBuilder(childrenMap, (props) => {
30+
const HelloWorldCompBase = new UICompBuilder(childrenMap, (props: any) => {
2931
const currentValue = props.value.value;
3032
return (
31-
<div>
33+
<div className={styles.wrapper}>
3234
<Button
3335
onClick={() => {
3436
props.value.onChange(currentValue - props.step);
@@ -49,7 +51,7 @@ const HelloWorldCompBase = new UICompBuilder(childrenMap, (props) => {
4951
</div>
5052
);
5153
})
52-
.setPropertyViewFn((children) => {
54+
.setPropertyViewFn((children: any) => {
5355
return (
5456
<>
5557
<Section name="Basic">
@@ -68,7 +70,7 @@ const HelloWorldCompTemp = withMethodExposing(HelloWorldCompBase, [
6870
name: "random",
6971
params: [],
7072
},
71-
execute(comp) {
73+
execute(comp: any) {
7274
comp.children.value.getView().onChange(Math.floor(Math.random() * 100));
7375
},
7476
},
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/// <reference types="openblocks-cli/client" />
2+
3+
declare module "openblocks-sdk";

0 commit comments

Comments
 (0)