@dpuse/dpuse-development 0.3.450

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.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Development utilities.
3
+ */
4
+ declare function buildDirectoryIndex(id: string): Promise<void>;
5
+ export { buildDirectoryIndex };
6
+ export { buildProject, releaseProject, syncProjectWithGitHub, testProject } from './operations/manageProject';
7
+ export { auditDependencies } from './operations/auditDependencies';
8
+ export { checkDependencies } from './operations/checkDependencies';
9
+ export { documentDependencies } from './operations/documentDependencies';
10
+ export { formatCode } from './operations/formatCode';
11
+ export { lintCode } from './operations/lintCode';
12
+ export { updateDPUseDependencies } from './operations/updateDPUseDependencies';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Audit dependencies utilities.
3
+ */
4
+ declare function auditDependencies(): Promise<void>;
5
+ export { auditDependencies };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Check dependencies utilities.
3
+ */
4
+ /** Utilities - Check dependencies. */
5
+ declare function checkDependencies(): Promise<void>;
6
+ /** Exposures */
7
+ export { checkDependencies };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Document dependencies utilities.
3
+ */
4
+ /** Utilities - Document. */
5
+ declare function documentDependencies(licenses?: string[], checkRecursive?: boolean): Promise<void>;
6
+ /** Exposures */
7
+ export { documentDependencies };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Format code utilities.
3
+ */
4
+ declare function formatCode(): Promise<void>;
5
+ export { formatCode };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Lint code utilities.
3
+ */
4
+ declare function lintCode(): Promise<void>;
5
+ export { lintCode };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Manage project utilities.
3
+ */
4
+ declare function buildProject(): Promise<void>;
5
+ declare function releaseProject(): Promise<void>;
6
+ declare function syncProjectWithGitHub(): Promise<void>;
7
+ declare function testProject(): void;
8
+ export { buildProject, releaseProject, syncProjectWithGitHub, testProject };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Manage project utilities.
3
+ */
4
+ declare function test(): void;
5
+ export { test };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Update datapos dependencies utilities.
3
+ */
4
+ declare function updateDPUseDependencies(dependencies?: string[]): Promise<void>;
5
+ export { updateDPUseDependencies };
@@ -0,0 +1,7 @@
1
+ import { PackageJson } from 'type-fest';
2
+ import { ModuleConfig } from '@datapos/datapos-shared/component';
3
+ declare function putState(): Promise<void>;
4
+ declare function uploadDirectoryToR2(sourceDirectory: string, uploadDirectory: string): Promise<void>;
5
+ declare function uploadModuleConfigToDO(configJSON: ModuleConfig): Promise<void>;
6
+ declare function uploadModuleToR2(packageJSON: PackageJson, uploadDirectoryPath: string): Promise<void>;
7
+ export { putState, uploadDirectoryToR2, uploadModuleConfigToDO, uploadModuleToR2 };
@@ -0,0 +1,42 @@
1
+ import { Dirent, ObjectEncodingOptions, Stats } from 'node:fs';
2
+ /** Interfaces/Types */
3
+ export interface ModuleTypeConfig {
4
+ idPrefix: string;
5
+ typeId: 'app' | 'api' | 'connector' | 'context' | 'development' | 'engine' | 'eslint' | 'presenter' | 'resources' | 'shared' | 'tool';
6
+ isPublish: boolean;
7
+ uploadGroupName: 'connectors' | 'contexts' | 'engine' | 'presenters' | 'tools' | undefined;
8
+ }
9
+ /** Utilities - Clear directory. */
10
+ declare function clearDirectory(directoryPath: string): Promise<void>;
11
+ /** Utilities - Extract operations from source. */
12
+ declare function extractOperationsFromSource<T>(source: string): T[];
13
+ /** TODO Utilities - Execute command. */
14
+ declare function execCommand(label: string | undefined, command_: string, arguments_?: string[], outputFilePath?: string): Promise<void>;
15
+ /** Utilities - Get directory entries. */
16
+ declare function getDirectoryEntries(path: string): Promise<string[]>;
17
+ declare function getDirectoryEntries(path: string, options: ObjectEncodingOptions): Promise<Dirent[]>;
18
+ /** Utilities - Get module type identifier. */
19
+ declare function getModuleConfig(configId: string): ModuleTypeConfig;
20
+ /** Utilities - Get stats for path. */
21
+ declare function getStatsForPath(path: string): Promise<Stats>;
22
+ /** Utilities - Log operation header. */
23
+ declare function logOperationHeader(text: string): void;
24
+ /** Utilities - Log operation success. */
25
+ declare function logOperationSuccess(message: string): void;
26
+ /** Utilities - Log step header. */
27
+ declare function logStepHeader(text: string): void;
28
+ /** Utilities - Read JSON file. */
29
+ declare function readJSONFile<T>(path: string): Promise<T>;
30
+ declare function readTextFile(path: string): Promise<string>;
31
+ /** Utilities - Remove file. */
32
+ declare function removeFile(path: string): Promise<void>;
33
+ /** Utilities - Spawn command. */
34
+ declare function spawnCommand(label: string, command: string, arguments_?: string[], ignoreErrors?: boolean): Promise<void>;
35
+ /** Utilities - Substitute content. */
36
+ declare function substituteContent(originalContent: string, substituteContent: string, startMarker: string, endMarker: string): string;
37
+ /** Utilities - Write JSON file. */
38
+ declare function writeJSONFile(path: string, data: object): Promise<void>;
39
+ /** Utilities - Write text file. */
40
+ declare function writeTextFile(path: string, data: string): Promise<void>;
41
+ /** Exposures */
42
+ export { clearDirectory, execCommand, extractOperationsFromSource, getDirectoryEntries, getModuleConfig, getStatsForPath, logOperationHeader, logOperationSuccess, logStepHeader, readJSONFile, readTextFile, removeFile, spawnCommand, substituteContent, writeJSONFile, writeTextFile };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Vite configuration.
3
+ */
4
+ declare const _default: import('vite').UserConfig;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Vitest configuration.
3
+ */
4
+ declare const _default: import('vite').UserConfig;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * ESLint configuration.
3
+ */
4
+
5
+ /** Dependencies - Framework. */
6
+ import dpuse from '@dpuse/eslint-config-dpuse';
7
+
8
+ /** Exposures - Configuration. */
9
+ export default [...dpuse];
@@ -0,0 +1,16 @@
1
+ {
2
+ "fields": [
3
+ "department",
4
+ "relatedTo",
5
+ "name",
6
+ "licensePeriod",
7
+ "material",
8
+ "licenseType",
9
+ "link",
10
+ "remoteVersion",
11
+ "installedVersion",
12
+ "definedVersion",
13
+ "author",
14
+ "latestRemoteModified"
15
+ ]
16
+ }
package/package.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "@dpuse/dpuse-development",
3
+ "version": "0.3.450",
4
+ "description": "A collection of utilities for managing Data Positioning projects.",
5
+ "license": "MIT",
6
+ "author": "Jonathan Terrell <terrell.jm@gmail.com>",
7
+ "private": false,
8
+ "type": "module",
9
+ "homepage": "https://www.dpuse.app",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/data-positioning/dpuse-development.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/data-positioning/dpuse-development/issues"
16
+ },
17
+ "module": "./dist/dpuse-development.es.js",
18
+ "types": "./dist/types/src/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "import": "./dist/dpuse-development.es.js",
22
+ "types": "./dist/types/src/index.d.ts"
23
+ },
24
+ "./prettierrc": "./.prettierrc.json",
25
+ "./license-report-config": "./licenses/license-report-config.json"
26
+ },
27
+ "files": [
28
+ ".editorconfig",
29
+ ".gitattributes",
30
+ ".gitignore_published",
31
+ ".gitignore_unpublished",
32
+ ".markdownlint.json",
33
+ ".prettierrc.json",
34
+ "dist",
35
+ "eslint.config.ts",
36
+ "LICENSE",
37
+ "licenses/license-report-config.json",
38
+ "tsconfig.json",
39
+ "tsconfig.vite.json",
40
+ "vite.config.ts",
41
+ "vitest.config.ts"
42
+ ],
43
+ "dependencies": {
44
+ "@datapos/datapos-shared": "^0.3.590",
45
+ "acorn": "^8.16.0",
46
+ "acorn-typescript": "^1.4.13",
47
+ "acorn-walk": "^8.3.5",
48
+ "nanoid": "^5.1.7",
49
+ "valibot": "^1.3.1"
50
+ },
51
+ "devDependencies": {
52
+ "@dpuse/eslint-config-dpuse": "^1.0.49",
53
+ "@types/eslint-plugin-security": "^3.0.1",
54
+ "@types/node": "^25.5.0",
55
+ "@typescript-eslint/eslint-plugin": "^8.57.1",
56
+ "@typescript-eslint/parser": "^8.57.1",
57
+ "eslint": "^9.39.2",
58
+ "eslint-import-resolver-typescript": "^4.4.4",
59
+ "eslint-plugin-import": "^2.32.0",
60
+ "eslint-plugin-security": "^4.0.0",
61
+ "eslint-plugin-sonarjs": "^4.0.2",
62
+ "eslint-plugin-unicorn": "^63.0.0",
63
+ "jiti": "^2.6.1",
64
+ "license-downloader": "^1.3.3",
65
+ "license-report": "^6.8.2",
66
+ "license-report-check": "^0.1.2",
67
+ "license-report-recursive": "^6.8.3",
68
+ "npm-check-updates": "^19.6.5",
69
+ "owasp-dependency-check": "^1.0.1",
70
+ "prettier": "^3.8.1",
71
+ "rollup-plugin-visualizer": "^7.0.1",
72
+ "sonda": "^0.11.1",
73
+ "type-fest": "^5.5.0",
74
+ "typescript": "^5.9.3",
75
+ "vite": "^8.0.1",
76
+ "vite-plugin-dts": "^4.5.4",
77
+ "vitest": "^4.1.0"
78
+ },
79
+ "scripts": {
80
+ "audit": "op run --env-file=.env -- node -e \"import('./dist/dpuse-development.es.js').then(m => m.auditDependencies())\"",
81
+ "build": "vite build",
82
+ "check": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.checkDependencies())\"",
83
+ "document": "op run --env-file=.env -- node -e \"import('./dist/dpuse-development.es.js').then(m => m.documentDependencies(['MIT']))\"",
84
+ "format": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.formatCode())\"",
85
+ "lint": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.lintCode())\"",
86
+ "release": "op run --env-file=.env -- node -e \"import('./dist/dpuse-development.es.js').then(m => m.releaseProject())\"",
87
+ "sync": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.syncProjectWithGitHub())\"",
88
+ "test": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.testProject())\"",
89
+ "update": "node -e \"import('./dist/dpuse-development.es.js').then(m => m.updateDPUseDependencies(['eslint', 'shared']))\""
90
+ },
91
+ "engines": {
92
+ "node": ">=22.0.0",
93
+ "npm": ">=11.0.0"
94
+ }
95
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": "./",
4
+ "declaration": true,
5
+ "esModuleInterop": true,
6
+ "exactOptionalPropertyTypes": true,
7
+ "forceConsistentCasingInFileNames": true,
8
+ "incremental": true,
9
+ "isolatedModules": true,
10
+ "lib": ["DOM", "ESNext"],
11
+ "module": "ESNext",
12
+ "moduleDetection": "force",
13
+ "moduleResolution": "bundler",
14
+ "noImplicitAny": true,
15
+ "noImplicitOverride": true,
16
+ "noPropertyAccessFromIndexSignature": true,
17
+ "noUncheckedIndexedAccess": true,
18
+ "noUnusedLocals": false,
19
+ "noUnusedParameters": false,
20
+ "outDir": "dist",
21
+ "paths": {
22
+ "~/*": ["*"],
23
+ "@/*": ["src/*"]
24
+ },
25
+ "resolveJsonModule": true,
26
+ "skipLibCheck": true,
27
+ "sourceMap": true,
28
+ "strict": true,
29
+ "strictNullChecks": true,
30
+ "target": "ESNext",
31
+ "tsBuildInfoFile": "./node_modules/.cache/tsconfig.tsbuildinfo",
32
+ "useDefineForClassFields": true
33
+ },
34
+ "include": ["src/**/*.ts", "tests/**/*.ts", "vite.config.*", "vitest.config.*"]
35
+ }
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: ['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
+ });
@@ -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
+ });