@blocklet/pages-kit-block-studio 0.1.4 → 0.1.5
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/lib/cjs/constants/index.js +12 -1
- package/lib/cjs/constants/new-block-template/@metadata.json +59 -0
- package/lib/cjs/constants/new-block-template/index.tsx +89 -0
- package/lib/cjs/middlewares/init-block-studio-router.js +42 -0
- package/lib/cjs/plugins/vite-plugin-html-transform.js +24 -2
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/generate-wrapper-code.js +21 -25
- package/lib/cjs/utils/helper.js +20 -12
- package/lib/esm/constants/index.js +8 -0
- package/lib/esm/constants/new-block-template/@metadata.json +59 -0
- package/lib/esm/constants/new-block-template/index.tsx +89 -0
- package/lib/esm/middlewares/init-block-studio-router.js +43 -1
- package/lib/esm/plugins/vite-plugin-html-transform.js +24 -2
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/generate-wrapper-code.js +21 -25
- package/lib/esm/utils/helper.js +10 -6
- package/lib/types/constants/index.d.ts +7 -0
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/utils/helper.d.ts +2 -4
- package/package.json +9 -6
- package/tsconfig.json +3 -1
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
export * from '../constants';
|
|
1
2
|
export interface GlobOptions {
|
|
2
3
|
cwd?: string;
|
|
3
4
|
filter?: string[];
|
|
4
5
|
}
|
|
5
6
|
export declare const logger: Console;
|
|
6
|
-
export declare const libDir = "lib";
|
|
7
|
-
export declare const METADATA_FILE_NAME = "@metadata.json";
|
|
8
|
-
export declare const PREVIEW_IMAGE_DIR = "@preview-images";
|
|
9
|
-
export declare const NANOID_LENGTH = 16;
|
|
10
7
|
export declare function setBlockEntryFilesPattern(pattern: string): void;
|
|
11
8
|
export declare function getBlockEntryFilesPattern(): string;
|
|
12
9
|
export declare function findComponentFiles(options?: GlobOptions): {
|
|
@@ -31,3 +28,4 @@ export declare function generateYaml(metadata: any): string;
|
|
|
31
28
|
export declare function getBlockStudioInfo(): import("@blocklet/sdk/lib/config").MountPoint | undefined;
|
|
32
29
|
export declare const isPagesKitBlockStudio: boolean;
|
|
33
30
|
export declare const getBlockCode: (filePath: string) => string;
|
|
31
|
+
export declare const safeParse: (text: string) => any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/pages-kit-block-studio",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Pages Kit block studio",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -83,13 +83,14 @@
|
|
|
83
83
|
"url": "git+https://github.com/blocklet/pages-kit.git"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@blocklet/sdk": "^1.16.
|
|
87
|
-
"@blocklet/ui-react": "^2.11.
|
|
86
|
+
"@blocklet/sdk": "^1.16.39",
|
|
87
|
+
"@blocklet/ui-react": "^2.11.48",
|
|
88
88
|
"@mdx-js/react": "^3.1.0",
|
|
89
89
|
"@mui/material": "^5.16.7",
|
|
90
90
|
"ahooks": "^3.8.4",
|
|
91
91
|
"axios": "^1.7.4",
|
|
92
92
|
"chalk": "^4.1.2",
|
|
93
|
+
"copyfiles": "^2.4.1",
|
|
93
94
|
"esbuild": "^0.19.12",
|
|
94
95
|
"express": "^4.19.2",
|
|
95
96
|
"glob": "^11.0.0",
|
|
@@ -101,7 +102,8 @@
|
|
|
101
102
|
"typescript": "^5.7.2",
|
|
102
103
|
"ufo": "^1.5.4",
|
|
103
104
|
"vite-plugin-react-pages": "^5.0.0",
|
|
104
|
-
"yaml": "^2.5.0"
|
|
105
|
+
"yaml": "^2.5.0",
|
|
106
|
+
"nanoid": "^3.3.7"
|
|
105
107
|
},
|
|
106
108
|
"devDependencies": {
|
|
107
109
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
@@ -123,11 +125,12 @@
|
|
|
123
125
|
"scripts": {
|
|
124
126
|
"lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
|
|
125
127
|
"lint:fix": "npm run lint -- --fix",
|
|
126
|
-
"build": "run-p build:*",
|
|
128
|
+
"build": "run-p build:* && npm run copy-templates",
|
|
127
129
|
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
|
|
128
130
|
"build:esm": "tsc --module es2022 --outDir lib/esm",
|
|
129
131
|
"build:types": "tsc --declaration --emitDeclarationOnly --outDir lib/types",
|
|
130
132
|
"dev": "run-p 'build:* -- -w'",
|
|
131
|
-
"clean": "rimraf lib"
|
|
133
|
+
"clean": "rimraf lib",
|
|
134
|
+
"copy-templates": "copyfiles -u 1 \"src/constants/new-block-template/**/*\" lib/cjs/ && copyfiles -u 1 \"src/constants/new-block-template/**/*\" lib/esm/"
|
|
132
135
|
}
|
|
133
136
|
}
|
package/tsconfig.json
CHANGED
|
@@ -9,5 +9,7 @@
|
|
|
9
9
|
// "@blocklet/ai-runtime/*": ["../../../ai-studio/packages/ai-runtime/src/*"]
|
|
10
10
|
// "@blocklet/ai-kit/*": ["../../../ai-kit/packages/ai-kit/src/*"]
|
|
11
11
|
}
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.json", "src/**/*.mjs", "src/**/*.js", "src/**/*.jsx"],
|
|
14
|
+
"exclude": ["src/constants/new-block-template/*"]
|
|
13
15
|
}
|