@entreprise-os/vitest-config 2.4.332 → 2.4.333-beta.ec9940a

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/dist/app.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import * as vite0 from "vite";
2
+
3
+ //#region app.d.ts
4
+
5
+ /**
6
+ * Base Vitest configuration for APP packages
7
+ *
8
+ * Provides path alias resolution for the package's src directory.
9
+ * Individual packages can extend this config and customize the alias name.
10
+ */
11
+ declare function createAppConfig(aliasName: string, srcPath?: string): vite0.UserConfig;
12
+ //#endregion
13
+ export { createAppConfig };
package/dist/app.js ADDED
@@ -0,0 +1,41 @@
1
+ import { defineConfig } from "vitest/config";
2
+ import path from "path";
3
+
4
+ //#region app.ts
5
+ /**
6
+ * Base Vitest configuration for APP packages
7
+ *
8
+ * Provides path alias resolution for the package's src directory.
9
+ * Individual packages can extend this config and customize the alias name.
10
+ */
11
+ function createAppConfig(aliasName, srcPath = "./src") {
12
+ return defineConfig({
13
+ resolve: { alias: { [aliasName]: path.resolve(process.cwd(), srcPath) } },
14
+ test: { coverage: {
15
+ provider: "v8",
16
+ reporter: ["text", "json"],
17
+ reportsDirectory: "./coverage",
18
+ include: ["src/**/*.ts", "src/**/*.tsx"],
19
+ exclude: [
20
+ "src/**/*.test.ts",
21
+ "src/**/*.test.tsx",
22
+ "src/**/*.spec.ts",
23
+ "src/**/*.spec.tsx",
24
+ "src/**/*.d.ts",
25
+ "src/**/index.ts",
26
+ "src/**/__tests__/**",
27
+ "src/**/__mocks__/**"
28
+ ],
29
+ all: true,
30
+ thresholds: {
31
+ statements: 0,
32
+ branches: 0,
33
+ functions: 0,
34
+ lines: 0
35
+ }
36
+ } }
37
+ });
38
+ }
39
+
40
+ //#endregion
41
+ export { createAppConfig };
package/dist/data.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import * as vite1 from "vite";
2
+
3
+ //#region data.d.ts
4
+
5
+ /**
6
+ * Base Vitest configuration for DATA packages
7
+ *
8
+ * Configures sequential test execution to avoid database race conditions.
9
+ * Tests run sequentially across all files since they share a database singleton.
10
+ */
11
+ declare const _default: vite1.UserConfig;
12
+ //#endregion
13
+ export { _default as default };
package/dist/data.js ADDED
@@ -0,0 +1,48 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ //#region data.ts
4
+ /**
5
+ * Base Vitest configuration for DATA packages
6
+ *
7
+ * Configures sequential test execution to avoid database race conditions.
8
+ * Tests run sequentially across all files since they share a database singleton.
9
+ */
10
+ var data_default = defineConfig({ test: {
11
+ pool: "forks",
12
+ poolOptions: { forks: { singleFork: true } },
13
+ fileParallelism: false,
14
+ hookTimeout: 1e5,
15
+ retry: 2,
16
+ setupFiles: ["@entreprise-os/core-data/test-utils/test-helpers"],
17
+ coverage: {
18
+ provider: "v8",
19
+ reporter: ["text", "json"],
20
+ reportsDirectory: "./coverage",
21
+ include: [
22
+ "db/**/*.ts",
23
+ "trpc/**/*.ts",
24
+ "**/*.ts"
25
+ ],
26
+ exclude: [
27
+ "**/*.test.ts",
28
+ "**/*.spec.ts",
29
+ "**/*.d.ts",
30
+ "**/index.ts",
31
+ "**/__tests__/**",
32
+ "**/__mocks__/**",
33
+ "**/test-utils/**",
34
+ "**/migrations/**",
35
+ "coverage/**"
36
+ ],
37
+ all: true,
38
+ thresholds: {
39
+ statements: 0,
40
+ branches: 0,
41
+ functions: 0,
42
+ lines: 0
43
+ }
44
+ }
45
+ } });
46
+
47
+ //#endregion
48
+ export { data_default as default };
@@ -0,0 +1,9 @@
1
+ //#region tsdown-externals.d.ts
2
+ /**
3
+ * Shared external dependencies configuration for tsdown builds
4
+ * This ensures consistent bundling behavior across all UI packages
5
+ */
6
+ declare const commonUIExternals: readonly [RegExp, RegExp, "react-i18next", RegExp, RegExp, RegExp, RegExp, RegExp, "lucide-react", "sonner", "cmdk", "vaul", "framer-motion", RegExp, "@xyflow/react", RegExp, RegExp, "nanoid", RegExp, "prop-types", RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, "react-day-picker", "cron-parser", RegExp, "uuid", "zod", "clsx", "tailwind-merge", "class-variance-authority", "ai", "tokenlens", RegExp, "crypto", "path", "process", "url", "buffer", "stream", RegExp];
7
+ declare const commonDataExternals: readonly ["drizzle-orm", "drizzle-zod", "zod", "better-auth", RegExp, RegExp, "pdf-lib", "bullmq", "cron-parser", "argon2", "crypto", "resend", "ejs", "uuid", "dotenv", "dotenv/config", "react", "react-dom", "react-i18next", "@tanstack/react-query", "sonner", "vitest", RegExp, "express", RegExp, "fs", "path", "url", "buffer", "stream", "zlib", RegExp];
8
+ //#endregion
9
+ export { commonDataExternals, commonUIExternals };
@@ -0,0 +1,89 @@
1
+ //#region tsdown-externals.ts
2
+ /**
3
+ * Shared external dependencies configuration for tsdown builds
4
+ * This ensures consistent bundling behavior across all UI packages
5
+ */
6
+ const commonUIExternals = [
7
+ /^react($|\/)/,
8
+ /^react-dom($|\/)/,
9
+ "react-i18next",
10
+ /^@dnd-kit\//,
11
+ /^@radix-ui\//,
12
+ /^@tanstack\//,
13
+ /^@trpc\//,
14
+ /^@vis\.gl\//,
15
+ "lucide-react",
16
+ "sonner",
17
+ "cmdk",
18
+ "vaul",
19
+ "framer-motion",
20
+ /^@xyflow\//,
21
+ "@xyflow/react",
22
+ /^elkjs/,
23
+ /^zustand($|\/)/,
24
+ "nanoid",
25
+ /^recharts/,
26
+ "prop-types",
27
+ /^react-is($|\/)/,
28
+ /^quill/,
29
+ /^react-quill/,
30
+ /^@react-pdf\//,
31
+ /^react-pdf/,
32
+ /^date-fns($|\/)/,
33
+ /^@date-fns\//,
34
+ "react-day-picker",
35
+ "cron-parser",
36
+ /^lodash/,
37
+ "uuid",
38
+ "zod",
39
+ "clsx",
40
+ "tailwind-merge",
41
+ "class-variance-authority",
42
+ "ai",
43
+ "tokenlens",
44
+ /^node:/,
45
+ "crypto",
46
+ "path",
47
+ "process",
48
+ "url",
49
+ "buffer",
50
+ "stream",
51
+ /^@entreprise-os\//
52
+ ];
53
+ const commonDataExternals = [
54
+ "drizzle-orm",
55
+ "drizzle-zod",
56
+ "zod",
57
+ "better-auth",
58
+ /^@trpc\//,
59
+ /^@aws-sdk\//,
60
+ "pdf-lib",
61
+ "bullmq",
62
+ "cron-parser",
63
+ "argon2",
64
+ "crypto",
65
+ "resend",
66
+ "ejs",
67
+ "uuid",
68
+ "dotenv",
69
+ "dotenv/config",
70
+ "react",
71
+ "react-dom",
72
+ "react-i18next",
73
+ "@tanstack/react-query",
74
+ "sonner",
75
+ "vitest",
76
+ /^@vitest\//,
77
+ "express",
78
+ /^node:/,
79
+ "fs",
80
+ "path",
81
+ "url",
82
+ "buffer",
83
+ "stream",
84
+ "zlib",
85
+ /^@entreprise-os\//
86
+ ];
87
+
88
+ //#endregion
89
+ export { commonDataExternals, commonUIExternals };
package/dist/ui.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import * as vite0 from "vite";
2
+
3
+ //#region ui.d.ts
4
+
5
+ /**
6
+ * Base Vitest configuration for UI packages
7
+ *
8
+ * Provides path alias resolution and test file patterns.
9
+ * Individual packages can extend this config and customize the alias name.
10
+ */
11
+ declare function createUiConfig(aliasName?: string, srcPath?: string): vite0.UserConfig;
12
+ //#endregion
13
+ export { createUiConfig };
package/dist/ui.js ADDED
@@ -0,0 +1,51 @@
1
+ import { defineConfig } from "vitest/config";
2
+ import path from "path";
3
+
4
+ //#region ui.ts
5
+ /**
6
+ * Base Vitest configuration for UI packages
7
+ *
8
+ * Provides path alias resolution and test file patterns.
9
+ * Individual packages can extend this config and customize the alias name.
10
+ */
11
+ function createUiConfig(aliasName = "@", srcPath = "src") {
12
+ return defineConfig({
13
+ resolve: { alias: { [aliasName]: path.resolve(process.cwd(), srcPath) } },
14
+ test: {
15
+ include: ["**/__tests__/**/*.test.{ts,tsx,js,jsx}"],
16
+ exclude: [
17
+ "**/*.stories.*",
18
+ "**/*.mdx",
19
+ "**/dist/**"
20
+ ],
21
+ coverage: {
22
+ provider: "v8",
23
+ reporter: ["text", "json"],
24
+ reportsDirectory: "./coverage",
25
+ include: ["src/**/*.ts", "src/**/*.tsx"],
26
+ exclude: [
27
+ "src/**/*.test.ts",
28
+ "src/**/*.test.tsx",
29
+ "src/**/*.spec.ts",
30
+ "src/**/*.spec.tsx",
31
+ "src/**/*.stories.tsx",
32
+ "src/**/*.stories.ts",
33
+ "src/**/*.d.ts",
34
+ "src/**/index.ts",
35
+ "src/**/__tests__/**",
36
+ "src/**/__mocks__/**"
37
+ ],
38
+ all: true,
39
+ thresholds: {
40
+ statements: 0,
41
+ branches: 0,
42
+ functions: 0,
43
+ lines: 0
44
+ }
45
+ }
46
+ }
47
+ });
48
+ }
49
+
50
+ //#endregion
51
+ export { createUiConfig };
package/package.json CHANGED
@@ -1,16 +1,34 @@
1
1
  {
2
2
  "name": "@entreprise-os/vitest-config",
3
- "version": "2.4.332",
3
+ "version": "2.4.333-beta.ec9940a",
4
4
  "description": "Shared Vitest configuration for Enterprise OS packages",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build:prod": "tsdown && node ../../scripts/prepare-build.js"
14
+ },
9
15
  "exports": {
10
- "./app": "./app.ts",
11
- "./data": "./data.ts",
12
- "./ui": "./ui.ts",
13
- "./tsdown-externals": "./tsdown-externals.ts"
16
+ "./app": {
17
+ "types": "./dist/app.d.ts",
18
+ "default": "./dist/app.js"
19
+ },
20
+ "./data": {
21
+ "types": "./dist/data.d.ts",
22
+ "default": "./dist/data.js"
23
+ },
24
+ "./ui": {
25
+ "types": "./dist/ui.d.ts",
26
+ "default": "./dist/ui.js"
27
+ },
28
+ "./tsdown-externals": {
29
+ "types": "./dist/tsdown-externals.d.ts",
30
+ "default": "./dist/tsdown-externals.js"
31
+ }
14
32
  },
