@web-applets/inspector 0.2.0-alpha.9 → 0.2.1
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/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/package.json +4 -3
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../cli/index.ts"],"names":[],"mappings":";AAeA,wBAAsB,KAAK,kBAyB1B"}
|
package/dist/index.js
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
"use strict";
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
5
|
+
};
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
+
exports.serve = serve;
|
8
|
+
const commander_1 = require("commander");
|
9
|
+
const express_1 = __importDefault(require("express"));
|
10
|
+
const path_1 = __importDefault(require("path"));
|
11
|
+
const program = new commander_1.Command();
|
12
|
+
program
|
13
|
+
.name('@web-applets/inspector')
|
14
|
+
.description('Launch the web applets inspector.')
|
15
|
+
.action(serve);
|
16
|
+
program.parse(process.argv);
|
17
|
+
async function serve() {
|
18
|
+
let port = 1234;
|
19
|
+
const serverDir = path_1.default.join(__dirname, 'web');
|
20
|
+
const app = (0, express_1.default)();
|
21
|
+
app.use(express_1.default.static(serverDir));
|
22
|
+
try {
|
23
|
+
const server = app
|
24
|
+
.listen(port, () => {
|
25
|
+
console.log(`Applets inspector running at http://localhost:${port}`);
|
26
|
+
})
|
27
|
+
.on('error', (err) => {
|
28
|
+
if (err.code === 'EADDRINUSE') {
|
29
|
+
const oldPort = port;
|
30
|
+
port += 1;
|
31
|
+
console.log(`Port ${oldPort} is busy, trying port ${port}`);
|
32
|
+
server.listen(port);
|
33
|
+
}
|
34
|
+
else {
|
35
|
+
console.error(err);
|
36
|
+
}
|
37
|
+
});
|
38
|
+
}
|
39
|
+
catch (error) {
|
40
|
+
console.error('Error starting inspector web server:', error);
|
41
|
+
process.exit(1);
|
42
|
+
}
|
43
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"name": "@web-applets/inspector",
|
3
|
-
"version": "0.2.0-alpha.9",
|
4
3
|
"author": "Rupert Manfredi <rupert@unternet.co>",
|
5
4
|
"license": "MIT",
|
6
5
|
"main": "dist/index.js",
|
@@ -10,7 +9,8 @@
|
|
10
9
|
"start": "npm run build && node dist/index.js",
|
11
10
|
"build": "./scripts/build.sh",
|
12
11
|
"build:cli": "tsc",
|
13
|
-
"build:web": "cd web && npm run build"
|
12
|
+
"build:web": "cd web && npm run build",
|
13
|
+
"prepublishOnly": "npm run build"
|
14
14
|
},
|
15
15
|
"files": [
|
16
16
|
"dist"
|
@@ -34,5 +34,6 @@
|
|
34
34
|
"@types/fs-extra": "^11.0.4",
|
35
35
|
"@types/node": "^22.7.5",
|
36
36
|
"typescript": "^5.6.2"
|
37
|
-
}
|
37
|
+
},
|
38
|
+
"version": "0.2.1"
|
38
39
|
}
|