@qlover/create-app 0.0.4 → 0.1.2

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.
Files changed (135) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +5 -0
  3. package/bin/create-app.js +7 -9
  4. package/dist/cjs/index.d.ts +39 -15
  5. package/dist/cjs/index.js +1 -1
  6. package/dist/es/index.d.ts +39 -15
  7. package/dist/es/index.js +1 -1
  8. package/package.json +4 -2
  9. package/templates/node-lib/package.json +34 -0
  10. package/templates/node-lib/tsconfig.json +5 -0
  11. package/templates/pack-app/package.json +5 -7
  12. package/templates/{fe-react → react-app}/config/i18n.ts +1 -1
  13. package/templates/{fe-react → react-app}/lib/fe-react-theme/index.ts +1 -1
  14. package/templates/{fe-react → react-app}/lib/fe-react-theme/tw-generator.js +0 -1
  15. package/templates/{fe-react → react-app}/lib/openAiApi/index.ts +1 -1
  16. package/templates/{fe-react → react-app}/package.json +1 -1
  17. package/templates/{fe-react → react-app}/postcss.config.js +3 -3
  18. package/templates/{fe-react → react-app}/src/containers/globals.ts +1 -1
  19. package/templates/{fe-react → react-app}/src/containers/index.ts +1 -1
  20. package/templates/{fe-react → react-app}/src/hooks/useStrictEffect.ts +7 -4
  21. package/templates/{fe-react → react-app}/src/services/controllers/UserController.ts +1 -1
  22. package/templates/{fe-react → react-app}/src/services/feApi/FeApi.ts +1 -1
  23. package/templates/{fe-react → react-app}/src/services/feApi/FeApiMockPlugin.ts +3 -1
  24. package/templates/{fe-react → react-app}/src/services/feApi/FeApiType.ts +0 -1
  25. package/templates/{fe-react → react-app}/src/services/pageProcesser/PageProcesser.ts +1 -1
  26. package/templates/{fe-react → react-app}/src/utils/datetime.ts +10 -5
  27. package/templates/react-app/src/vite-env.d.ts +1 -0
  28. package/templates/react-vite-lib/.gitignore.template +27 -0
  29. package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/__tests__/Sum.test.ts +1 -1
  30. package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/eslint.config.js +12 -12
  31. package/templates/react-vite-lib/src/vite-env.d.ts +1 -0
  32. package/templates/fe-react/src/vite-env.d.ts +0 -1
  33. package/templates/pack-app/packages/browser/__tests__/calc.test.ts +0 -9
  34. package/templates/pack-app/packages/browser/package.json +0 -11
  35. package/templates/pack-app/packages/browser/rollup.config.js +0 -70
  36. package/templates/pack-app/packages/browser/src/calc.ts +0 -3
  37. package/templates/pack-app/packages/browser/src/index.ts +0 -1
  38. package/templates/pack-app/packages/browser/tsconfig.json +0 -15
  39. package/templates/pack-app/packages/node/package.json +0 -11
  40. package/templates/pack-app/packages/node/tsconfig.json +0 -17
  41. package/templates/pack-app/packages/react-vite-lib/src/vite-env.d.ts +0 -1
  42. /package/templates/{pack-app/packages/node → node-lib}/__tests__/readJson.test.ts +0 -0
  43. /package/templates/{pack-app/packages/node → node-lib}/rollup.config.js +0 -0
  44. /package/templates/{pack-app/packages/node → node-lib}/src/index.ts +0 -0
  45. /package/templates/{pack-app/packages/node → node-lib}/src/readJson.ts +0 -0
  46. /package/templates/{fe-react → react-app}/.env +0 -0
  47. /package/templates/{fe-react → react-app}/.gitignore.template +0 -0
  48. /package/templates/{fe-react → react-app}/README.md +0 -0
  49. /package/templates/{fe-react → react-app}/config/app.common.ts +0 -0
  50. /package/templates/{fe-react → react-app}/config/app.router.json +0 -0
  51. /package/templates/{fe-react → react-app}/config/feapi.mock.json +0 -0
  52. /package/templates/{fe-react → react-app}/config/theme.json +0 -0
  53. /package/templates/{fe-react → react-app}/eslint.config.js +0 -0
  54. /package/templates/{fe-react → react-app}/index.html +0 -0
  55. /package/templates/{fe-react → react-app}/lib/fe-react-controller/FeController.ts +0 -0
  56. /package/templates/{fe-react → react-app}/lib/fe-react-controller/index.ts +0 -0
  57. /package/templates/{fe-react → react-app}/lib/fe-react-controller/useController.ts +0 -0
  58. /package/templates/{fe-react → react-app}/lib/fe-react-theme/ThemeController.ts +0 -0
  59. /package/templates/{fe-react → react-app}/lib/fe-react-theme/ThemeStateGetter.ts +0 -0
  60. /package/templates/{fe-react → react-app}/lib/fe-react-theme/type.ts +0 -0
  61. /package/templates/{fe-react → react-app}/lib/openAiApi/OpenAIAuthPlugin.ts +0 -0
  62. /package/templates/{fe-react → react-app}/lib/openAiApi/OpenAIClient.ts +0 -0
  63. /package/templates/{fe-react → react-app}/lib/openAiApi/StreamProcessor.ts +0 -0
  64. /package/templates/{fe-react → react-app}/lib/request-common-plugin/index.ts +0 -0
  65. /package/templates/{fe-react → react-app}/lib/tw-root10px/index.css +0 -0
  66. /package/templates/{fe-react → react-app}/lib/tw-root10px/index.js +0 -0
  67. /package/templates/{fe-react → react-app}/public/locales/en/about.json +0 -0
  68. /package/templates/{fe-react → react-app}/public/locales/en/common.json +0 -0
  69. /package/templates/{fe-react → react-app}/public/locales/en/executor.json +0 -0
  70. /package/templates/{fe-react → react-app}/public/locales/en/home.json +0 -0
  71. /package/templates/{fe-react → react-app}/public/locales/en/jsonStorage.json +0 -0
  72. /package/templates/{fe-react → react-app}/public/locales/en/login.json +0 -0
  73. /package/templates/{fe-react → react-app}/public/locales/en/request.json +0 -0
  74. /package/templates/{fe-react → react-app}/public/locales/zh/about.json +0 -0
  75. /package/templates/{fe-react → react-app}/public/locales/zh/common.json +0 -0
  76. /package/templates/{fe-react → react-app}/public/locales/zh/executor.json +0 -0
  77. /package/templates/{fe-react → react-app}/public/locales/zh/home.json +0 -0
  78. /package/templates/{fe-react → react-app}/public/locales/zh/jsonStorage.json +0 -0
  79. /package/templates/{fe-react → react-app}/public/locales/zh/login.json +0 -0
  80. /package/templates/{fe-react → react-app}/public/locales/zh/request.json +0 -0
  81. /package/templates/{fe-react → react-app}/public/logo.svg +0 -0
  82. /package/templates/{fe-react → react-app}/src/App.tsx +0 -0
  83. /package/templates/{fe-react → react-app}/src/assets/react.svg +0 -0
  84. /package/templates/{fe-react → react-app}/src/components/Loading.tsx +0 -0
  85. /package/templates/{fe-react → react-app}/src/components/LocaleLink.tsx +0 -0
  86. /package/templates/{fe-react → react-app}/src/components/ProcessProvider.tsx +0 -0
  87. /package/templates/{fe-react → react-app}/src/components/ThemeSwitcher.tsx +0 -0
  88. /package/templates/{fe-react → react-app}/src/containers/context/BaseRouteContext.ts +0 -0
  89. /package/templates/{fe-react → react-app}/src/containers/context/BaseRouteProvider.tsx +0 -0
  90. /package/templates/{fe-react → react-app}/src/hooks/useLanguageGuard.ts +0 -0
  91. /package/templates/{fe-react → react-app}/src/main.tsx +0 -0
  92. /package/templates/{fe-react → react-app}/src/pages/404.tsx +0 -0
  93. /package/templates/{fe-react → react-app}/src/pages/500.tsx +0 -0
  94. /package/templates/{fe-react → react-app}/src/pages/auth/Layout.tsx +0 -0
  95. /package/templates/{fe-react → react-app}/src/pages/auth/Login.tsx +0 -0
  96. /package/templates/{fe-react → react-app}/src/pages/auth/Register.tsx +0 -0
  97. /package/templates/{fe-react → react-app}/src/pages/base/About.tsx +0 -0
  98. /package/templates/{fe-react → react-app}/src/pages/base/Executor.tsx +0 -0
  99. /package/templates/{fe-react → react-app}/src/pages/base/Home.tsx +0 -0
  100. /package/templates/{fe-react → react-app}/src/pages/base/JSONStorage.tsx +0 -0
  101. /package/templates/{fe-react → react-app}/src/pages/base/Layout.tsx +0 -0
  102. /package/templates/{fe-react → react-app}/src/pages/base/RedirectPathname.tsx +0 -0
  103. /package/templates/{fe-react → react-app}/src/pages/base/Request.tsx +0 -0
  104. /package/templates/{fe-react → react-app}/src/pages/base/components/BaseHeader.tsx +0 -0
  105. /package/templates/{fe-react → react-app}/src/pages/index.tsx +0 -0
  106. /package/templates/{fe-react → react-app}/src/services/controllers/ExecutorController.ts +0 -0
  107. /package/templates/{fe-react → react-app}/src/services/controllers/JSONStorageController.ts +0 -0
  108. /package/templates/{fe-react → react-app}/src/services/controllers/RequestController.ts +0 -0
  109. /package/templates/{fe-react → react-app}/src/services/controllers/RouterController.ts +0 -0
  110. /package/templates/{fe-react → react-app}/src/services/feApi/index.ts +0 -0
  111. /package/templates/{fe-react → react-app}/src/services/i18n/index.ts +0 -0
  112. /package/templates/{fe-react → react-app}/src/services/pageProcesser/index.ts +0 -0
  113. /package/templates/{fe-react → react-app}/src/styles/css/index.css +0 -0
  114. /package/templates/{fe-react → react-app}/src/styles/css/page.css +0 -0
  115. /package/templates/{fe-react → react-app}/src/styles/css/tailwind.css +0 -0
  116. /package/templates/{fe-react → react-app}/src/types/Page.ts +0 -0
  117. /package/templates/{fe-react → react-app}/src/types/UIDependenciesInterface.ts +0 -0
  118. /package/templates/{fe-react → react-app}/src/types/global.d.ts +0 -0
  119. /package/templates/{fe-react → react-app}/src/utils/RequestLogger.ts +0 -0
  120. /package/templates/{fe-react → react-app}/src/utils/thread.ts +0 -0
  121. /package/templates/{fe-react → react-app}/tailwind.config.js +0 -0
  122. /package/templates/{fe-react → react-app}/tsconfig.app.json +0 -0
  123. /package/templates/{fe-react → react-app}/tsconfig.json +0 -0
  124. /package/templates/{fe-react → react-app}/tsconfig.node.json +0 -0
  125. /package/templates/{fe-react → react-app}/vite.config.ts +0 -0
  126. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/README.md +0 -0
  127. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/__tests__/Text.test.tsx +0 -0
  128. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/index.html +0 -0
  129. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/package.json +0 -0
  130. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/public/vite.svg +0 -0
  131. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/src/calc.ts +0 -0
  132. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/src/commponents/Text.tsx +0 -0
  133. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/src/index.ts +0 -0
  134. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/tsconfig.json +0 -0
  135. /package/templates/{pack-app/packages/react-vite-lib → react-vite-lib}/vite.config.ts +0 -0
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,9 +0,0 @@
1
- import { calc } from '../src/calc';
2
-
3
- describe('calc 函数测试', () => {
4
- it('应该返回两个数字的和', () => {
5
- expect(calc(1, 2)).toBe(3);
6
- expect(calc(-1, 1)).toBe(0);
7
- expect(calc(0, 0)).toBe(0);
8
- });
9
- });
@@ -1,11 +0,0 @@
1
- {
2
- "name": "@qlover/pack-app-browser",
3
- "version": "0.0.1",
4
- "private": true,
5
- "main": "index.ts",
6
- "type": "module",
7
- "scripts": {
8
- "build": "rollup -c",
9
- "test": "jest"
10
- }
11
- }
@@ -1,70 +0,0 @@
1
- import resolve from '@rollup/plugin-node-resolve';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import typescript from 'rollup-plugin-typescript2';
4
- import dts from 'rollup-plugin-dts';
5
- import terser from '@rollup/plugin-terser';
6
- import { searchEnv } from '@qlover/fe-scripts';
7
- import del from 'rollup-plugin-delete';
8
- import { readFileSync } from 'fs';
9
-
10
- const tsConfig = JSON.parse(readFileSync('./tsconfig.json', 'utf-8'));
11
- const env = searchEnv({ logger: console });
12
- const NODE_ENV = env.get('NODE_ENV');
13
- const isProduction = NODE_ENV === 'production';
14
- console.log('Enveronment is', NODE_ENV);
15
-
16
- const buildDir = tsConfig.compilerOptions.outDir;
17
-
18
- /**
19
- * @param {{ entry: string, formats: string[], external: string[], target: string, clean: boolean }} options
20
- * @returns {import('rollup').RollupOptions[]}
21
- */
22
- function createBuilder({ target, entry, formats, external, clean, umdName }) {
23
- target = target || `${buildDir}/${entry}`;
24
-
25
- /** @type {import('rollup').OutputOptions[]} */
26
- const outputs = formats.map((format) => ({
27
- file: `${target}/index.${format}.js`,
28
- format,
29
- name: umdName,
30
- sourcemap: !isProduction
31
- }));
32
-
33
- return [
34
- {
35
- input: `./${entry}/index.ts`,
36
- output: outputs,
37
- plugins: [
38
- clean && del({ targets: `${buildDir}/*` }),
39
- resolve({
40
- preferBuiltins: false
41
- }),
42
- commonjs(),
43
- typescript({ tsconfig: './tsconfig.json' }),
44
- isProduction && terser()
45
- ],
46
- external: external
47
- },
48
- {
49
- input: `./${entry}/index.ts`,
50
- output: {
51
- file: `${target}/index.d.ts`,
52
- format: 'es'
53
- },
54
- plugins: [dts()]
55
- }
56
- ];
57
- }
58
-
59
- /**
60
- * @type {import('rollup').RollupOptions[]}
61
- */
62
- export default [
63
- ...createBuilder({
64
- entry: 'src',
65
- formats: ['es', 'umd'],
66
- target: buildDir,
67
- umdName: 'PackAppBrowser',
68
- clean: true
69
- })
70
- ];
@@ -1,3 +0,0 @@
1
- export function calc(a: number, b: number): number {
2
- return a + b;
3
- }
@@ -1 +0,0 @@
1
- export * from './calc';
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES5",
4
- "module": "ESNext",
5
- "declaration": false,
6
- "outDir": "dist",
7
- "strict": true,
8
- "esModuleInterop": true,
9
- "moduleResolution": "Node",
10
- "skipLibCheck": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "baseUrl": "./"
13
- },
14
- "include": ["src/**/*"]
15
- }
@@ -1,11 +0,0 @@
1
- {
2
- "name": "@qlover/pack-app-node",
3
- "version": "0.0.1",
4
- "main": "index.js",
5
- "type": "module",
6
- "private": true,
7
- "scripts": {
8
- "build": "rollup -c",
9
- "test": "jest"
10
- }
11
- }
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "ESNext",
4
- "baseUrl": "./",
5
- "outDir": "dist",
6
- "skipLibCheck": true,
7
- "moduleResolution": "Bundler",
8
- "target": "ES2015",
9
- "downlevelIteration": true,
10
- "strict": true,
11
- "allowUnusedLabels": false,
12
- "noUnusedLocals": true,
13
- "noUnusedParameters": true
14
- },
15
- "include": ["src"],
16
- "exclude": ["dist", "node_modules"]
17
- }
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes