@icebreakers/monorepo 1.2.0 → 1.2.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 (145) hide show
  1. package/assets/package.json +2 -2
  2. package/dist/{chunk-EBATUF3S.js → chunk-SC5QBYJ5.js} +1 -1
  3. package/dist/cli.cjs +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +1 -1
  7. package/package.json +2 -2
  8. package/templates/apps/cli/bin/index.js +2 -0
  9. package/templates/apps/cli/dev/index.ts +2 -0
  10. package/templates/apps/cli/package.json +32 -0
  11. package/templates/apps/cli/src/cli.ts +3 -0
  12. package/templates/apps/cli/src/index.ts +0 -0
  13. package/templates/apps/cli/tsconfig.json +7 -0
  14. package/templates/apps/cli/tsup.config.ts +13 -0
  15. package/templates/apps/client/eslint.config.js +12 -0
  16. package/templates/apps/client/index.html +13 -0
  17. package/templates/apps/client/package.json +44 -0
  18. package/templates/apps/client/public/vite.svg +1 -0
  19. package/templates/apps/client/src/App.vue +9 -0
  20. package/templates/apps/client/src/main.ts +14 -0
  21. package/templates/apps/client/src/pages/index.vue +67 -0
  22. package/templates/apps/client/src/router/index.ts +13 -0
  23. package/templates/apps/client/src/stores/i18n.ts +23 -0
  24. package/templates/apps/client/src/stores/index.ts +15 -0
  25. package/templates/apps/client/src/style.css +1 -0
  26. package/templates/apps/client/src/trpc/index.ts +10 -0
  27. package/templates/apps/client/src/vite-env.d.ts +2 -0
  28. package/templates/apps/client/tsconfig.app.json +28 -0
  29. package/templates/apps/client/tsconfig.json +8 -0
  30. package/templates/apps/client/tsconfig.node.json +25 -0
  31. package/templates/apps/client/tsconfig.worker.json +11 -0
  32. package/templates/apps/client/vite.config.ts +40 -0
  33. package/templates/apps/client/worker/app.ts +24 -0
  34. package/templates/apps/client/worker/config.ts +1 -0
  35. package/templates/apps/client/worker/fetch-entry.ts +5 -0
  36. package/templates/apps/client/worker/node-entry.ts +12 -0
  37. package/templates/apps/client/worker/trpc-router.ts +24 -0
  38. package/templates/apps/client/worker-configuration.d.ts +7688 -0
  39. package/templates/apps/client/wrangler.jsonc +21 -0
  40. package/templates/apps/server/package.json +58 -0
  41. package/templates/apps/server/src/app.ts +191 -0
  42. package/templates/apps/server/src/config.ts +1 -0
  43. package/templates/apps/server/src/fetch-entry.ts +5 -0
  44. package/templates/apps/server/src/node-entry.ts +12 -0
  45. package/templates/apps/server/test/index.test.ts +14 -0
  46. package/templates/apps/server/tsconfig.json +24 -0
  47. package/templates/apps/server/tsup.config.ts +13 -0
  48. package/templates/apps/server/vitest.config.ts +15 -0
  49. package/templates/apps/server/worker-configuration.d.ts +7688 -0
  50. package/templates/apps/server/wrangler.jsonc +18 -0
  51. package/templates/apps/website/.vitepress/config.ts +93 -0
  52. package/templates/apps/website/.vitepress/theme/index.ts +4 -0
  53. package/templates/apps/website/.vitepress/theme/tailwind.css +1 -0
  54. package/templates/apps/website/index.md +151 -0
  55. package/templates/apps/website/monorepo/index.md +68 -0
  56. package/templates/apps/website/monorepo/manage.md +60 -0
  57. package/templates/apps/website/monorepo/publish.md +189 -0
  58. package/templates/apps/website/package.json +34 -0
  59. package/templates/apps/website/public/logo.jpg +0 -0
  60. package/templates/apps/website/thinking.md +88 -0
  61. package/templates/apps/website/tools/changeset.md +87 -0
  62. package/templates/apps/website/tools/husky.md +108 -0
  63. package/templates/apps/website/tools/lint-staged.md +79 -0
  64. package/templates/apps/website/tools/pnpm.md +100 -0
  65. package/templates/apps/website/tools/renovate.md +91 -0
  66. package/templates/apps/website/tools/turborepo.md +149 -0
  67. package/templates/apps/website/why/assets/npm-dt.svg +15 -0
  68. package/templates/apps/website/why/assets/npm-ts.svg +19 -0
  69. package/templates/apps/website/why/examples/0.npm-basic-package/index.js +9 -0
  70. package/templates/apps/website/why/examples/0.npm-basic-package/package.json +11 -0
  71. package/templates/apps/website/why/examples/1.npm-basic-package/index.cjs +11 -0
  72. package/templates/apps/website/why/examples/1.npm-basic-package/index.d.ts +1 -0
  73. package/templates/apps/website/why/examples/1.npm-basic-package/index.js +7 -0
  74. package/templates/apps/website/why/examples/1.npm-basic-package/package.json +19 -0
  75. package/templates/apps/website/why/examples/2.npm-basic-package/README.md +1 -0
  76. package/templates/apps/website/why/examples/2.npm-basic-package/package-lock.json +30 -0
  77. package/templates/apps/website/why/examples/2.npm-basic-package/package.json +35 -0
  78. package/templates/apps/website/why/examples/2.npm-basic-package/rename-ext.js +24 -0
  79. package/templates/apps/website/why/examples/2.npm-basic-package/src/index.ts +7 -0
  80. package/templates/apps/website/why/examples/2.npm-basic-package/tsconfig.cjs.json +8 -0
  81. package/templates/apps/website/why/examples/2.npm-basic-package/tsconfig.esm.json +7 -0
  82. package/templates/apps/website/why/examples/2.npm-basic-package/tsconfig.json +18 -0
  83. package/templates/apps/website/why/examples/3.npm-basic-package/README.md +1 -0
  84. package/templates/apps/website/why/examples/3.npm-basic-package/build.config.ts +24 -0
  85. package/templates/apps/website/why/examples/3.npm-basic-package/package-lock.json +3661 -0
  86. package/templates/apps/website/why/examples/3.npm-basic-package/package.json +32 -0
  87. package/templates/apps/website/why/examples/3.npm-basic-package/src/index.ts +7 -0
  88. package/templates/apps/website/why/examples/3.npm-basic-package/tsconfig.json +16 -0
  89. package/templates/apps/website/why/examples/3.npm-basic-package/tsup.config.ts +16 -0
  90. package/templates/apps/website/why/examples/usage-cjs/cjs.cjs +3 -0
  91. package/templates/apps/website/why/examples/usage-cjs/esm.mjs +3 -0
  92. package/templates/apps/website/why/examples/usage-cjs/index.js +11 -0
  93. package/templates/apps/website/why/examples/usage-cjs/package-lock.json +42 -0
  94. package/templates/apps/website/why/examples/usage-cjs/package.json +20 -0
  95. package/templates/apps/website/why/examples/usage-esm/cjs.cjs +3 -0
  96. package/templates/apps/website/why/examples/usage-esm/createRequire.js +7 -0
  97. package/templates/apps/website/why/examples/usage-esm/esm.mjs +3 -0
  98. package/templates/apps/website/why/examples/usage-esm/index.js +7 -0
  99. package/templates/apps/website/why/examples/usage-esm/package-lock.json +42 -0
  100. package/templates/apps/website/why/examples/usage-esm/package.json +21 -0
  101. package/templates/apps/website/why/how-to-reuse-js-code.md +250 -0
  102. package/templates/apps/website/why/index.md +1 -0
  103. package/templates/apps/website/why/js-cjs-mjs.md +99 -0
  104. package/templates/apps/website/why/js-keywords.md +132 -0
  105. package/templates/apps/website/why/modern/bundlers.md +79 -0
  106. package/templates/apps/website/why/modern/dts.md +93 -0
  107. package/templates/apps/website/why/modern/esm-vs-cjs.md +84 -0
  108. package/templates/apps/website/why/modern/index.md +55 -0
  109. package/templates/apps/website/why/modern/package-entry-points.md +128 -0
  110. package/templates/apps/website/why/modern/typescript.md +155 -0
  111. package/templates/apps/website/why/publish-basic-npm-package.md +146 -0
  112. package/templates/apps/website/why/what-is-npm-package.md +162 -0
  113. package/templates/packages/tsup-template/build.config.ts +24 -0
  114. package/templates/packages/tsup-template/package.json +42 -0
  115. package/templates/packages/tsup-template/src/index.ts +12 -0
  116. package/templates/packages/tsup-template/test/index.test.ts +7 -0
  117. package/templates/packages/tsup-template/tsconfig.json +15 -0
  118. package/templates/packages/tsup-template/tsup.config.ts +18 -0
  119. package/templates/packages/tsup-template/vitest.config.ts +15 -0
  120. package/templates/packages/unbuild-template/build.config.ts +24 -0
  121. package/templates/packages/unbuild-template/package.json +42 -0
  122. package/templates/packages/unbuild-template/src/index.ts +9 -0
  123. package/templates/packages/unbuild-template/src/utils.ts +3 -0
  124. package/templates/packages/unbuild-template/test/index.test.ts +7 -0
  125. package/templates/packages/unbuild-template/tsconfig.json +15 -0
  126. package/templates/packages/unbuild-template/vitest.config.ts +15 -0
  127. package/templates/packages/vue-lib-template/eslint.config.js +12 -0
  128. package/templates/packages/vue-lib-template/index.html +13 -0
  129. package/templates/packages/vue-lib-template/lib/HelloWorld.vue +21 -0
  130. package/templates/packages/vue-lib-template/lib/index.ts +3 -0
  131. package/templates/packages/vue-lib-template/package.json +61 -0
  132. package/templates/packages/vue-lib-template/src/App.vue +9 -0
  133. package/templates/packages/vue-lib-template/src/main.ts +8 -0
  134. package/templates/packages/vue-lib-template/src/pages/index.vue +7 -0
  135. package/templates/packages/vue-lib-template/src/router/index.ts +11 -0
  136. package/templates/packages/vue-lib-template/src/style.css +1 -0
  137. package/templates/packages/vue-lib-template/src/vite-env.d.ts +2 -0
  138. package/templates/packages/vue-lib-template/test/index.test.ts +13 -0
  139. package/templates/packages/vue-lib-template/tsconfig.app.json +30 -0
  140. package/templates/packages/vue-lib-template/tsconfig.json +14 -0
  141. package/templates/packages/vue-lib-template/tsconfig.node.json +25 -0
  142. package/templates/packages/vue-lib-template/tsconfig.test.json +40 -0
  143. package/templates/packages/vue-lib-template/vite.config.ts +47 -0
  144. package/templates/packages/vue-lib-template/vite.shared.config.ts +13 -0
  145. package/templates/packages/vue-lib-template/vitest.config.ts +13 -0