15
33
  "peerDependencies": {
16
34
  "vitest": "^3.2.4",
package/app.ts DELETED
@@ -1,43 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
- import path from "path";
3
-
4
- /**
5
- * Base Vitest configuration for APP packages
6
- *
7
- * Provides path alias resolution for the package's src directory.
8
- * Individual packages can extend this config and customize the alias name.
9
- */
10
- export function createAppConfig(aliasName: string, srcPath: string = "./src") {
11
- return defineConfig({
12
- resolve: {
13
- alias: {
14
- [aliasName]: path.resolve(process.cwd(), srcPath),
15
- },
16
- },
17
- test: {
18
- coverage: {
19
- provider: "v8",
20
- reporter: ["text", "json"],
21
- reportsDirectory: "./coverage",
22
- include: ["src/**/*.ts", "src/**/*.tsx"],
23
- exclude: [
24
- "src/**/*.test.ts",
25
- "src/**/*.test.tsx",
26
- "src/**/*.spec.ts",
27
- "src/**/*.spec.tsx",
28
- "src/**/*.d.ts",
29
- "src/**/index.ts",
30
- "src/**/__tests__/**",
31
- "src/**/__mocks__/**",
32
- ],
33
- all: true,
34
- thresholds: {
35
- statements: 0,
36
- branches: 0,
37
- functions: 0,
38
- lines: 0,
39
- },
40
- },
41
- },
42
- });
43
- }
package/data.ts DELETED
@@ -1,53 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
-
3
- /**
4
- * Base Vitest configuration for DATA packages
5
- *
6
- * Configures sequential test execution to avoid database race conditions.
7
- * Tests run sequentially across all files since they share a database singleton.
8
- */
9
- export default defineConfig({
10
- test: {
11
- // Run tests sequentially to avoid database race conditions
12
- // All test files run one at a time to prevent parallel database access issues
13
- pool: "forks",
14
- poolOptions: {
15
- forks: {
16
- singleFork: true,
17
- },
18
- },
19
- // Disable file parallelism - run one test file at a time
20
- fileParallelism: false,
21
- // Global hook timeout for setup/teardown operations
22
- hookTimeout: 100000,
23
- // Retry flaky tests (e.g. S3 mock timeouts) up to 2 times before failing
24
- retry: 2,
25
- // Setup files to run before all tests - automatically mocks authentication middleware
26
- setupFiles: ["@entreprise-os/core-data/test-utils/test-helpers"],
27
- // Coverage configuration
28
- coverage: {
29
- provider: "v8",
30
- reporter: ["text", "json"],
31
- reportsDirectory: "./coverage",
32
- include: ["db/**/*.ts", "trpc/**/*.ts", "**/*.ts"],
33
- exclude: [
34
- "**/*.test.ts",
35
- "**/*.spec.ts",
36
- "**/*.d.ts",
37
- "**/index.ts",
38
- "**/__tests__/**",
39
- "**/__mocks__/**",
40
- "**/test-utils/**",
41
- "**/migrations/**",
42
- "coverage/**",
43
- ],
44
- all: true,
45
- thresholds: {
46
- statements: 0,
47
- branches: 0,
48
- functions: 0,
49
- lines: 0,
50
- },
51
- },
52
- },
53
- });
@@ -1,135 +0,0 @@
1
- /**
2
- * Shared external dependencies configuration for tsdown builds
3
- * This ensures consistent bundling behavior across all UI packages
4
- */
5
-
6
- export const commonUIExternals = [
7
- // React ecosystem
8
- /^react($|\/)/,
9
- /^react-dom($|\/)/,
10
- "react-i18next",
11
-
12
- // Common UI libraries
13
- /^@dnd-kit\//,
14
- /^@radix-ui\//,
15
- /^@tanstack\//,
16
- /^@trpc\//,
17
- /^@vis\.gl\//,
18
- "lucide-react",
19
- "sonner",
20
- "cmdk",
21
- "vaul",
22
- "framer-motion",
23
-
24
- // Workflow / graph libraries
25
- /^@xyflow\//,
26
- "@xyflow/react",
27
- /^elkjs/,
28
- /^zustand($|\/)/,
29
- "nanoid",
30
-
31
- // Charts
32
- /^recharts/,
33
- "prop-types",
34
- /^react-is($|\/)/,
35
-
36
- // Rich text editors
37
- /^quill/,
38
- /^react-quill/,
39
-
40
- // PDF libraries
41
- /^@react-pdf\//,
42
- /^react-pdf/,
43
-
44
- // Date/time libraries (have Node.js dependencies for timezone support)
45
- /^date-fns($|\/)/,
46
- /^@date-fns\//,
47
- "react-day-picker",
48
-
49
- // Cron parsing (has Node.js fs dependencies)
50
- "cron-parser",
51
-
52
- // Utilities
53
- /^lodash/,
54
- "uuid",
55
- "zod",
56
- "clsx",
57
- "tailwind-merge",
58
- "class-variance-authority",
59
-
60
- // AI libraries (have Node.js dependencies)
61
- "ai",
62
- "tokenlens",
63
-
64
- // Node.js built-ins
65
- /^node:/,
66
- "crypto",
67
- "path",
68
- "process",
69
- "url",
70
- "buffer",
71
- "stream",
72
-
73
- // Workspace packages
74
- /^@entreprise-os\//,
75
- ] as const;
76
-
77
- export const commonDataExternals = [
78
- // Database & ORM
79
- "drizzle-orm",
80
- "drizzle-zod",
81
- "zod",
82
- "better-auth",
83
-
84
- // tRPC (must be external to ensure type compatibility across packages)
85
- /^@trpc\//,
86
-
87
- // AWS SDK (complex re-exports that cause rolldown issues with treeshaking)
88
- /^@aws-sdk\//,
89
-
90
- // pdfs
91
- "pdf-lib",
92
-
93
- // Queue & Workers
94
- "bullmq",
95
- "cron-parser",
96
-
97
- // Security & Crypto
98
- "argon2",
99
- "crypto",
100
-
101
- // Email
102
- "resend",
103
- "ejs",
104
-
105
- // Utilities
106
- "uuid",
107
- "dotenv",
108
- "dotenv/config",
109
-
110
- // React (for data packages that might use React Query)
111
- "react",
112
- "react-dom",
113
- "react-i18next",
114
- "@tanstack/react-query",
115
- "sonner",
116
-
117
- // Testing (vitest uses node:module which breaks browser builds)
118
- "vitest",
119
- /^@vitest\//,
120
-
121
- // Express (has CommonJS dependencies like debug that use node:module)
122
- "express",
123
-
124
- // Node.js built-ins
125
- /^node:/,
126
- "fs",
127
- "path",
128
- "url",
129
- "buffer",
130
- "stream",
131
- "zlib",
132
-
133
- // Workspace packages
134
- /^@entreprise-os\//,
135
- ] as const;
package/ui.ts DELETED
@@ -1,50 +0,0 @@
1
- import { defineConfig } from "vitest/config";
2
- import path from "path";
3
-
4
- /**
5
- * Base Vitest configuration for UI packages
6
- *
7
- * Provides path alias resolution and test file patterns.
8
- * Individual packages can extend this config and customize the alias name.
9
- */
10
- export function createUiConfig(
11
- aliasName: string = "@",
12
- srcPath: string = "src"
13
- ) {
14
- return defineConfig({
15
- resolve: {
16
- alias: {
17
- [aliasName]: path.resolve(process.cwd(), srcPath),
18
- },
19
- },
20
- test: {
21
- include: ["**/__tests__/**/*.test.{ts,tsx,js,jsx}"],
22
- exclude: ["**/*.stories.*", "**/*.mdx", "**/dist/**"],
23
- coverage: {
24
- provider: "v8",
25
- reporter: ["text", "json"],
26
- reportsDirectory: "./coverage",
27
- include: ["src/**/*.ts", "src/**/*.tsx"],
28
- exclude: [
29
- "src/**/*.test.ts",
30
- "src/**/*.test.tsx",
31
- "src/**/*.spec.ts",
32
- "src/**/*.spec.tsx",
33
- "src/**/*.stories.tsx",
34
- "src/**/*.stories.ts",
35
- "src/**/*.d.ts",
36
- "src/**/index.ts",
37
- "src/**/__tests__/**",
38
- "src/**/__mocks__/**",
39
- ],
40
- all: true,
41
- thresholds: {
42
- statements: 0,
43
- branches: 0,
44
- functions: 0,
45
- lines: 0,
46
- },
47
- },
48
- },
49
- });
50
- }