@datapos/datapos-development 0.3.409 → 0.3.411
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/datapos-development.es.js +197 -196
- package/dist/datapos-development.es.js.map +1 -1
- package/dist/types/src/utilities/index.d.ts +1 -1
- package/package.json +5 -2
- package/tsconfig.json +27 -0
- package/vite.config.ts +52 -0
- package/vitest.config.ts +21 -0
|
@@ -2,7 +2,7 @@ import { Dirent, ObjectEncodingOptions, Stats } from 'node:fs';
|
|
|
2
2
|
/** Interfaces/Types */
|
|
3
3
|
export interface ModuleTypeConfig {
|
|
4
4
|
idPrefix: string;
|
|
5
|
-
typeId: 'app' | 'api' | 'connector' | 'context' | 'development' | 'engine' | 'presenter' | 'resources' | 'shared' | 'tool';
|
|
5
|
+
typeId: 'app' | 'api' | 'connector' | 'context' | 'development' | 'engine' | 'eslint' | 'presenter' | 'resources' | 'shared' | 'tool';
|
|
6
6
|
isPublish: boolean;
|
|
7
7
|
uploadGroupName?: 'connectors' | 'contexts' | 'engine' | 'presenters' | 'tools';
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-development",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.411",
|
|
4
4
|
"description": "A collection of utilities for managing Data Positioning projects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jonathan Terrell <terrell.jm@gmail.com>",
|
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
"dist",
|
|
35
35
|
"eslint.config.ts",
|
|
36
36
|
"LICENSE",
|
|
37
|
-
"licenses/license-report-config.json"
|
|
37
|
+
"licenses/license-report-config.json",
|
|
38
|
+
"tsconfig.json",
|
|
39
|
+
"vite.config.ts",
|
|
40
|
+
"vitest.config.ts"
|
|
38
41
|
],
|
|
39
42
|
"dependencies": {
|
|
40
43
|
"@datapos/datapos-shared": "^0.3.330",
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": "./", // Makes relative imports like "src/..." resolve from the repo root.
|
|
4
|
+
"declaration": true, // Emit .d.ts files so consumers get typings.
|
|
5
|
+
"esModuleInterop": true, // Allow default-import syntax for CommonJS packages.
|
|
6
|
+
"isolatedModules": true, // Treat each file as a separate module; keeps Vite happy.
|
|
7
|
+
"lib": ["ESNext"], // Target the latest JavaScript libs and built-ins.
|
|
8
|
+
"module": "ESNext", // Generate native ESM output for bundlers.
|
|
9
|
+
"moduleResolution": "bundler", // Resolve modules like a bundler (needed for aliases and imports such as 'sonda/vite').
|
|
10
|
+
"noUncheckedIndexedAccess": true, // Enforce checks when indexing into objects or arrays.
|
|
11
|
+
"noImplicitAny": true, // Disallow implicit any types to keep everything typed.
|
|
12
|
+
"outDir": "dist", // Place compiler output in dist/.
|
|
13
|
+
"paths": {
|
|
14
|
+
// Configure import aliases used across the project.
|
|
15
|
+
"~/*": ["*"],
|
|
16
|
+
"@/*": ["src/*"]
|
|
17
|
+
},
|
|
18
|
+
"resolveJsonModule": true, // Allow importing JSON modules directly.
|
|
19
|
+
"skipLibCheck": true, // Skip type checking for .d.ts in node_modules to speed up builds.
|
|
20
|
+
"sourceMap": true, // Emit source maps for better debugging.
|
|
21
|
+
"strict": true, // Enable the full strict type-checking suite.
|
|
22
|
+
"strictNullChecks": true, // Major strict setting: enforce null/undefined checks.
|
|
23
|
+
"target": "ESNext", // Target latest JavaScript syntax when emitting.
|
|
24
|
+
"useDefineForClassFields": true // Use define semantics for class fields (aligns with JS standard).
|
|
25
|
+
},
|
|
26
|
+
"include": ["vite.config.*", "src/**/*", "tests/**/*"]
|
|
27
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite configuration.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Dependencies - Vendor.
|
|
6
|
+
import { defineConfig } from 'vite'; // Core Vite API.
|
|
7
|
+
import dts from 'vite-plugin-dts'; // Emit .d.ts files alongside the bundle.
|
|
8
|
+
import Sonda from 'sonda/vite'; // Visualize bundle results with Sonda plugin.
|
|
9
|
+
import { visualizer } from 'rollup-plugin-visualizer'; // Generate bundle size report.
|
|
10
|
+
import { fileURLToPath, URL } from 'node:url'; // ESM-safe path helpers.
|
|
11
|
+
|
|
12
|
+
// Dependencies - Data.
|
|
13
|
+
import config from './config.json' with { type: 'json' }; // Provide configuration identifier for naming.
|
|
14
|
+
|
|
15
|
+
// Exposures - Configuration.
|
|
16
|
+
export default defineConfig({
|
|
17
|
+
build: {
|
|
18
|
+
lib: {
|
|
19
|
+
entry: fileURLToPath(new URL('src/index.ts', import.meta.url)), // Absolute entry path.
|
|
20
|
+
fileName: (format) => `${config.id}.${format}.js`, // Bundle name derived from config identifier and format.
|
|
21
|
+
formats: ['es'] // Only emit native ES modules.
|
|
22
|
+
},
|
|
23
|
+
rollupOptions: {
|
|
24
|
+
external: ['@datapos/datapos-shared', 'dotenv', 'nanoid', 'node:child_process', 'node:fs', 'node:path', 'node:readline', 'node:url', 'node:util'], // Keep runtime dependencies out of bundle.
|
|
25
|
+
plugins: [
|
|
26
|
+
Sonda({
|
|
27
|
+
filename: 'index', // Output file name.
|
|
28
|
+
format: 'html', // Output file format.
|
|
29
|
+
gzip: true, // Include gzip sizes.
|
|
30
|
+
brotli: true, // Include brotli sizes.
|
|
31
|
+
open: false, // Do not auto-open browser post-build.
|
|
32
|
+
outputDir: './bundle-analysis-reports/sonda' // Output directory.
|
|
33
|
+
}), // Run Sonda analyser to generate additional bundle insights.
|
|
34
|
+
visualizer({
|
|
35
|
+
filename: './bundle-analysis-reports/rollup-visualiser/index.html', // Output file path.
|
|
36
|
+
open: false, // Do not auto-open browser post-build.
|
|
37
|
+
gzipSize: true, // Include gzip sizes.
|
|
38
|
+
brotliSize: true // Include brotli sizes.
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
sourcemap: true,
|
|
43
|
+
target: 'ESNext' // Emit modern JavaScript for consumers.
|
|
44
|
+
},
|
|
45
|
+
plugins: [dts({ outDir: 'dist/types' })], // Generate type declarations in dist/types.
|
|
46
|
+
resolve: {
|
|
47
|
+
alias: {
|
|
48
|
+
'~': fileURLToPath(new URL('./', import.meta.url)), // Base alias matching tsconfig.
|
|
49
|
+
'@': fileURLToPath(new URL('src', import.meta.url)) // Source alias matching tsconfig.
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest configuration.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Dependencies - Vendor.
|
|
6
|
+
import { defineConfig } from 'vitest/config';
|
|
7
|
+
import { resolve } from 'node:path';
|
|
8
|
+
|
|
9
|
+
// Exposures - Configuration.
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
resolve: {
|
|
12
|
+
alias: {
|
|
13
|
+
'@': resolve(__dirname, './src')
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
test: {
|
|
17
|
+
globals: true,
|
|
18
|
+
include: ['tests/**/*.test.ts'],
|
|
19
|
+
environment: 'node'
|
|
20
|
+
}
|
|
21
|
+
});
|