@@ -0,0 +1,7 @@
1
+ import { foo } from '@/index'
2
+
3
+ describe('index', () => {
4
+ it('foo bar', () => {
5
+ expect(foo()).toBe('bar')
6
+ })
7
+ })
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "@/*": [
7
+ "src/*"
8
+ ]
9
+ }
10
+ },
11
+ "include": [
12
+ "src",
13
+ "test"
14
+ ]
15
+ }
@@ -0,0 +1,15 @@
1
+ import path from 'node:path'
2
+ import { defineProject } from 'vitest/config'
3
+
4
+ export default defineProject({
5
+ test: {
6
+ alias: [
7
+ {
8
+ find: '@',
9
+ replacement: path.resolve(__dirname, './src'),
10
+ },
11
+ ],
12
+ globals: true,
13
+ testTimeout: 60_000,
14
+ },
15
+ })
@@ -0,0 +1,12 @@
1
+ import { icebreaker } from '@icebreakers/eslint-config'
2
+
3
+ export default icebreaker(
4
+ {
5
+ vue: true,
6
+ typescript: true,
7
+ tailwindcss: {
8
+ entryPoint: 'src/style.css',
9
+ },
10
+ ignores: ['**/fixtures/**'],
11
+ },
12
+ )
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Vue + TS</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ withDefaults(defineProps<{
3
+ msg?: string
4
+ }>(), {
5
+ msg: 'Hello World',
6
+ })
7
+ </script>
8
+
9
+ <template>
10
+ <div class="p-2">
11
+ <div class="rounded-2xl p-2">
12
+ {{ msg }}
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <style scoped>
18
+ .a {
19
+ color: aliceblue;
20
+ }
21
+ </style>
@@ -0,0 +1,3 @@
1
+ import HelloWorld from './HelloWorld.vue'
2
+
3
+ export { HelloWorld }
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@icebreakers/vue-lib-template",
3
+ "type": "module",
4
+ "version": "0.0.0",
5
+ "description": "vue lib vite lib mode template",
6
+ "author": "ice breaker <1324318532@qq.com>",
7
+ "license": "ISC",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/sonofmagic/monorepo-template.git",
11
+ "directory": "packages/vue-lib-template"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/sonofmagic/monorepo-template/issues"
15
+ },
16
+ "keywords": [],
17
+ "sideEffects": false,
18
+ "exports": {
19
+ ".": "./lib/index.ts"
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "dev": "vite",
26
+ "build": "vue-tsc -b && vite build",
27
+ "preview": "vite preview",
28
+ "test": "vitest run",
29
+ "test:dev": "vitest",
30
+ "release": "pnpm publish",
31
+ "lint": "eslint .",
32
+ "lint:fix": "eslint . --fix"
33
+ },
34
+ "publishConfig": {
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "import": "./dist/index.js",
39
+ "require": "./dist/index.umd.cjs"
40
+ },
41
+ "./style.css": "./dist/index.css"
42
+ },
43
+ "main": "./dist/index.umd.cjs",
44
+ "module": "./dist/index.js",
45
+ "types": "./dist/index.d.ts"
46
+ },
47
+ "devDependencies": {
48
+ "@tailwindcss/vite": "^4.1.13",
49
+ "@vitejs/plugin-vue": "^6.0.1",
50
+ "@vue/test-utils": "^2.4.6",
51
+ "@vue/tsconfig": "^0.8.1",
52
+ "jsdom": "^27.0.0",
53
+ "tailwindcss": "^4.1.13",
54
+ "unplugin-vue-router": "^0.15.0",
55
+ "vite": "^7.1.6",
56
+ "vite-plugin-dts": "^4.5.4",
57
+ "vue": "^3.5.21",
58
+ "vue-router": "^4.5.1",
59
+ "vue-tsc": "^3.0.7"
60
+ }
61
+ }
@@ -0,0 +1,9 @@
1
+ <script setup lang="ts">
2
+
3
+ </script>
4
+
5
+ <template>
6
+ <RouterView />
7
+ </template>
8
+
9
+ <style scoped></style>
@@ -0,0 +1,8 @@
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+ import { router } from './router'
4
+ import './style.css'
5
+
6
+ const app = createApp(App)
7
+ app.use(router)
8
+ app.mount('#app')
@@ -0,0 +1,7 @@
1
+ <script setup lang="ts">
2
+ import { HelloWorld } from '~/index'
3
+ </script>
4
+
5
+ <template>
6
+ <HelloWorld msg="Vite + Vue" />
7
+ </template>
@@ -0,0 +1,11 @@
1
+ import { createRouter, createWebHistory } from 'vue-router'
2
+ import { handleHotUpdate, routes } from 'vue-router/auto-routes'
3
+
4
+ export const router = createRouter({
5
+ history: createWebHistory(),
6
+ routes,
7
+ })
8
+
9
+ if (import.meta.hot) {
10
+ handleHotUpdate(router)
11
+ }
@@ -0,0 +1 @@
1
+ @import 'tailwindcss';
@@ -0,0 +1,2 @@
1
+ /// <reference types="vite/client" />
2
+ /// <reference types="unplugin-vue-router/client" />
@@ -0,0 +1,13 @@
1
+ import { mount } from '@vue/test-utils'
2
+ import HelloWorld from '../lib/HelloWorld.vue'
3
+
4
+ it('displays message', () => {
5
+ const wrapper = mount(HelloWorld, {
6
+ props: {
7
+ msg: 'Hello world',
8
+ },
9
+ })
10
+
11
+ // Assert the rendered text of the component
12
+ expect(wrapper.text()).toContain('Hello world')
13
+ })
@@ -0,0 +1,30 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "paths": {
6
+ "@/*": [
7
+ "./src/*"
8
+ ],
9
+ "~/*": [
10
+ "./lib/*"
11
+ ]
12
+ },
13
+ /* Linting */
14
+ "strict": true,
15
+ "noFallthroughCasesInSwitch": true,
16
+ "noUnusedLocals": true,
17
+ "noUnusedParameters": true,
18
+ "erasableSyntaxOnly": true,
19
+ "noUncheckedSideEffectImports": true
20
+ },
21
+ "include": [
22
+ "lib/**/*.ts",
23
+ "lib/**/*.tsx",
24
+ "lib/**/*.vue",
25
+ "src/**/*.ts",
26
+ "src/**/*.tsx",
27
+ "src/**/*.vue",
28
+ "types"
29
+ ]
30
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "references": [
3
+ {
4
+ "path": "./tsconfig.app.json"
5
+ },
6
+ {
7
+ "path": "./tsconfig.node.json"
8
+ },
9
+ {
10
+ "path": "./tsconfig.test.json"
11
+ }
12
+ ],
13
+ "files": []
14
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "moduleDetection": "force",
7
+ "module": "ESNext",
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+
13
+ /* Linting */
14
+ "strict": true,
15
+ "noFallthroughCasesInSwitch": true,
16
+ "noUnusedLocals": true,
17
+ "noUnusedParameters": true,
18
+ "noEmit": true,
19
+ "verbatimModuleSyntax": true,
20
+ "erasableSyntaxOnly": true,
21
+ "skipLibCheck": true,
22
+ "noUncheckedSideEffectImports": true
23
+ },
24
+ "include": ["vite.config.ts"]
25
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "compilerOptions": {
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
+ "target": "ES2023",
6
+ "lib": [
7
+ "ES2023"
8
+ ],
9
+ "moduleDetection": "force",
10
+ "baseUrl": ".",
11
+ "module": "ESNext",
12
+ /* Bundler mode */
13
+ "moduleResolution": "bundler",
14
+ "paths": {
15
+ "@/*": [
16
+ "./src"
17
+ ],
18
+ "~/*": [
19
+ "./lib"
20
+ ]
21
+ },
22
+ "types": [
23
+ "vitest/globals"
24
+ ],
25
+ "allowImportingTsExtensions": true,
26
+ /* Linting */
27
+ "strict": true,
28
+ "noFallthroughCasesInSwitch": true,
29
+ "noUnusedLocals": true,
30
+ "noUnusedParameters": true,
31
+ "noEmit": true,
32
+ "verbatimModuleSyntax": true,
33
+ "erasableSyntaxOnly": true,
34
+ "skipLibCheck": true,
35
+ "noUncheckedSideEffectImports": true
36
+ },
37
+ "include": [
38
+ "test/**/*.ts"
39
+ ]
40
+ }
@@ -0,0 +1,47 @@
1
+ import type { UserConfig } from 'vite'
2
+ import Tailwindcss from '@tailwindcss/vite'
3
+ import Vue from '@vitejs/plugin-vue'
4
+ import path from 'pathe'
5
+ import VueRouter from 'unplugin-vue-router/vite'
6
+ import { mergeConfig } from 'vite'
7
+ import DTS from 'vite-plugin-dts'
8
+ import { sharedConfig } from './vite.shared.config'
9
+
10
+ export default mergeConfig(sharedConfig, {
11
+ plugins: [
12
+ VueRouter(
13
+ {
14
+ dts: path.relative(import.meta.dirname, './types/typed-router.d.ts'),
15
+ },
16
+ ),
17
+ Vue(),
18
+ DTS(
19
+ {
20
+ tsconfigPath: './tsconfig.app.json',
21
+ entryRoot: './lib',
22
+ },
23
+ ),
24
+ Tailwindcss(),
25
+ ],
26
+ // https://vite.dev/guide/build.html#library-mode
27
+ build: {
28
+ lib: {
29
+ entry: path.resolve(import.meta.dirname, 'lib/index'),
30
+ name: 'icebreaker',
31
+ // the proper extensions will be added
32
+ fileName: 'index',
33
+ },
34
+ rollupOptions: {
35
+ // make sure to externalize deps that shouldn't be bundled
36
+ // into your library
37
+ external: ['vue'],
38
+ output: {
39
+ // Provide global variables to use in the UMD build
40
+ // for externalized deps
41
+ globals: {
42
+ vue: 'Vue',
43
+ },
44
+ },
45
+ },
46
+ },
47
+ } satisfies UserConfig)
@@ -0,0 +1,13 @@
1
+ import path from 'pathe'
2
+
3
+ // https://vite.dev/guide/build.html#library-mode
4
+ import { defineConfig } from 'vite'
5
+
6
+ export const sharedConfig = defineConfig({
7
+ resolve: {
8
+ alias: {
9
+ '@': path.resolve(import.meta.dirname, 'src'),
10
+ '~': path.resolve(import.meta.dirname, 'lib'),
11
+ },
12
+ },
13
+ })
@@ -0,0 +1,13 @@
1
+ import type { UserConfig } from 'vite'
2
+ import Vue from '@vitejs/plugin-vue'
3
+ import { mergeConfig } from 'vitest/config'
4
+ import { sharedConfig } from './vite.shared.config'
5
+
6
+ export default mergeConfig(sharedConfig, {
7
+ test: {
8
+ globals: true,
9
+ testTimeout: 60_000,
10
+ environment: 'jsdom',
11
+ },
12
+ plugins: [Vue()],
13
+ } satisfies UserConfig)