@maxelms/create-plugin-cli 1.1.5 → 1.1.7
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/bin/index.js +1 -0
- package/lib/index.js +1 -1
- package/lib/utils.d.ts +1 -0
- package/package.json +2 -2
- package/templates/maxelms-script/index.html +1 -1
- package/templates/maxelms-style/package.json.tpl +1 -1
- package/templates/react-micro-app/src/pages/Home/index.tsx +2 -2
- package/templates/react-micro-field/src/App.tsx.tpl +1 -1
- package/templates/react-micro-field-umi/src/pages/index.tsx.tpl +1 -1
- package/templates/react-micro-plugin/src/App.tsx.tpl +1 -1
- package/templates/vue-micro-app/src/main.js +1 -1
- package/templates/vue-micro-button/src/App.vue +2 -2
- package/templates/vue3-micro-app/.editorconfig +6 -0
- package/templates/vue3-micro-app/.prettierrc.json +7 -0
- package/templates/vue3-micro-app/.vscode/extensions.json +9 -0
- package/templates/vue3-micro-app/README.md +45 -0
- package/templates/vue3-micro-app/env.d.ts +1 -0
- package/templates/vue3-micro-app/eslint.config.js +25 -0
- package/templates/vue3-micro-app/index.html +13 -0
- package/templates/vue3-micro-app/package.json.tpl +46 -0
- package/templates/vue3-micro-app/pnpm-lock.yaml +4477 -0
- package/templates/vue3-micro-app/public/configuration.json +30 -0
- package/templates/vue3-micro-app/public/favicon.ico +0 -0
- package/templates/vue3-micro-app/src/App.vue +88 -0
- package/templates/vue3-micro-app/src/assets/base.css +86 -0
- package/templates/vue3-micro-app/src/assets/logo.svg +1 -0
- package/templates/vue3-micro-app/src/assets/main.css +35 -0
- package/templates/vue3-micro-app/src/components/HelloWorld.vue +42 -0
- package/templates/vue3-micro-app/src/components/TheWelcome.vue +90 -0
- package/templates/vue3-micro-app/src/components/WelcomeItem.vue +87 -0
- package/templates/vue3-micro-app/src/components/__tests__/HelloWorld.spec.ts +11 -0
- package/templates/vue3-micro-app/src/components/icons/IconCommunity.vue +7 -0
- package/templates/vue3-micro-app/src/components/icons/IconDocumentation.vue +7 -0
- package/templates/vue3-micro-app/src/components/icons/IconEcosystem.vue +7 -0
- package/templates/vue3-micro-app/src/components/icons/IconSupport.vue +7 -0
- package/templates/vue3-micro-app/src/components/icons/IconTooling.vue +19 -0
- package/templates/vue3-micro-app/src/main.ts +14 -0
- package/templates/vue3-micro-app/src/router/index.ts +23 -0
- package/templates/vue3-micro-app/src/stores/counter.ts +12 -0
- package/templates/vue3-micro-app/src/views/AboutView.vue +15 -0
- package/templates/vue3-micro-app/src/views/HomeView.vue +9 -0
- package/templates/vue3-micro-app/tsconfig.app.json +13 -0
- package/templates/vue3-micro-app/tsconfig.json +14 -0
- package/templates/vue3-micro-app/tsconfig.node.json +19 -0
- package/templates/vue3-micro-app/tsconfig.vitest.json +11 -0
- package/templates/vue3-micro-app/vite.config.ts +24 -0
- package/templates/vue3-micro-app/vitest.config.ts +14 -0
package/bin/index.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -48,7 +48,7 @@ var uuid_1 = require("uuid");
|
|
|
48
48
|
var utils_1 = require("./utils");
|
|
49
49
|
var pkg = require('../package.json');
|
|
50
50
|
var cliVersion = pkg.version;
|
|
51
|
-
var frameworks = ['react', 'vue'];
|
|
51
|
+
var frameworks = ['react', 'vue', 'vue3'];
|
|
52
52
|
var jQuery = 'jQuery';
|
|
53
53
|
var templates = ['umi'];
|
|
54
54
|
/** 项目类型 */
|
package/lib/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxelms/create-plugin-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"main": "./bin/index.js",
|
|
5
5
|
"author": "jackc_001",
|
|
6
6
|
"bin": {
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"typescript": "4.7.3"
|
|
48
48
|
},
|
|
49
49
|
"gitHead": "d034472e8762a7b6ff01bafec131911ded8b2d51"
|
|
50
|
-
}
|
|
50
|
+
}
|
|
@@ -5,9 +5,9 @@ import styles from './index.less'
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
const Home = () => {
|
|
8
|
-
/**
|
|
8
|
+
/** 平台传递给微应用的状态数据 */
|
|
9
9
|
const props = React.useContext(MasterContext)
|
|
10
|
-
/** 当组件运行在
|
|
10
|
+
/** 当组件运行在 系统应用时才存在 props 属性 */
|
|
11
11
|
const { configurations } = props || {}
|
|
12
12
|
/** configurations 是组件的配置项信息 */
|
|
13
13
|
const {
|
|
@@ -5,7 +5,7 @@ import './style.less';
|
|
|
5
5
|
const prefixCls = 'maxelms-customize-component-<%= timestamp %>'
|
|
6
6
|
|
|
7
7
|
const App = (props: any) => {
|
|
8
|
-
/** 当组件运行在
|
|
8
|
+
/** 当组件运行在 系统应用时才存在 props 属性 */
|
|
9
9
|
const { configurations, value, onChange, readOnly } = props
|
|
10
10
|
/** configurations 是组件的配置项信息 */
|
|
11
11
|
const {
|
|
@@ -8,7 +8,7 @@ const prefixCls = 'maxelms-customize-component-<%= timestamp %>'
|
|
|
8
8
|
|
|
9
9
|
const App = (props: any) => {
|
|
10
10
|
const masterProps = useMasterProps();
|
|
11
|
-
/** 当组件运行在
|
|
11
|
+
/** 当组件运行在 系统应用时才存在 props 属性 */
|
|
12
12
|
const { configurations, value, onChange, readOnly } = masterProps
|
|
13
13
|
/** configurations 是组件的配置项信息 */
|
|
14
14
|
const {
|
|
@@ -5,7 +5,7 @@ import './style.less';
|
|
|
5
5
|
const prefixCls = 'maxelms-customize-component-<%= timestamp %>'
|
|
6
6
|
|
|
7
7
|
const App = (props: any) => {
|
|
8
|
-
/** 当组件运行在
|
|
8
|
+
/** 当组件运行在 系统应用时才存在 props 属性 */
|
|
9
9
|
/** configurations 是组件的配置项信息 */
|
|
10
10
|
const { configurations } = props
|
|
11
11
|
const {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="app">
|
|
3
|
-
<!-- 集成在
|
|
3
|
+
<!-- 集成在 系统 中时会走该逻辑 -->
|
|
4
4
|
<span v-if="buttonName" @click="visible = true">{{buttonName}}</span>
|
|
5
|
-
<!-- 由于独立开发时没有
|
|
5
|
+
<!-- 由于独立开发时没有 系统 传递的上下文数据,会渲染一个按钮辅助开发 -->
|
|
6
6
|
<button v-if="!buttonName" @click="visible = true">自定义按钮</button>
|
|
7
7
|
<el-dialog
|
|
8
8
|
append-to-body
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# vue-project
|
|
2
|
+
|
|
3
|
+
This template should help get you started developing with Vue 3 in Vite.
|
|
4
|
+
|
|
5
|
+
## Recommended IDE Setup
|
|
6
|
+
|
|
7
|
+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
|
8
|
+
|
|
9
|
+
## Type Support for `.vue` Imports in TS
|
|
10
|
+
|
|
11
|
+
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
|
12
|
+
|
|
13
|
+
## Customize configuration
|
|
14
|
+
|
|
15
|
+
See [Vite Configuration Reference](https://vite.dev/config/).
|
|
16
|
+
|
|
17
|
+
## Project Setup
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
pnpm install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Compile and Hot-Reload for Development
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
pnpm dev
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Type-Check, Compile and Minify for Production
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pnpm build
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Run Unit Tests with [Vitest](https://vitest.dev/)
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
pnpm test:unit
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Lint with [ESLint](https://eslint.org/)
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
pnpm lint
|
|
45
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import pluginVue from 'eslint-plugin-vue'
|
|
2
|
+
import vueTsEslintConfig from '@vue/eslint-config-typescript'
|
|
3
|
+
import pluginVitest from '@vitest/eslint-plugin'
|
|
4
|
+
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
{
|
|
8
|
+
name: 'app/files-to-lint',
|
|
9
|
+
files: ['**/*.{ts,mts,tsx,vue}'],
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
name: 'app/files-to-ignore',
|
|
14
|
+
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
...pluginVue.configs['flat/essential'],
|
|
18
|
+
...vueTsEslintConfig(),
|
|
19
|
+
|
|
20
|
+
{
|
|
21
|
+
...pluginVitest.configs.recommended,
|
|
22
|
+
files: ['src/**/__tests__/*'],
|
|
23
|
+
},
|
|
24
|
+
skipFormatting,
|
|
25
|
+
]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Maxelms MicroApp</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="micro-app" style="height: 100%"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= pluginName %>",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "vite",
|
|
8
|
+
"build": "run-p type-check \"build-only {@}\" -- && maxelms-plugin-cli -c",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"test:unit": "vitest",
|
|
11
|
+
"build-only": "vite build",
|
|
12
|
+
"type-check": "vue-tsc --build",
|
|
13
|
+
"lint": "eslint . --fix",
|
|
14
|
+
"format": "prettier --write src/"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@esbuild/darwin-arm64": "0.24.0",
|
|
18
|
+
"@rollup/rollup-darwin-arm64": "4.28.1",
|
|
19
|
+
"pinia": "2.2.6",
|
|
20
|
+
"vue": "3.5.13",
|
|
21
|
+
"vue-router": "4.4.5"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@maxelms/create-plugin-cli": "<%= cliVersion %>",
|
|
25
|
+
"@tsconfig/node22": "22.0.0",
|
|
26
|
+
"@types/jsdom": "21.1.7",
|
|
27
|
+
"@types/node": "22.9.3",
|
|
28
|
+
"@vitejs/plugin-vue": "5.2.1",
|
|
29
|
+
"@vitejs/plugin-vue-jsx": "4.1.1",
|
|
30
|
+
"@vitest/eslint-plugin": "1.1.10",
|
|
31
|
+
"@vue/eslint-config-prettier": "10.1.0",
|
|
32
|
+
"@vue/eslint-config-typescript": "14.1.3",
|
|
33
|
+
"@vue/test-utils": "2.4.6",
|
|
34
|
+
"@vue/tsconfig": "0.7.0",
|
|
35
|
+
"eslint": "9.14.0",
|
|
36
|
+
"eslint-plugin-vue": "9.30.0",
|
|
37
|
+
"jsdom": "25.0.1",
|
|
38
|
+
"npm-run-all2": "7.0.1",
|
|
39
|
+
"prettier": "3.3.3",
|
|
40
|
+
"typescript": "~5.6.3",
|
|
41
|
+
"vite": "6.0.1",
|
|
42
|
+
"vite-plugin-vue-devtools": "7.6.5",
|
|
43
|
+
"vitest": "2.1.5",
|
|
44
|
+
"vue-tsc": "2.1.10"
|
|
45
|
+
}
|
|
46
|
+
}
|