boke-devops 0.0.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/.vscode/settings.json +2 -0
  2. package/lerna.json +4 -0
  3. package/package.json +43 -0
  4. package/packages/boke-devops-vue/.eslintrc.cjs +22 -0
  5. package/packages/boke-devops-vue/README.md +45 -0
  6. package/packages/boke-devops-vue/demo/App.vue +62 -0
  7. package/packages/boke-devops-vue/demo/main.ts +7 -0
  8. package/packages/boke-devops-vue/package-lock.json +13513 -0
  9. package/packages/boke-devops-vue/package.json +59 -0
  10. package/packages/boke-devops-vue/pnpm-lock.yaml +6063 -0
  11. package/packages/boke-devops-vue/src/AegisUser/__tests__/Avatar.test.js +18 -0
  12. package/packages/boke-devops-vue/src/AegisUser/__tests__/__snapshots__/Avatar.test.js.snap +60 -0
  13. package/packages/boke-devops-vue/src/AegisUser/multiple-user-select.vue +190 -0
  14. package/packages/boke-devops-vue/src/AegisUser/store.ts +23 -0
  15. package/packages/boke-devops-vue/src/AegisUser/user-avatar-group.vue +76 -0
  16. package/packages/boke-devops-vue/src/AegisUser/user-avatar.vue +347 -0
  17. package/packages/boke-devops-vue/src/Microapp/MicroAppProvider.vue +50 -0
  18. package/packages/boke-devops-vue/src/Provider/Provider.vue +22 -0
  19. package/packages/boke-devops-vue/src/Provider/store.ts +23 -0
  20. package/packages/boke-devops-vue/src/global.d.ts +43 -0
  21. package/packages/boke-devops-vue/src/index.ts +39 -0
  22. package/packages/boke-devops-vue/src/style/variables.less +79 -0
  23. package/packages/boke-devops-vue/tsconfig.json +34 -0
  24. package/packages/boke-devops-vue/tsconfig.web.json +20 -0
  25. package/packages/boke-devops-vue/types/AegisUser/multiple-user-select.vue.d.ts +97 -0
  26. package/packages/boke-devops-vue/types/AegisUser/store.d.ts +7 -0
  27. package/packages/boke-devops-vue/types/AegisUser/user-avatar-group.vue.d.ts +44 -0
  28. package/packages/boke-devops-vue/types/AegisUser/user-avatar.vue.d.ts +217 -0
  29. package/packages/boke-devops-vue/types/Microapp/MicroAppProvider.vue.d.ts +39 -0
  30. package/packages/boke-devops-vue/types/Provider/Provider.vue.d.ts +63 -0
  31. package/packages/boke-devops-vue/types/Provider/store.d.ts +15 -0
  32. package/packages/boke-devops-vue/types/index.d.ts +13 -0
  33. package/packages/boke-devops-vue/types/store.d.ts +12 -0
  34. package/packages/boke-devops-vue/vite.config.ts +90 -0
  35. package/packages/boke-docs/.dumirc.ts +64 -0
  36. package/packages/boke-docs/.eslintrc.js +14 -0
  37. package/packages/boke-docs/.fatherrc.ts +7 -0
  38. package/packages/boke-docs/README.md +1 -0
  39. package/packages/boke-docs/docs/components/Avatar/demo/normal.vue +25 -0
  40. package/packages/boke-docs/docs/components/Avatar/demo/with_provider.vue +38 -0
  41. package/packages/boke-docs/docs/components/Avatar/index.md +10 -0
  42. package/packages/boke-docs/docs/components/UserSelect/demo/normal.vue +34 -0
  43. package/packages/boke-docs/docs/components/UserSelect/demo/with_provider.vue +40 -0
  44. package/packages/boke-docs/docs/components/UserSelect/index.md +12 -0
  45. package/packages/boke-docs/docs/components/index.md +126 -0
  46. package/packages/boke-docs/docs/framework-test/external/App.vue +303 -0
  47. package/packages/boke-docs/docs/framework-test/index.md +96 -0
  48. package/packages/boke-docs/docs/index.md +50 -0
  49. package/packages/boke-docs/node_modules/.bin/acorn +17 -0
  50. package/packages/boke-docs/node_modules/.bin/acorn.CMD +12 -0
  51. package/packages/boke-docs/node_modules/.bin/acorn.ps1 +41 -0
  52. package/packages/boke-docs/node_modules/.bin/browserslist +17 -0
  53. package/packages/boke-docs/node_modules/.bin/browserslist.CMD +12 -0
  54. package/packages/boke-docs/node_modules/.bin/browserslist.ps1 +41 -0
  55. package/packages/boke-docs/node_modules/.bin/dumi +17 -0
  56. package/packages/boke-docs/node_modules/.bin/dumi.CMD +12 -0
  57. package/packages/boke-docs/node_modules/.bin/dumi.ps1 +41 -0
  58. package/packages/boke-docs/node_modules/.bin/eslint +17 -0
  59. package/packages/boke-docs/node_modules/.bin/eslint.CMD +12 -0
  60. package/packages/boke-docs/node_modules/.bin/eslint.ps1 +41 -0
  61. package/packages/boke-docs/node_modules/.bin/prettier +17 -0
  62. package/packages/boke-docs/node_modules/.bin/prettier.CMD +12 -0
  63. package/packages/boke-docs/node_modules/.bin/prettier.ps1 +41 -0
  64. package/packages/boke-docs/node_modules/.bin/stylelint +17 -0
  65. package/packages/boke-docs/node_modules/.bin/stylelint.CMD +12 -0
  66. package/packages/boke-docs/node_modules/.bin/stylelint.ps1 +41 -0
  67. package/packages/boke-docs/node_modules/.bin/tsc +17 -0
  68. package/packages/boke-docs/node_modules/.bin/tsc.CMD +12 -0
  69. package/packages/boke-docs/node_modules/.bin/tsc.ps1 +41 -0
  70. package/packages/boke-docs/node_modules/.bin/tsserver +17 -0
  71. package/packages/boke-docs/node_modules/.bin/tsserver.CMD +12 -0
  72. package/packages/boke-docs/node_modules/.bin/tsserver.ps1 +41 -0
  73. package/packages/boke-docs/node_modules/.bin/vite +17 -0
  74. package/packages/boke-docs/node_modules/.bin/vite.CMD +12 -0
  75. package/packages/boke-docs/node_modules/.bin/vite.ps1 +41 -0
  76. package/packages/boke-docs/node_modules/.bin/webpack +17 -0
  77. package/packages/boke-docs/node_modules/.bin/webpack.CMD +12 -0
  78. package/packages/boke-docs/node_modules/.bin/webpack.ps1 +41 -0
  79. package/packages/boke-docs/package.json +38 -0
  80. package/packages/boke-docs/pnpm-lock.yaml +11506 -0
  81. package/packages/boke-docs/tsconfig.json +14 -0
  82. package/packages/boke-docs/tsconfig.vue.json +10 -0
  83. package/packages/boke-js-bridge/es/child.d.ts +27 -0
  84. package/packages/boke-js-bridge/es/child.js +144 -0
  85. package/packages/boke-js-bridge/es/index.d.ts +3 -0
  86. package/packages/boke-js-bridge/es/index.js +3 -0
  87. package/packages/boke-js-bridge/es/parent.d.ts +24 -0
  88. package/packages/boke-js-bridge/es/parent.js +71 -0
  89. package/packages/boke-js-bridge/es/utils.d.ts +2 -0
  90. package/packages/boke-js-bridge/es/utils.js +6 -0
  91. package/packages/boke-js-bridge/package-lock.json +2028 -0
  92. package/packages/boke-js-bridge/package.json +35 -0
  93. package/packages/boke-js-bridge/readme.md +11 -0
  94. package/packages/boke-js-bridge/src/child.ts +174 -0
  95. package/packages/boke-js-bridge/src/index.ts +3 -0
  96. package/packages/boke-js-bridge/src/parent.ts +92 -0
  97. package/packages/boke-js-bridge/src/utils.ts +15 -0
  98. package/packages/boke-js-bridge/tsconfig.json +26 -0
  99. package/packages/boke-js-bridge/typings.d.ts +4 -0
  100. package/packages/boke-js-bridge/umd/child.js +156 -0
  101. package/packages/boke-js-bridge/umd/index.js +18 -0
  102. package/packages/boke-js-bridge/umd/parent.js +84 -0
  103. package/packages/boke-js-bridge/umd/utils.js +18 -0
  104. package/packages/test/Provider-test.vue +85 -0
  105. package/pnpm-workspace.yaml +2 -0
  106. package/scripts/configs.mjs +52 -0
  107. package/scripts/index.mjs +43 -0
  108. package/scripts/release.mjs +16 -0
  109. package/test-setup.js +24 -0
  110. package/vite.config.ts +21 -0
  111. package/vitest.config.js +22 -0
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div>
3
+ <slot name="default"></slot>
4
+ </div>
5
+ </template>
6
+ <script setup lang="tsx">
7
+
8
+ const props = defineProps({
9
+ "avatarConfig": {
10
+ type: Object,
11
+ }
12
+ })
13
+
14
+ if (props.avatarConfig) {
15
+ console.log(props.avatarConfig)
16
+
17
+ }
18
+
19
+ // import pb from "protobufjs";
20
+ // import base64 from "base64-js";
21
+ // const jsonDescriptor = {
22
+ // nested: {
23
+ // UserInfo: {
24
+ // fields: {
25
+ // user_id: {
26
+ // type: "int32",
27
+ // id: 1,
28
+ // },
29
+ // name: {
30
+ // type: "string",
31
+ // id: 2,
32
+ // },
33
+ // fs_open_id: {
34
+ // type: "string",
35
+ // id: 3,
36
+ // },
37
+ // open_id: {
38
+ // type: "string",
39
+ // id: 4,
40
+ // },
41
+ // dept_name: {
42
+ // type: "string",
43
+ // id: 5,
44
+ // },
45
+ // avatar: {
46
+ // type: "string",
47
+ // id: 6,
48
+ // },
49
+ // },
50
+ // },
51
+ // UserDataList: {
52
+ // fields: {
53
+ // user_info: {
54
+ // rule: "repeated",
55
+ // type: "UserInfo",
56
+ // id: 1,
57
+ // },
58
+ // },
59
+ // },
60
+ // },
61
+ // };
62
+ // var root = pb.Root.fromJSON(jsonDescriptor);
63
+ // fetch("http://172.18.12.155:8000/api/users-pb/normal-pb/?page=1").then(
64
+ // (res) => {
65
+ // res.arrayBuffer().then((buffer0) => {
66
+ // const base64String = btoa(
67
+ // new Uint8Array(buffer0).reduce(
68
+ // (data, byte) => data + String.fromCharCode(byte),
69
+ // ""
70
+ // )
71
+ // );
72
+ // const buffer = atob(base64String);
73
+ // const Response = root.lookupType("UserDataList");
74
+ // let message = Response.decode(new Uint8Array(buffer));
75
+ // const object = Response.toObject(message, {
76
+ // defaults: true,
77
+ // arrays: true, // populates empty arrays (repeated fields) even if defaults=false
78
+ // objects: false, // populates empty objects (map fields) even if defaults=false
79
+ // oneofs: false, // includes virtual oneof fields set to the present field's name
80
+ // });
81
+ // console.log("%csrc\Provider.vue:63 object", "color: #007acc;", object);
82
+ // });
83
+ // }
84
+ // );
85
+ </script>
@@ -0,0 +1,2 @@
1
+ packages:
2
+ - 'packages/*'
@@ -0,0 +1,52 @@
1
+ import process from 'node:process';
2
+ import { loadConfig } from 'c12';
3
+
4
+ const defaultOptions = {
5
+ cwd: process.cwd(),
6
+ cleanupDirs: [
7
+ '**/dist',
8
+ '**/package-lock.json',
9
+ '**/yarn.lock',
10
+ '**/pnpm-lock.yaml',
11
+ '**/node_modules',
12
+ '!node_modules/**'
13
+ ],
14
+ gitCommitTypes: [
15
+ ['feat', 'A new feature'],
16
+ ['fix', 'A bug fix'],
17
+ ['refactor', 'A code change that neither fixes a bug nor adds a feature'],
18
+ ['opt', 'A code change that improves performance'],
19
+ ['docs', 'Documentation only changes'],
20
+ ['style', 'Changes that do not affect the meaning of the code'],
21
+ ['test', 'Adding missing tests or correcting existing tests'],
22
+ ['build', 'Changes that affect the build system or external dependencies'],
23
+ ['ci', 'Changes to our CI configuration files and scripts'],
24
+ ['chore', "Other changes that don't modify src or test files"],
25
+ ['revert', 'Reverts a previous commit']
26
+ ],
27
+ gitCommitScopes: [
28
+ ['projects', 'project'],
29
+ ['components', 'components'],
30
+ ['hooks', 'hook functions'],
31
+ ['utils', 'utils functions'],
32
+ ['types', 'TS declaration'],
33
+ ['styles', 'style'],
34
+ ['deps', 'project dependencies'],
35
+ ['release', 'release project'],
36
+ ['other', 'other changes']
37
+ ],
38
+ ncuCommandArgs: ['--deep', '-u'],
39
+ changelogOptions: {}
40
+ };
41
+
42
+ export async function loadCliOptions(overrides, cwd = process.cwd()) {
43
+ const { config } = await loadConfig({
44
+ name: 'soybean',
45
+ defaults: defaultOptions,
46
+ overrides,
47
+ cwd,
48
+ packageJson: true
49
+ });
50
+
51
+ return config;
52
+ }
@@ -0,0 +1,43 @@
1
+ import { versionBump } from 'bumpp';
2
+ import cac from 'cac';
3
+ import { blue, lightGreen } from 'kolorist';
4
+ // import { version } from './package.json';
5
+ import {loadCliOptions}from "./configs.mjs"
6
+ import { release } from './release.mjs';
7
+ export async function setupCli() {
8
+ const cliOptions = await loadCliOptions();
9
+
10
+ const cli = cac(blue('soybean-admin'));
11
+
12
+ cli
13
+ .version(lightGreen("1.0.0"))
14
+ .option(
15
+ '-e, --execute [command]',
16
+ "Execute additional command after bumping and before git commit. Defaults to 'npx soy changelog'"
17
+ )
18
+ .option('-p, --push', 'Indicates whether to push the git commit and tag')
19
+ .option('-t, --total', 'Generate changelog by total tags')
20
+ .option(
21
+ '-c, --cleanupDir <dir>',
22
+ 'The glob pattern of dirs to cleanup, If not set, it will use the default value, Multiple values use "," to separate them'
23
+ )
24
+ .help();
25
+
26
+
27
+ const commands = {
28
+ release: {
29
+ desc: 'release: update version, generate changelog, commit code',
30
+ action: async args => {
31
+ await release(args?.execute, args?.push);
32
+ }
33
+ },
34
+ };
35
+
36
+ for (const [command, { desc, action }] of Object.entries(commands)) {
37
+ cli.command(command, lightGreen(desc)).action(action);
38
+ }
39
+
40
+ cli.parse();
41
+ }
42
+
43
+ setupCli();
@@ -0,0 +1,16 @@
1
+ import { versionBump } from 'bumpp';
2
+ import cac from 'cac';
3
+ import { blue, lightGreen } from 'kolorist';
4
+ // import { version } from './package.json';
5
+ import {loadCliOptions}from "./configs.mjs"
6
+
7
+ export async function release(execute = 'pnpm sa changelog', push = true) {
8
+ await versionBump({
9
+ files: ['**/package.json', '!**/node_modules'],
10
+ execute,
11
+ all: true,
12
+ tag: true,
13
+ commit: 'release: release v%s',
14
+ push
15
+ });
16
+ }
package/test-setup.js ADDED
@@ -0,0 +1,24 @@
1
+ import { config } from '@vue/test-utils';
2
+ import { createApp } from 'vue/dist/vue.runtime.global.js';
3
+ import { createRouter, createWebHistory } from 'vue-router';
4
+ import { renderToString } from 'vue/server-renderer';
5
+ import createFetchMock from 'vitest-fetch-mock';
6
+ import { vi } from 'vitest';
7
+ import TDesign from './packages/boke-devops-ui/src/index';
8
+
9
+ const fetchMock = createFetchMock(vi);
10
+ fetchMock.enableMocks();
11
+ const router = createRouter({
12
+ history: createWebHistory(),
13
+ routes: [],
14
+ });
15
+
16
+ config.global.plugins = [TDesign];
17
+
18
+ config.global.createSSRApp = (comp) => {
19
+ const app = createApp(comp);
20
+ app.config.globalProperties.$route = {};
21
+ app.use(TDesign);
22
+ app.use(router);
23
+ return renderToString(app);
24
+ };
package/vite.config.ts ADDED
@@ -0,0 +1,21 @@
1
+ /// <reference types="vitest" />
2
+ import { resolve } from "path";
3
+ import { defineConfig } from "vitest/config";
4
+ import Vue from '@vitejs/plugin-vue'
5
+ import VueJsx from '@vitejs/plugin-vue-jsx'
6
+ import VueMacros from 'unplugin-vue-macros/vite'
7
+
8
+ // https://vitejs.dev/config/
9
+ export default defineConfig({
10
+
11
+ plugins: [
12
+ VueMacros({
13
+ setupComponent: true,
14
+ setupSFC: true,
15
+ plugins: {
16
+ vue: Vue(),
17
+ vueJsx: VueJsx(),
18
+ },
19
+ }),
20
+ ],
21
+ });
@@ -0,0 +1,22 @@
1
+ import { fileURLToPath } from 'node:url'
2
+ import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
3
+ import viteConfig from './vite.config'
4
+
5
+ export default mergeConfig(
6
+ viteConfig,
7
+
8
+ defineConfig({
9
+ chainWebpack: (config) => {
10
+ config.resolve.symlinks(false)
11
+ },
12
+ test: {
13
+ testTransformMode:"web",
14
+ environment: 'jsdom',
15
+ // setupFiles: resolve(__dirname, "./test-setup.js"),
16
+ exclude: [...configDefaults.exclude, 'e2e/**'],
17
+ root: fileURLToPath(new URL('./', import.meta.url)),
18
+ globals:true,
19
+ disableConsoleIntercept:true
20
+ }
21
+ })
22
+ )