@ya-modbus/driver-loader 0.9.0 → 0.11.0
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/CHANGELOG.md +12 -0
- package/README.md +61 -11
- package/dist/cjs/src/driver-import.d.ts +32 -0
- package/dist/cjs/src/driver-import.d.ts.map +1 -0
- package/dist/cjs/src/driver-import.js +82 -0
- package/dist/cjs/src/driver-import.js.map +1 -0
- package/dist/cjs/src/driver-name.d.ts +11 -0
- package/dist/cjs/src/driver-name.d.ts.map +1 -0
- package/dist/cjs/src/driver-name.js +21 -0
- package/dist/cjs/src/driver-name.js.map +1 -0
- package/dist/cjs/src/entry-point.d.ts +20 -0
- package/dist/cjs/src/entry-point.d.ts.map +1 -0
- package/dist/cjs/src/entry-point.js +63 -0
- package/dist/cjs/src/entry-point.js.map +1 -0
- package/dist/cjs/src/errors.d.ts +32 -3
- package/dist/cjs/src/errors.d.ts.map +1 -1
- package/dist/cjs/src/errors.js +39 -5
- package/dist/cjs/src/errors.js.map +1 -1
- package/dist/cjs/src/index.d.ts +1 -1
- package/dist/cjs/src/index.d.ts.map +1 -1
- package/dist/cjs/src/index.js +2 -1
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/loader.d.ts +9 -2
- package/dist/cjs/src/loader.d.ts.map +1 -1
- package/dist/cjs/src/loader.js +34 -78
- package/dist/cjs/src/loader.js.map +1 -1
- package/dist/cjs/src/local-package.d.ts +19 -0
- package/dist/cjs/src/local-package.d.ts.map +1 -0
- package/dist/cjs/src/local-package.js +50 -0
- package/dist/cjs/src/local-package.js.map +1 -0
- package/dist/cjs/src/module-errors.d.ts +33 -0
- package/dist/cjs/src/module-errors.d.ts.map +1 -0
- package/dist/cjs/src/module-errors.js +77 -0
- package/dist/cjs/src/module-errors.js.map +1 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/driver-import.d.ts +32 -0
- package/dist/esm/src/driver-import.d.ts.map +1 -0
- package/dist/esm/src/driver-import.js +78 -0
- package/dist/esm/src/driver-import.js.map +1 -0
- package/dist/esm/src/driver-name.d.ts +11 -0
- package/dist/esm/src/driver-name.d.ts.map +1 -0
- package/dist/esm/src/driver-name.js +18 -0
- package/dist/esm/src/driver-name.js.map +1 -0
- package/dist/esm/src/entry-point.d.ts +20 -0
- package/dist/esm/src/entry-point.d.ts.map +1 -0
- package/dist/esm/src/entry-point.js +59 -0
- package/dist/esm/src/entry-point.js.map +1 -0
- package/dist/esm/src/errors.d.ts +32 -3
- package/dist/esm/src/errors.d.ts.map +1 -1
- package/dist/esm/src/errors.js +37 -4
- package/dist/esm/src/errors.js.map +1 -1
- package/dist/esm/src/index.d.ts +1 -1
- package/dist/esm/src/index.d.ts.map +1 -1
- package/dist/esm/src/index.js +1 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/loader.d.ts +9 -2
- package/dist/esm/src/loader.d.ts.map +1 -1
- package/dist/esm/src/loader.js +35 -79
- package/dist/esm/src/loader.js.map +1 -1
- package/dist/esm/src/local-package.d.ts +19 -0
- package/dist/esm/src/local-package.d.ts.map +1 -0
- package/dist/esm/src/local-package.js +47 -0
- package/dist/esm/src/local-package.js.map +1 -0
- package/dist/esm/src/module-errors.d.ts +33 -0
- package/dist/esm/src/module-errors.d.ts.map +1 -0
- package/dist/esm/src/module-errors.js +73 -0
- package/dist/esm/src/module-errors.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/cjs/src/loader.d.ts
CHANGED
|
@@ -60,6 +60,9 @@ export interface LoadDriverOptions {
|
|
|
60
60
|
/**
|
|
61
61
|
* Explicit driver package name
|
|
62
62
|
* e.g., 'ya-modbus-driver-xymd1' or '@org/ya-modbus-driver-xymd1'
|
|
63
|
+
*
|
|
64
|
+
* A short name such as 'xymd1' is tried as '@ya-modbus/driver-xymd1',
|
|
65
|
+
* then 'ya-modbus-driver-xymd1', then 'xymd1'.
|
|
63
66
|
*/
|
|
64
67
|
driverPackage?: string;
|
|
65
68
|
/**
|
|
@@ -73,7 +76,8 @@ export interface LoadDriverOptions {
|
|
|
73
76
|
*/
|
|
74
77
|
export interface SystemDependencies {
|
|
75
78
|
readFile: (path: string, encoding: 'utf-8') => Promise<string>;
|
|
76
|
-
|
|
79
|
+
/** Import a module by package name, or by `file:` URL for the entry file of a local package */
|
|
80
|
+
importModule: (specifier: string) => Promise<unknown>;
|
|
77
81
|
getCwd: () => string;
|
|
78
82
|
}
|
|
79
83
|
/**
|
|
@@ -104,7 +108,10 @@ export declare function getDriverCacheStats(): DriverCacheStats;
|
|
|
104
108
|
* 1. Explicit package: `loadDriver({ driverPackage: 'ya-modbus-driver-xymd1' })`
|
|
105
109
|
* 2. Auto-detect from cwd: `loadDriver({})` - reads package.json from current directory
|
|
106
110
|
*
|
|
107
|
-
* Auto-detection checks for `ya-modbus-driver` keyword in package.json keywords
|
|
111
|
+
* Auto-detection checks for `ya-modbus-driver` keyword in package.json keywords and loads
|
|
112
|
+
* the entry file that `import` of the package resolves to (`exports["."]`, else `main`,
|
|
113
|
+
* else `index.js`). The driver must be built: the entry file is JavaScript, or TypeScript
|
|
114
|
+
* that Node can run itself.
|
|
108
115
|
*
|
|
109
116
|
* @example
|
|
110
117
|
* // Auto-detect from current directory
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../src/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,eAAe,EAChB,MAAM,yBAAyB,CAAA;AAmBhC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,8BAA8B;IAC9B,YAAY,EAAE,oBAAoB,CAAA;IAElC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB,mE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
CHANGED
|
@@ -37,9 +37,23 @@ exports.clearDriverCache = clearDriverCache;
|
|
|
37
37
|
exports.getDriverCacheStats = getDriverCacheStats;
|
|
38
38
|
exports.loadDriver = loadDriver;
|
|
39
39
|
const promises_1 = require("fs/promises");
|
|
40
|
-
const path_1 = require("path");
|
|
41
40
|
const config_validator_js_1 = require("./config-validator.js");
|
|
41
|
+
const driver_import_js_1 = require("./driver-import.js");
|
|
42
|
+
const driver_name_js_1 = require("./driver-name.js");
|
|
42
43
|
const errors_js_1 = require("./errors.js");
|
|
44
|
+
const local_package_js_1 = require("./local-package.js");
|
|
45
|
+
/**
|
|
46
|
+
* Native `import()`, in the CommonJS build as well
|
|
47
|
+
*
|
|
48
|
+
* The CommonJS build compiles `import()` to `require()`, which cannot load a `file:` URL.
|
|
49
|
+
* Going through `Function` keeps the native `import()`, which also loads ES modules.
|
|
50
|
+
*/
|
|
51
|
+
/* istanbul ignore next */
|
|
52
|
+
const nativeImport = (specifier) => {
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-implied-eval -- keeps `import()` out of the CommonJS transform
|
|
54
|
+
const importFn = new Function('specifier', 'return import(specifier)');
|
|
55
|
+
return importFn(specifier);
|
|
56
|
+
};
|
|
43
57
|
/**
|
|
44
58
|
* Default system dependencies using Node.js built-ins
|
|
45
59
|
*/
|
|
@@ -48,7 +62,7 @@ const defaultDeps = {
|
|
|
48
62
|
/* istanbul ignore next */
|
|
49
63
|
readFile: (path, encoding) => (0, promises_1.readFile)(path, encoding),
|
|
50
64
|
/* istanbul ignore next */
|
|
51
|
-
importModule: (
|
|
65
|
+
importModule: (specifier) => specifier.startsWith('file:') ? nativeImport(specifier) : Promise.resolve(`${specifier}`).then(s => __importStar(require(s))),
|
|
52
66
|
/* istanbul ignore next */
|
|
53
67
|
getCwd: () => process.cwd(),
|
|
54
68
|
};
|
|
@@ -83,61 +97,6 @@ function getDriverCacheStats() {
|
|
|
83
97
|
size: driverCache.size,
|
|
84
98
|
};
|
|
85
99
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Auto-detect local driver package from package.json
|
|
88
|
-
*
|
|
89
|
-
* @param deps - System dependencies
|
|
90
|
-
* @returns Package name if valid driver package
|
|
91
|
-
* @throws Error if not a valid driver package
|
|
92
|
-
*/
|
|
93
|
-
async function detectLocalPackage(deps) {
|
|
94
|
-
try {
|
|
95
|
-
const packageJsonPath = (0, path_1.join)(deps.getCwd(), 'package.json');
|
|
96
|
-
const packageJsonContent = await deps.readFile(packageJsonPath, 'utf-8');
|
|
97
|
-
const packageJson = JSON.parse(packageJsonContent);
|
|
98
|
-
const keywords = packageJson.keywords ?? [];
|
|
99
|
-
if (!keywords.includes('ya-modbus-driver')) {
|
|
100
|
-
throw new errors_js_1.PackageJsonError('Current package is not a ya-modbus driver. ' +
|
|
101
|
-
'Add "ya-modbus-driver" to keywords in package.json');
|
|
102
|
-
}
|
|
103
|
-
const name = packageJson.name;
|
|
104
|
-
if (!name) {
|
|
105
|
-
throw new errors_js_1.PackageJsonError('package.json must have a "name" field');
|
|
106
|
-
}
|
|
107
|
-
return name;
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
if (error.code === 'ENOENT') {
|
|
111
|
-
throw new errors_js_1.PackageJsonError('package.json not found in current directory. ' +
|
|
112
|
-
'Run this command from a driver package directory or specify --driver');
|
|
113
|
-
}
|
|
114
|
-
if (error instanceof SyntaxError) {
|
|
115
|
-
throw new errors_js_1.PackageJsonError('Failed to parse package.json: invalid JSON');
|
|
116
|
-
}
|
|
117
|
-
throw error;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Try to import a module with multiple path attempts
|
|
122
|
-
*
|
|
123
|
-
* @param paths - Array of module paths to try
|
|
124
|
-
* @param deps - System dependencies
|
|
125
|
-
* @returns Imported module
|
|
126
|
-
* @throws Error if all paths fail
|
|
127
|
-
*/
|
|
128
|
-
async function tryImport(paths, deps) {
|
|
129
|
-
const errors = [];
|
|
130
|
-
for (const path of paths) {
|
|
131
|
-
try {
|
|
132
|
-
return await deps.importModule(path);
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
errors.push(error);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
const lastError = errors[errors.length - 1];
|
|
139
|
-
throw new Error(`Failed to import module from any path. Tried: ${paths.join(', ')}\nLast error: ${lastError?.message}`, { cause: lastError });
|
|
140
|
-
}
|
|
141
100
|
/**
|
|
142
101
|
* Load a driver package dynamically
|
|
143
102
|
*
|
|
@@ -145,7 +104,10 @@ async function tryImport(paths, deps) {
|
|
|
145
104
|
* 1. Explicit package: `loadDriver({ driverPackage: 'ya-modbus-driver-xymd1' })`
|
|
146
105
|
* 2. Auto-detect from cwd: `loadDriver({})` - reads package.json from current directory
|
|
147
106
|
*
|
|
148
|
-
* Auto-detection checks for `ya-modbus-driver` keyword in package.json keywords
|
|
107
|
+
* Auto-detection checks for `ya-modbus-driver` keyword in package.json keywords and loads
|
|
108
|
+
* the entry file that `import` of the package resolves to (`exports["."]`, else `main`,
|
|
109
|
+
* else `index.js`). The driver must be built: the entry file is JavaScript, or TypeScript
|
|
110
|
+
* that Node can run itself.
|
|
149
111
|
*
|
|
150
112
|
* @example
|
|
151
113
|
* // Auto-detect from current directory
|
|
@@ -165,36 +127,29 @@ async function loadDriver(options = {}, deps = defaultDeps) {
|
|
|
165
127
|
let packageName;
|
|
166
128
|
let driverModule;
|
|
167
129
|
if (driverPackage) {
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
130
|
+
const candidates = (0, driver_name_js_1.getDriverPackageCandidates)(driverPackage);
|
|
131
|
+
for (const candidate of candidates) {
|
|
132
|
+
const cached = driverCache.get(candidate);
|
|
133
|
+
if (cached) {
|
|
134
|
+
cacheStats.hits++;
|
|
135
|
+
return cached;
|
|
136
|
+
}
|
|
173
137
|
}
|
|
174
138
|
cacheStats.misses++;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
catch {
|
|
179
|
-
throw new errors_js_1.DriverNotFoundError(`Driver package not found: ${driverPackage}\nInstall it with: npm install ${driverPackage}`, driverPackage);
|
|
180
|
-
}
|
|
139
|
+
const imported = await (0, driver_import_js_1.importDriverPackage)(driverPackage, candidates, deps);
|
|
140
|
+
packageName = imported.packageName;
|
|
141
|
+
driverModule = imported.driverModule;
|
|
181
142
|
}
|
|
182
143
|
else {
|
|
183
|
-
|
|
144
|
+
const localPackage = await (0, local_package_js_1.detectLocalPackage)(deps);
|
|
145
|
+
packageName = localPackage.name;
|
|
184
146
|
const cached = driverCache.get(packageName);
|
|
185
147
|
if (cached) {
|
|
186
148
|
cacheStats.hits++;
|
|
187
149
|
return cached;
|
|
188
150
|
}
|
|
189
151
|
cacheStats.misses++;
|
|
190
|
-
|
|
191
|
-
const importPaths = [
|
|
192
|
-
(0, path_1.join)(cwd, 'src', 'index.js'),
|
|
193
|
-
(0, path_1.join)(cwd, 'src', 'index.ts'),
|
|
194
|
-
(0, path_1.join)(cwd, 'dist', 'index.js'),
|
|
195
|
-
packageName,
|
|
196
|
-
];
|
|
197
|
-
driverModule = await tryImport(importPaths, deps);
|
|
152
|
+
driverModule = await (0, driver_import_js_1.importLocalDriver)(packageName, localPackage.entryPoint, deps);
|
|
198
153
|
}
|
|
199
154
|
if (!driverModule || typeof driverModule !== 'object') {
|
|
200
155
|
throw new errors_js_1.ValidationError('Driver package must export a createDriver function', 'createDriver');
|
|
@@ -230,6 +185,7 @@ async function loadDriver(options = {}, deps = defaultDeps) {
|
|
|
230
185
|
catch (error) {
|
|
231
186
|
if (error instanceof errors_js_1.ValidationError ||
|
|
232
187
|
error instanceof errors_js_1.DriverNotFoundError ||
|
|
188
|
+
error instanceof errors_js_1.DriverNotBuiltError ||
|
|
233
189
|
error instanceof errors_js_1.PackageJsonError) {
|
|
234
190
|
throw error;
|
|
235
191
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../src/loader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2KA,4CAIC;AAMD,kDAMC;AA0BD,gCA+GC;AApUD,0CAAsC;AAStC,+DAM8B;AAC9B,yDAA2E;AAC3E,qDAA6D;AAC7D,2CAKoB;AACpB,yDAAuD;AA2FvD;;;;;GAKG;AACH,0BAA0B;AAC1B,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAoB,EAAE;IAC3D,gHAAgH;IAChH,MAAM,QAAQ,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAAwB,CAAA;IAC7F,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAA;AAC5B,CAAC,CAAA;AAED;;GAEG;AACH,0BAA0B;AAC1B,MAAM,WAAW,GAAuB;IACtC,0BAA0B;IAC1B,QAAQ,EAAE,CAAC,IAAY,EAAE,QAAiB,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,IAAI,EAAE,QAAQ,CAAC;IACvE,0BAA0B;IAC1B,YAAY,EAAE,CAAC,SAAiB,EAAE,EAAE,CAClC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAQ,SAAS,uCAAC;IAC7E,0BAA0B;IAC1B,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;CAC5B,CAAA;AAcD;;GAEG;AACH,MAAM,WAAW,GAAG,IAAI,GAAG,EAAwB,CAAA;AAEnD;;GAEG;AACH,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;CACV,CAAA;AAED;;;GAGG;AACH,SAAgB,gBAAgB;IAC9B,WAAW,CAAC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uB,EAAC,gBAAgB,CAAC,CAAA;QACpE,CAAC;QAED,IAAI,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;YACnD,MAAM,QAAQ,GAAG,IAAA,0CAAoB,EAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC,CAAA;YACnF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACxB,IAAA,0CAAoB,EAAC,uBAAuB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;YACjE,CAAC;QACH,CAAC;QAED,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;QAEpC,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IACE,KAAK,YAAY,2BAAe;YAChC,KAAK,YAAY,+BAAmB;YACpC,KAAK,YAAY,+BAAmB;YACpC,KAAK,YAAY,4BAAgB,EACjC,CAAC;YACD,MAAM,KAAK,CAAA;QACb,CAAC;QAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,0BAA0B,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;QAC9E,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACzD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { SystemDependencies } from './loader.js';
|
|
2
|
+
/**
|
|
3
|
+
* A driver package found in the current directory
|
|
4
|
+
*/
|
|
5
|
+
export interface LocalPackage {
|
|
6
|
+
/** Name from package.json */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Absolute path of the file that importing the package loads */
|
|
9
|
+
entryPoint: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Auto-detect local driver package from package.json
|
|
13
|
+
*
|
|
14
|
+
* @param deps - System dependencies
|
|
15
|
+
* @returns Package name and entry file if valid driver package
|
|
16
|
+
* @throws Error if not a valid driver package
|
|
17
|
+
*/
|
|
18
|
+
export declare function detectLocalPackage(deps: Pick<SystemDependencies, 'getCwd' | 'readFile'>): Promise<LocalPackage>;
|
|
19
|
+
//# sourceMappingURL=local-package.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-package.d.ts","sourceRoot":"","sources":["../../../src/local-package.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,UAAU,CAAC,GACpD,OAAO,CAAC,YAAY,CAAC,CAkDvB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectLocalPackage = detectLocalPackage;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const entry_point_js_1 = require("./entry-point.js");
|
|
6
|
+
const errors_js_1 = require("./errors.js");
|
|
7
|
+
/**
|
|
8
|
+
* Auto-detect local driver package from package.json
|
|
9
|
+
*
|
|
10
|
+
* @param deps - System dependencies
|
|
11
|
+
* @returns Package name and entry file if valid driver package
|
|
12
|
+
* @throws Error if not a valid driver package
|
|
13
|
+
*/
|
|
14
|
+
async function detectLocalPackage(deps) {
|
|
15
|
+
try {
|
|
16
|
+
const cwd = deps.getCwd();
|
|
17
|
+
const packageJsonContent = await deps.readFile((0, node_path_1.join)(cwd, 'package.json'), 'utf-8');
|
|
18
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
19
|
+
const keywords = packageJson.keywords ?? [];
|
|
20
|
+
if (!keywords.includes('ya-modbus-driver')) {
|
|
21
|
+
throw new errors_js_1.PackageJsonError('Current package is not a ya-modbus driver. ' +
|
|
22
|
+
'Add "ya-modbus-driver" to keywords in package.json');
|
|
23
|
+
}
|
|
24
|
+
const name = packageJson.name;
|
|
25
|
+
if (!name) {
|
|
26
|
+
throw new errors_js_1.PackageJsonError('package.json must have a "name" field');
|
|
27
|
+
}
|
|
28
|
+
const entry = (0, entry_point_js_1.resolvePackageEntry)(packageJson);
|
|
29
|
+
if (entry === undefined) {
|
|
30
|
+
throw new errors_js_1.PackageJsonError('package.json "exports" has no entry for "." that can be imported. ' +
|
|
31
|
+
'Add an "import" or "default" condition to exports["."]');
|
|
32
|
+
}
|
|
33
|
+
if ((0, node_path_1.extname)(entry) === '') {
|
|
34
|
+
throw new errors_js_1.PackageJsonError(`The entry point "${entry}" in package.json has no file extension. ` +
|
|
35
|
+
'Name the built file, for example "./dist/index.js"');
|
|
36
|
+
}
|
|
37
|
+
return { name, entryPoint: (0, node_path_1.join)(cwd, entry) };
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error.code === 'ENOENT') {
|
|
41
|
+
throw new errors_js_1.PackageJsonError('package.json not found in current directory. ' +
|
|
42
|
+
'Run this command from a driver package directory or specify --driver');
|
|
43
|
+
}
|
|
44
|
+
if (error instanceof SyntaxError) {
|
|
45
|
+
throw new errors_js_1.PackageJsonError('Failed to parse package.json: invalid JSON');
|
|
46
|
+
}
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=local-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-package.js","sourceRoot":"","sources":["../../../src/local-package.ts"],"names":[],"mappings":";;AAuBA,gDAoDC;AA3ED,yCAAyC;AAEzC,qDAA+E;AAC/E,2CAA8C;AAa9C;;;;;;GAMG;AACI,KAAK,UAAU,kBAAkB,CACtC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AsE,CACzE,CAAA;QACH,CAAC;QACD,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,MAAM,IAAI,4BAAgB,CAAC,4CAA4C,CAAC,CAAA;QAC1E,CAAC;QACD,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if an import failed because the package itself is not installed
|
|
3
|
+
*
|
|
4
|
+
* A package that is installed but fails to load (syntax error, missing dependency)
|
|
5
|
+
* is not reported as missing, so the real problem is not hidden by a later candidate.
|
|
6
|
+
* Node names the package in quotes, in both the ESM and the CommonJS wording.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isMissingPackageError(error: unknown, packageName: string): boolean;
|
|
9
|
+
/** Why a driver cannot be loaded as built JavaScript */
|
|
10
|
+
export type NotBuiltCause =
|
|
11
|
+
/** A file of the driver is missing, such as the entry file when there is no `dist` directory */
|
|
12
|
+
'missing-file'
|
|
13
|
+
/** The driver is TypeScript source and Node does not run it, because it is too old or has type stripping off */
|
|
14
|
+
| 'typescript'
|
|
15
|
+
/** Node strips types, but the TypeScript uses syntax or imports that type stripping cannot run */
|
|
16
|
+
| 'typescript-unsupported'
|
|
17
|
+
/** Node does not run TypeScript from `node_modules` */
|
|
18
|
+
| 'typescript-in-node-modules';
|
|
19
|
+
/**
|
|
20
|
+
* Find out if an import failed because the driver is not built
|
|
21
|
+
*
|
|
22
|
+
* A missing file counts when Node names it by its absolute path. A package that is not
|
|
23
|
+
* installed, or a missing dependency, is named by its package name, so neither matches.
|
|
24
|
+
* With `entryPoint` (a local driver) only the entry file itself counts. Another missing
|
|
25
|
+
* file of a built driver is a bug in the driver, which building does not fix, unless
|
|
26
|
+
* TypeScript source asks for it (importing `./x.js` when only `x.ts` exists).
|
|
27
|
+
*
|
|
28
|
+
* @param error - What the import threw
|
|
29
|
+
* @param entryPoint - Absolute path of the entry file, if it is known
|
|
30
|
+
* @returns The cause, or undefined if the error is about something else
|
|
31
|
+
*/
|
|
32
|
+
export declare function getNotBuiltCause(error: unknown, entryPoint?: string): NotBuiltCause | undefined;
|
|
33
|
+
//# sourceMappingURL=module-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-errors.d.ts","sourceRoot":"","sources":["../../../src/module-errors.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAYlF;AAED,wDAAwD;AACxD,MAAM,MAAM,aAAa;AACvB,gGAAgG;AAC9F,cAAc;AAChB,gHAAgH;GAC9G,YAAY;AACd,kGAAkG;GAChG,wBAAwB;AAC1B,uDAAuD;GACrD,4BAA4B,CAAA;AAEhC;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAiC/F"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMissingPackageError = isMissingPackageError;
|
|
4
|
+
exports.getNotBuiltCause = getNotBuiltCause;
|
|
5
|
+
const NOT_FOUND_CODES = new Set(['ERR_MODULE_NOT_FOUND', 'MODULE_NOT_FOUND']);
|
|
6
|
+
/** Node does not know TypeScript files: too old, or type stripping is off */
|
|
7
|
+
const UNKNOWN_TYPESCRIPT = /Unknown file extension "\.[cm]?ts"/;
|
|
8
|
+
/**
|
|
9
|
+
* What Node could not find (a package name, or the absolute path of a file on POSIX or
|
|
10
|
+
* Windows), and the file that wanted it (not in the CommonJS wording)
|
|
11
|
+
*/
|
|
12
|
+
const MISSING_TARGET = /Cannot find (?:module|package) '([^']+)'(?: imported from ([^\n]+))?/;
|
|
13
|
+
const ABSOLUTE_PATH = /^(?:[/\\]|[A-Za-z]:)/;
|
|
14
|
+
const TYPESCRIPT_FILE = /\.[cm]?tsx?$/;
|
|
15
|
+
/**
|
|
16
|
+
* Check if an import failed because the package itself is not installed
|
|
17
|
+
*
|
|
18
|
+
* A package that is installed but fails to load (syntax error, missing dependency)
|
|
19
|
+
* is not reported as missing, so the real problem is not hidden by a later candidate.
|
|
20
|
+
* Node names the package in quotes, in both the ESM and the CommonJS wording.
|
|
21
|
+
*/
|
|
22
|
+
function isMissingPackageError(error, packageName) {
|
|
23
|
+
if (typeof error !== 'object' || error === null) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const { code, message } = error;
|
|
27
|
+
return (typeof code === 'string' &&
|
|
28
|
+
NOT_FOUND_CODES.has(code) &&
|
|
29
|
+
typeof message === 'string' &&
|
|
30
|
+
message.includes(`'${packageName}'`));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Find out if an import failed because the driver is not built
|
|
34
|
+
*
|
|
35
|
+
* A missing file counts when Node names it by its absolute path. A package that is not
|
|
36
|
+
* installed, or a missing dependency, is named by its package name, so neither matches.
|
|
37
|
+
* With `entryPoint` (a local driver) only the entry file itself counts. Another missing
|
|
38
|
+
* file of a built driver is a bug in the driver, which building does not fix, unless
|
|
39
|
+
* TypeScript source asks for it (importing `./x.js` when only `x.ts` exists).
|
|
40
|
+
*
|
|
41
|
+
* @param error - What the import threw
|
|
42
|
+
* @param entryPoint - Absolute path of the entry file, if it is known
|
|
43
|
+
* @returns The cause, or undefined if the error is about something else
|
|
44
|
+
*/
|
|
45
|
+
function getNotBuiltCause(error, entryPoint) {
|
|
46
|
+
if (typeof error !== 'object' || error === null) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
const { code, message } = error;
|
|
50
|
+
if (code === 'ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING') {
|
|
51
|
+
return 'typescript-in-node-modules';
|
|
52
|
+
}
|
|
53
|
+
if (code === 'ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX') {
|
|
54
|
+
return 'typescript-unsupported';
|
|
55
|
+
}
|
|
56
|
+
if (typeof code !== 'string' || typeof message !== 'string') {
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
if (code === 'ERR_UNKNOWN_FILE_EXTENSION') {
|
|
60
|
+
if (!UNKNOWN_TYPESCRIPT.test(message)) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
return message.includes('node_modules') ? 'typescript-in-node-modules' : 'typescript';
|
|
64
|
+
}
|
|
65
|
+
if (!NOT_FOUND_CODES.has(code)) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const [, missing, importer = ''] = MISSING_TARGET.exec(message) ?? [];
|
|
69
|
+
if (missing === undefined || !ABSOLUTE_PATH.test(missing)) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
if (TYPESCRIPT_FILE.test(importer)) {
|
|
73
|
+
return 'typescript-unsupported';
|
|
74
|
+
}
|
|
75
|
+
return entryPoint === undefined || missing === entryPoint ? 'missing-file' : undefined;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=module-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-errors.js","sourceRoot":"","sources":["../../../src/module-errors.ts"],"names":[],"mappings":";;AAoBA,sDAYC;AA0BD,4CAiCC;AA3FD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAAC,CAAA;AAE7E,6EAA6E;AAC7E,MAAM,kBAAkB,GAAG,oCAAoC,CAAA;AAE/D;;;GAGG;AACH,MAAM,cAAc,GAAG,sEAAsE,CAAA;AAC7F,MAAM,aAAa,GAAG,sBAAsB,CAAA;AAC5C,MAAM,eAAe,GAAG,cAAc,CAAA;AAEtC;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,KAAc,EAAE,WAAmB;IACvE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI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