@blocklet/component-studio-cli 0.4.134
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/README.md +84 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +11 -0
- package/dist/commands/add.d.ts +2 -0
- package/dist/commands/add.js +140 -0
- package/dist/commands/component-studio.d.ts +2 -0
- package/dist/commands/component-studio.js +70 -0
- package/dist/commands/dev.d.ts +2 -0
- package/dist/commands/dev.js +87 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +114 -0
- package/dist/commands/migrate.d.ts +2 -0
- package/dist/commands/migrate.js +177 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.js +22 -0
- package/dist/utils/display-logo.d.ts +2 -0
- package/dist/utils/display-logo.js +24 -0
- package/dist/utils/helper.d.ts +97 -0
- package/dist/utils/helper.js +479 -0
- package/package.json +58 -0
- package/templates/add/components/HelloWorld/@metadata.json +433 -0
- package/templates/add/components/HelloWorld/@template.json +4 -0
- package/templates/add/components/HelloWorld/index.tsx +560 -0
- package/templates/add/tools/cursor-rules/.cursor/rules/@metadata-json.mdc +549 -0
- package/templates/add/tools/cursor-rules/.cursor/rules/component-studio.mdc +138 -0
- package/templates/add/tools/cursor-rules/.cursor/rules/index-tsx.mdc +192 -0
- package/templates/add/tools/cursor-rules/@template.json +4 -0
- package/templates/init/0-basic/@template.json +4 -0
- package/templates/init/0-basic/README.md +30 -0
- package/templates/init/0-basic/package.json +26 -0
- package/templates/init/0-basic/src/HelloWorld/@metadata.json +433 -0
- package/templates/init/0-basic/src/HelloWorld/index.tsx +560 -0
- package/templates/init/1-professional/@template.json +4 -0
- package/templates/init/1-professional/README.md +75 -0
- package/templates/init/1-professional/biome.json +36 -0
- package/templates/init/1-professional/global.d.ts +131 -0
- package/templates/init/1-professional/package.json +73 -0
- package/templates/init/1-professional/scripts/bump-version.mjs +35 -0
- package/templates/init/1-professional/src/atoms/AnimationWrapper.tsx +95 -0
- package/templates/init/1-professional/src/atoms/ArrayTable.tsx +114 -0
- package/templates/init/1-professional/src/atoms/Card.tsx +52 -0
- package/templates/init/1-professional/src/atoms/ContentWrapper.tsx +72 -0
- package/templates/init/1-professional/src/atoms/CopyrightFooter.tsx +31 -0
- package/templates/init/1-professional/src/atoms/DataDisplays.tsx +157 -0
- package/templates/init/1-professional/src/atoms/GradientTitle.tsx +64 -0
- package/templates/init/1-professional/src/atoms/Logo.tsx +58 -0
- package/templates/init/1-professional/src/atoms/index.ts +27 -0
- package/templates/init/1-professional/src/components/HelloWorld/@metadata.json +433 -0
- package/templates/init/1-professional/src/components/HelloWorld/index.tsx +224 -0
- package/templates/init/1-professional/src/type.d.ts +42 -0
- package/templates/init/1-professional/src/utils/index.ts +1 -0
- package/templates/init/1-professional/tsconfig.json +102 -0
- package/templates/init/1-professional/version +1 -0
- package/templates/init/2-blank/@template.json +4 -0
- package/templates/init/2-blank/README.md +27 -0
- package/templates/init/2-blank/package.json +26 -0
- package/templates/workspace/.component-studio-runtime/_theme.tsx +4 -0
- package/templates/workspace/.editorconfig +23 -0
- package/templates/workspace/.env +1 -0
- package/templates/workspace/.init-component-studio +0 -0
- package/templates/workspace/LICENSE +13 -0
- package/templates/workspace/README.md +127 -0
- package/templates/workspace/api/dev.ts +21 -0
- package/templates/workspace/api/src/index.ts +50 -0
- package/templates/workspace/api/src/libs/auth.ts +17 -0
- package/templates/workspace/api/src/libs/env.ts +6 -0
- package/templates/workspace/api/src/libs/logger.ts +3 -0
- package/templates/workspace/api/src/routes/index.ts +12 -0
- package/templates/workspace/api/third.d.ts +17 -0
- package/templates/workspace/biome.json +36 -0
- package/templates/workspace/blocklet.md +8 -0
- package/templates/workspace/blocklet.yml +58 -0
- package/templates/workspace/index.html +15 -0
- package/templates/workspace/logo.png +0 -0
- package/templates/workspace/package.json +125 -0
- package/templates/workspace/pnpm-workspace.yaml +3 -0
- package/templates/workspace/scripts/build-clean.mjs +6 -0
- package/templates/workspace/scripts/bump-version.mjs +39 -0
- package/templates/workspace/scripts/init-component-studio.mjs +36 -0
- package/templates/workspace/tsconfig.api.json +12 -0
- package/templates/workspace/tsconfig.json +102 -0
- package/templates/workspace/version +1 -0
- package/templates/workspace/vite-server.config.ts +39 -0
- package/templates/workspace/vite.config.ts +68 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "component-studio",
|
|
3
|
+
"description": "A Blocklet to help you develop components for Pages Kit",
|
|
4
|
+
"private": true,
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"engines": {
|
|
7
|
+
"npm": "please-use-pnpm",
|
|
8
|
+
"yarn": "please-use-pnpm",
|
|
9
|
+
"node": ">=18",
|
|
10
|
+
"pnpm": ">=9"
|
|
11
|
+
},
|
|
12
|
+
"workspaces": [
|
|
13
|
+
".",
|
|
14
|
+
"projects/*"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev",
|
|
18
|
+
"lint": "biome check . && tsc --noEmit",
|
|
19
|
+
"lint:skip": "echo 'skip lint'",
|
|
20
|
+
"lint:fix": "biome check --apply .",
|
|
21
|
+
"format": "biome format --write .",
|
|
22
|
+
"start": "vite-node -c vite-server.config.ts -w api/dev.ts",
|
|
23
|
+
"clean": "node scripts/build-clean.mjs",
|
|
24
|
+
"bundle": "echo 'skip bundle'",
|
|
25
|
+
"bundle:client": "vite build",
|
|
26
|
+
"prepare": "npx simple-git-hooks",
|
|
27
|
+
"bump-version": "zx --quiet scripts/bump-version.mjs",
|
|
28
|
+
"dev-front": "vite serve .",
|
|
29
|
+
"build-lib": "node -r dotenv-flow/config -e \"require('@blocklet/pages-kit-block-studio/build-lib')\"",
|
|
30
|
+
"update:deps": "npx -y taze -r -n '/arcblock|ocap|abtnode|blocklet|did-connect|did-comment|nedb/' -w -f && pnpm install && pnpm run deduplicate",
|
|
31
|
+
"deduplicate": "pnpm dedupe",
|
|
32
|
+
"preinstall": "npx only-allow pnpm",
|
|
33
|
+
"postinstall": "node scripts/init-component-studio.mjs"
|
|
34
|
+
},
|
|
35
|
+
"lint-staged": {
|
|
36
|
+
"*.{mjs,js,jsx,ts,tsx,css,less,scss,json,graphql}": [
|
|
37
|
+
"pnpm run format",
|
|
38
|
+
"pnpm run lint:skip"
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
"browserslist": {
|
|
42
|
+
"production": [
|
|
43
|
+
">0.2%",
|
|
44
|
+
"not dead",
|
|
45
|
+
"not op_mini all"
|
|
46
|
+
],
|
|
47
|
+
"development": [
|
|
48
|
+
"last 1 chrome version",
|
|
49
|
+
"last 1 firefox version",
|
|
50
|
+
"last 1 safari version"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@arcblock/did-auth": "^1.20.2",
|
|
55
|
+
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
56
|
+
"@arcblock/did-connect": "^2.13.12",
|
|
57
|
+
"@arcblock/ux": "^2.13.12",
|
|
58
|
+
"@blocklet/pages-kit": "^0.4.129",
|
|
59
|
+
"@blocklet/pages-kit-block-studio": "^0.4.129",
|
|
60
|
+
"@blocklet/pages-kit-inner-components": "^0.4.129",
|
|
61
|
+
"@blocklet/pages-kit-runtime": "^0.4.129",
|
|
62
|
+
"@blocklet/sdk": "^1.16.42",
|
|
63
|
+
"@blocklet/studio-ui": "^0.4.258",
|
|
64
|
+
"@blocklet/ui-react": "^2.13.12",
|
|
65
|
+
"@ocap/client": "^1.20.2",
|
|
66
|
+
"@ocap/mcrypto": "^1.20.2",
|
|
67
|
+
"@ocap/wallet": "^1.20.2",
|
|
68
|
+
"axios": "^1.7.9",
|
|
69
|
+
"cookie-parser": "^1.4.7",
|
|
70
|
+
"cors": "^2.8.5",
|
|
71
|
+
"dotenv-flow": "^4.1.0",
|
|
72
|
+
"express": "^4.19.2",
|
|
73
|
+
"express-async-errors": "^3.1.1"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@biomejs/biome": "^1.9.4",
|
|
77
|
+
"@blocklet/js-sdk": "^1.16.42",
|
|
78
|
+
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
79
|
+
"@types/cookie-parser": "^1.4.8",
|
|
80
|
+
"@types/cors": "^2.8.17",
|
|
81
|
+
"@types/dotenv-flow": "^3.3.3",
|
|
82
|
+
"@types/express": "^4.17.21",
|
|
83
|
+
"@types/node": "^20.17.12",
|
|
84
|
+
"@types/react": "^18.3.18",
|
|
85
|
+
"@types/react-dom": "^18.3.5",
|
|
86
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
87
|
+
"bumpp": "^9.9.3",
|
|
88
|
+
"cross-env": "^7.0.3",
|
|
89
|
+
"get-port": "^5.1.1",
|
|
90
|
+
"import-sort-style-module": "^6.0.0",
|
|
91
|
+
"lint-staged": "^15.3.0",
|
|
92
|
+
"nodemon": "^3.1.9",
|
|
93
|
+
"npm-run-all": "^4.1.5",
|
|
94
|
+
"react": "^18.3.1",
|
|
95
|
+
"react-dom": "^18.3.1",
|
|
96
|
+
"react-router-dom": "^6.26.1",
|
|
97
|
+
"rimraf": "^5.0.10",
|
|
98
|
+
"simple-git-hooks": "^2.11.1",
|
|
99
|
+
"typescript": "^5.7.2",
|
|
100
|
+
"vite": "^5.4.11",
|
|
101
|
+
"vite-node": "^2.1.8",
|
|
102
|
+
"vite-plugin-blocklet": "^0.9.31",
|
|
103
|
+
"vite-plugin-require": "^1.2.14",
|
|
104
|
+
"vite-plugin-svgr": "^4.3.0",
|
|
105
|
+
"vite-tsconfig-paths": "^4.3.2",
|
|
106
|
+
"zx": "^8.3.0"
|
|
107
|
+
},
|
|
108
|
+
"importSort": {
|
|
109
|
+
".js, .jsx, .mjs": {
|
|
110
|
+
"parser": "babylon",
|
|
111
|
+
"style": "module"
|
|
112
|
+
},
|
|
113
|
+
".ts, .tsx": {
|
|
114
|
+
"style": "module",
|
|
115
|
+
"parser": "typescript"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"simple-git-hooks": {
|
|
119
|
+
"pre-commit": "npx lint-staged"
|
|
120
|
+
},
|
|
121
|
+
"resolutions": {
|
|
122
|
+
"react-dnd": "^16.0.1",
|
|
123
|
+
"react-dnd-html5-backend": "^16.0.1"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { execSync } from 'child_process';
|
|
3
|
+
import { $, chalk, fs } from 'zx';
|
|
4
|
+
|
|
5
|
+
async function main() {
|
|
6
|
+
execSync('bumpp --no-tag --no-commit --no-push package.json', { stdio: 'inherit' });
|
|
7
|
+
|
|
8
|
+
const { version } = await fs.readJSON('package.json');
|
|
9
|
+
await fs.writeFileSync('version', version);
|
|
10
|
+
|
|
11
|
+
console.log(chalk.greenBright(`[info]: start to modify blocklet version to ${version}`));
|
|
12
|
+
await $`blocklet version ${version}`;
|
|
13
|
+
console.log(chalk.greenBright('[info]: blocklet version modified.'));
|
|
14
|
+
|
|
15
|
+
let newChangelog = '';
|
|
16
|
+
try {
|
|
17
|
+
const gitRes = await $`git log --pretty=format:"- %s" "main"...HEAD`;
|
|
18
|
+
newChangelog = gitRes.stdout.trim();
|
|
19
|
+
} catch {
|
|
20
|
+
console.error(chalk.redBright('Could not get git log, please write changelog manually.'));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const now = new Date();
|
|
24
|
+
const currentDate = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
|
|
25
|
+
const title = `## ${version} (${currentDate})`;
|
|
26
|
+
|
|
27
|
+
await fs.ensureFile('CHANGELOG.md');
|
|
28
|
+
const oldChangelog = await fs.readFile('CHANGELOG.md', 'utf8');
|
|
29
|
+
const changelog = [title, newChangelog, oldChangelog].filter((item) => !!item).join('\n\n');
|
|
30
|
+
await fs.writeFile('CHANGELOG.md', changelog);
|
|
31
|
+
|
|
32
|
+
console.log(`\nNow you can make adjustments to ${chalk.cyan('CHANGELOG.md')} . Then press enter to continue.`);
|
|
33
|
+
|
|
34
|
+
process.stdin.setRawMode(true);
|
|
35
|
+
process.stdin.resume();
|
|
36
|
+
process.stdin.on('data', process.exit.bind(process, 0));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
main();
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { execSync } from 'child_process';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import getPort from 'get-port';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
|
|
7
|
+
const flagFile = path.join(process.cwd(), '.init-component-studio');
|
|
8
|
+
|
|
9
|
+
// write the BLOCKLET_PORT to .env.development.local
|
|
10
|
+
async function ensureBlockletPortToDevEnv() {
|
|
11
|
+
if (fs.existsSync(path.join(process.cwd(), '.env.development.local'))) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const port = await getPort({ port: 8118 });
|
|
16
|
+
fs.writeFileSync(path.join(process.cwd(), '.env.development.local'), `BLOCKLET_PORT=${port}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// check the flag file is exists
|
|
20
|
+
if (fs.existsSync(flagFile)) {
|
|
21
|
+
try {
|
|
22
|
+
// remove flag file to avoid infinite loop
|
|
23
|
+
fs.unlinkSync(flagFile);
|
|
24
|
+
|
|
25
|
+
// execute update:deps script
|
|
26
|
+
// console.log('Updating Latest Dependencies...');
|
|
27
|
+
// execSync('pnpm run update:deps', { stdio: 'inherit' });
|
|
28
|
+
|
|
29
|
+
// write the BLOCKLET_PORT to .env.development.local
|
|
30
|
+
ensureBlockletPortToDevEnv();
|
|
31
|
+
} catch (error) {
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
// skip script
|
|
36
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ts-node": {
|
|
3
|
+
"files": true,
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"module": "Node16"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"compilerOptions": {
|
|
9
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
10
|
+
/* Projects */
|
|
11
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
12
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
13
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
14
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
15
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
16
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
17
|
+
/* Language and Environment */
|
|
18
|
+
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
|
19
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
20
|
+
"jsx": "react-jsx" /* Specify what JSX code is generated. */,
|
|
21
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
22
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
23
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
24
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
25
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
26
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
27
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
28
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
29
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
30
|
+
/* Modules */
|
|
31
|
+
"module": "commonjs" /* Specify what module code is generated. */,
|
|
32
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
33
|
+
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
34
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
35
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
36
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
37
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
38
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
39
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
40
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
41
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
42
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
43
|
+
/* JavaScript Support */
|
|
44
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
45
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
46
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
47
|
+
/* Emit */
|
|
48
|
+
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
49
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
50
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
51
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
52
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
53
|
+
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
54
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
55
|
+
"noEmit": true /* Disable emitting files from a compilation. */,
|
|
56
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
57
|
+
"ignoreDeprecations": "5.0",
|
|
58
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
59
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
60
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
61
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
62
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
63
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
64
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
65
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
66
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
67
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
68
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
69
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
70
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
71
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
72
|
+
/* Interop Constraints */
|
|
73
|
+
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
|
|
74
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
75
|
+
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
76
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
77
|
+
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
78
|
+
/* Type Checking */
|
|
79
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
80
|
+
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
|
|
81
|
+
"strictNullChecks": true /* When type checking, take into account 'null' and 'undefined'. */,
|
|
82
|
+
"strictFunctionTypes": true /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */,
|
|
83
|
+
"strictBindCallApply": true /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */,
|
|
84
|
+
"strictPropertyInitialization": true /* Check for class properties that are declared but not set in the constructor. */,
|
|
85
|
+
"noImplicitThis": true /* Enable error reporting when 'this' is given the type 'any'. */,
|
|
86
|
+
"useUnknownInCatchVariables": false /* Default catch clause variables as 'unknown' instead of 'any'. */,
|
|
87
|
+
"alwaysStrict": true /* Ensure 'use strict' is always emitted. */,
|
|
88
|
+
"noUnusedLocals": true /* Enable error reporting when local variables aren't read. */,
|
|
89
|
+
"noUnusedParameters": true /* Raise an error when a function parameter isn't read. */,
|
|
90
|
+
// "exactOptionalPropertyTypes": false /* Interpret optional property types as written, rather than adding 'undefined'. */,
|
|
91
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
92
|
+
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
|
|
93
|
+
"noUncheckedIndexedAccess": true /* Add 'undefined' to a type when accessed using an index. */,
|
|
94
|
+
"noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
|
|
95
|
+
// "noPropertyAccessFromIndexSignature": true /* Enforces using indexed accessors for keys declared using an indexed type. */,
|
|
96
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
97
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
98
|
+
/* Completeness */
|
|
99
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
100
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.0
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { defineConfig } from 'vite';
|
|
4
|
+
import vitePluginRequire from 'vite-plugin-require';
|
|
5
|
+
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
6
|
+
|
|
7
|
+
// https://vitejs.dev/config/
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
export default defineConfig(() => {
|
|
10
|
+
return {
|
|
11
|
+
plugins: [vitePluginRequire(), tsconfigPaths()],
|
|
12
|
+
resolve: {
|
|
13
|
+
alias: {
|
|
14
|
+
crypto: 'node:crypto',
|
|
15
|
+
// '@blocklet/pages-kit-block-studio/build-lib': path.resolve(
|
|
16
|
+
// __dirname,
|
|
17
|
+
// '../pages-kit/packages/pages-kit-block-studio/src/utils/build-lib.ts',
|
|
18
|
+
// ),
|
|
19
|
+
// only for debug
|
|
20
|
+
// '@blocklet/uploader-server': path.resolve(__dirname, '../image-bin/packages/uploader-server/src/index.ts'),
|
|
21
|
+
'@blocklet/pages-kit-block-studio/init-resource-router': path.resolve(
|
|
22
|
+
__dirname,
|
|
23
|
+
'/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit-block-studio/src/middlewares/init-resource-router.ts'
|
|
24
|
+
),
|
|
25
|
+
'@blocklet/pages-kit-block-studio/init-block-studio-router': path.resolve(
|
|
26
|
+
__dirname,
|
|
27
|
+
'/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit-block-studio/src/middlewares/init-block-studio-router.ts'
|
|
28
|
+
),
|
|
29
|
+
'@blocklet/pages-kit-block-studio/init-uploader-router': path.resolve(
|
|
30
|
+
__dirname,
|
|
31
|
+
'/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit-block-studio/src/middlewares/init-uploader-router.ts'
|
|
32
|
+
),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
server: {
|
|
36
|
+
hmr: false,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { defineConfig } from 'vite';
|
|
5
|
+
import { createBlockletPlugin } from 'vite-plugin-blocklet';
|
|
6
|
+
import svgr from 'vite-plugin-svgr';
|
|
7
|
+
|
|
8
|
+
import { initBlockStudioPlugins } from '/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit-block-studio/src/plugins/index.ts';
|
|
9
|
+
|
|
10
|
+
// https://vitejs.dev/config/
|
|
11
|
+
export default defineConfig((mode) => {
|
|
12
|
+
return {
|
|
13
|
+
plugins: [
|
|
14
|
+
react({
|
|
15
|
+
jsxRuntime: 'automatic',
|
|
16
|
+
}),
|
|
17
|
+
createBlockletPlugin(),
|
|
18
|
+
svgr(),
|
|
19
|
+
initBlockStudioPlugins({
|
|
20
|
+
formats: ['es'],
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
|
|
24
|
+
resolve: {
|
|
25
|
+
alias: {
|
|
26
|
+
// '@blocklet/pages-kit-block-studio/build-lib': path.resolve(
|
|
27
|
+
// __dirname,
|
|
28
|
+
// '../pages-kit/packages/pages-kit-block-studio/src/utils/build-lib.ts',
|
|
29
|
+
// ),
|
|
30
|
+
// '@blocklet/pages-kit-block-studio/plugins':
|
|
31
|
+
// '/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit-block-studio/src/plugins/index.ts',
|
|
32
|
+
// "@blocklet/pages-kit-runtime": path.resolve(
|
|
33
|
+
// __dirname,
|
|
34
|
+
// "/Users/FireTable/Code/ArcBlock/pages-kit/frameworks/runtime/lib/esm",
|
|
35
|
+
// ),
|
|
36
|
+
// '@blocklet/uploader/react': path.resolve(__dirname, './node_modules/@blocklet/uploader/es/react.js'),
|
|
37
|
+
// "@blocklet/pages-kit-inner-components": path.resolve(
|
|
38
|
+
// __dirname,
|
|
39
|
+
// "/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit-inner-components/lib/es",
|
|
40
|
+
// ),
|
|
41
|
+
// '@blocklet/pages-kit/utils/property':
|
|
42
|
+
// '/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit/src/utils/property.ts',
|
|
43
|
+
// '@blocklet/pages-kit/components':
|
|
44
|
+
// '/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit/src/components/index.ts',
|
|
45
|
+
// '@blocklet/pages-kit/builtin/uploader': path.resolve(
|
|
46
|
+
// __dirname,
|
|
47
|
+
// '../pages-kit/packages/pages-kit/src/builtin/uploader.tsx',
|
|
48
|
+
// ),
|
|
49
|
+
// '@blocklet/pages-kit/builtin/color-picker': path.resolve(
|
|
50
|
+
// __dirname,
|
|
51
|
+
// '../pages-kit/packages/pages-kit/src/builtin/color-picker.tsx',
|
|
52
|
+
// // ),
|
|
53
|
+
// "@blocklet/pages-kit-block-studio/frontend": path.resolve(
|
|
54
|
+
// __dirname,
|
|
55
|
+
// "/Users/FireTable/Code/ArcBlock/pages-kit/packages/pages-kit-block-studio/src/plugins/_theme.tsx",
|
|
56
|
+
// ),
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
server: {
|
|
61
|
+
allowedHosts: true,
|
|
62
|
+
fs: {
|
|
63
|
+
strict: false, // monorepo and pnpm required
|
|
64
|
+
allow: ['*'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
});
|