shadcn-studio-extension-cli 0.1.1 → 0.1.3
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/README.md +1 -0
- package/dist/THIRD_PARTY_LICENSES.txt +1 -1
- package/dist/build-meta.json +41 -12
- package/dist/index.cjs +57 -6
- package/dist/index.cjs.map +4 -4
- package/dist/toolbar-app/.vite/manifest.json +4 -4
- package/dist/toolbar-app/index-ChCX2CjU.js +8917 -0
- package/dist/toolbar-app/index.js +35 -35
- package/dist/toolbar-app/plugin-sdk.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/build-meta.json
CHANGED
|
@@ -7217,7 +7217,7 @@
|
|
|
7217
7217
|
"format": "esm"
|
|
7218
7218
|
},
|
|
7219
7219
|
"src/config/index.ts": {
|
|
7220
|
-
"bytes":
|
|
7220
|
+
"bytes": 8647,
|
|
7221
7221
|
"imports": [
|
|
7222
7222
|
{
|
|
7223
7223
|
"path": "src/auth/oauth.ts",
|
|
@@ -11089,7 +11089,7 @@
|
|
|
11089
11089
|
"format": "esm"
|
|
11090
11090
|
},
|
|
11091
11091
|
"src/server/proxy.ts": {
|
|
11092
|
-
"bytes":
|
|
11092
|
+
"bytes": 2335,
|
|
11093
11093
|
"imports": [
|
|
11094
11094
|
{
|
|
11095
11095
|
"path": "../../node_modules/.pnpm/http-proxy-middleware@3.0.5/node_modules/http-proxy-middleware/dist/index.js",
|
|
@@ -11102,14 +11102,14 @@
|
|
|
11102
11102
|
"original": "../config"
|
|
11103
11103
|
},
|
|
11104
11104
|
{
|
|
11105
|
-
"path": "src/
|
|
11105
|
+
"path": "src/utils/logger.ts",
|
|
11106
11106
|
"kind": "import-statement",
|
|
11107
|
-
"original": "
|
|
11107
|
+
"original": "../utils/logger"
|
|
11108
11108
|
},
|
|
11109
11109
|
{
|
|
11110
|
-
"path": "src/
|
|
11110
|
+
"path": "src/server/error-page.ts",
|
|
11111
11111
|
"kind": "import-statement",
|
|
11112
|
-
"original": "
|
|
11112
|
+
"original": "./error-page"
|
|
11113
11113
|
},
|
|
11114
11114
|
{
|
|
11115
11115
|
"path": "src/server/proxy-utils/headers-rewrites.ts",
|
|
@@ -11247,8 +11247,24 @@
|
|
|
11247
11247
|
],
|
|
11248
11248
|
"format": "esm"
|
|
11249
11249
|
},
|
|
11250
|
+
"src/utils/check-port.ts": {
|
|
11251
|
+
"bytes": 809,
|
|
11252
|
+
"imports": [
|
|
11253
|
+
{
|
|
11254
|
+
"path": "node:net",
|
|
11255
|
+
"kind": "import-statement",
|
|
11256
|
+
"external": true
|
|
11257
|
+
},
|
|
11258
|
+
{
|
|
11259
|
+
"path": "<runtime>",
|
|
11260
|
+
"kind": "import-statement",
|
|
11261
|
+
"external": true
|
|
11262
|
+
}
|
|
11263
|
+
],
|
|
11264
|
+
"format": "esm"
|
|
11265
|
+
},
|
|
11250
11266
|
"src/index.ts": {
|
|
11251
|
-
"bytes":
|
|
11267
|
+
"bytes": 10806,
|
|
11252
11268
|
"imports": [
|
|
11253
11269
|
{
|
|
11254
11270
|
"path": "../../node_modules/.pnpm/open@10.1.2/node_modules/open/index.js",
|
|
@@ -11315,6 +11331,11 @@
|
|
|
11315
11331
|
"kind": "import-statement",
|
|
11316
11332
|
"original": "./utils/telemetry"
|
|
11317
11333
|
},
|
|
11334
|
+
{
|
|
11335
|
+
"path": "src/utils/check-port.ts",
|
|
11336
|
+
"kind": "dynamic-import",
|
|
11337
|
+
"original": "./utils/check-port.js"
|
|
11338
|
+
},
|
|
11318
11339
|
{
|
|
11319
11340
|
"path": "<runtime>",
|
|
11320
11341
|
"kind": "import-statement",
|
|
@@ -11329,7 +11350,7 @@
|
|
|
11329
11350
|
"imports": [],
|
|
11330
11351
|
"exports": [],
|
|
11331
11352
|
"inputs": {},
|
|
11332
|
-
"bytes":
|
|
11353
|
+
"bytes": 6270887
|
|
11333
11354
|
},
|
|
11334
11355
|
"dist/index.cjs": {
|
|
11335
11356
|
"imports": [
|
|
@@ -12178,6 +12199,11 @@
|
|
|
12178
12199
|
"kind": "require-call",
|
|
12179
12200
|
"external": true
|
|
12180
12201
|
},
|
|
12202
|
+
{
|
|
12203
|
+
"path": "node:net",
|
|
12204
|
+
"kind": "require-call",
|
|
12205
|
+
"external": true
|
|
12206
|
+
},
|
|
12181
12207
|
{
|
|
12182
12208
|
"path": "node:process",
|
|
12183
12209
|
"kind": "require-call",
|
|
@@ -13719,6 +13745,9 @@
|
|
|
13719
13745
|
"../../node_modules/.pnpm/http-proxy-middleware@3.0.5/node_modules/http-proxy-middleware/dist/index.js": {
|
|
13720
13746
|
"bytesInOutput": 1233
|
|
13721
13747
|
},
|
|
13748
|
+
"src/utils/check-port.ts": {
|
|
13749
|
+
"bytesInOutput": 745
|
|
13750
|
+
},
|
|
13722
13751
|
"../../node_modules/.pnpm/open@10.1.2/node_modules/open/index.js": {
|
|
13723
13752
|
"bytesInOutput": 9631
|
|
13724
13753
|
},
|
|
@@ -14086,7 +14115,7 @@
|
|
|
14086
14115
|
"bytesInOutput": 0
|
|
14087
14116
|
},
|
|
14088
14117
|
"src/config/index.ts": {
|
|
14089
|
-
"bytesInOutput":
|
|
14118
|
+
"bytesInOutput": 6602
|
|
14090
14119
|
},
|
|
14091
14120
|
"src/dependency-parser/index.ts": {
|
|
14092
14121
|
"bytesInOutput": 3554
|
|
@@ -14119,7 +14148,7 @@
|
|
|
14119
14148
|
"bytesInOutput": 6791
|
|
14120
14149
|
},
|
|
14121
14150
|
"src/server/proxy.ts": {
|
|
14122
|
-
"bytesInOutput":
|
|
14151
|
+
"bytesInOutput": 1959
|
|
14123
14152
|
},
|
|
14124
14153
|
"src/server/error-page.ts": {
|
|
14125
14154
|
"bytesInOutput": 1638
|
|
@@ -14134,10 +14163,10 @@
|
|
|
14134
14163
|
"bytesInOutput": 3729
|
|
14135
14164
|
},
|
|
14136
14165
|
"src/index.ts": {
|
|
14137
|
-
"bytesInOutput":
|
|
14166
|
+
"bytesInOutput": 7811
|
|
14138
14167
|
}
|
|
14139
14168
|
},
|
|
14140
|
-
"bytes":
|
|
14169
|
+
"bytes": 3808425
|
|
14141
14170
|
}
|
|
14142
14171
|
}
|
|
14143
14172
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -57548,6 +57548,36 @@ var require_dist = __commonJS({
|
|
|
57548
57548
|
}
|
|
57549
57549
|
});
|
|
57550
57550
|
|
|
57551
|
+
// src/utils/check-port.ts
|
|
57552
|
+
var check_port_exports = {};
|
|
57553
|
+
__export(check_port_exports, {
|
|
57554
|
+
isPortListening: () => isPortListening
|
|
57555
|
+
});
|
|
57556
|
+
async function isPortListening(port2, host = "localhost", timeout = 1e3) {
|
|
57557
|
+
return new Promise((resolve3) => {
|
|
57558
|
+
const socket = (0, import_node_net.createConnection)({ port: port2, host }, () => {
|
|
57559
|
+
socket.end();
|
|
57560
|
+
resolve3(true);
|
|
57561
|
+
});
|
|
57562
|
+
socket.setTimeout(timeout);
|
|
57563
|
+
socket.on("error", () => {
|
|
57564
|
+
resolve3(false);
|
|
57565
|
+
});
|
|
57566
|
+
socket.on("timeout", () => {
|
|
57567
|
+
socket.destroy();
|
|
57568
|
+
resolve3(false);
|
|
57569
|
+
});
|
|
57570
|
+
});
|
|
57571
|
+
}
|
|
57572
|
+
var import_node_net;
|
|
57573
|
+
var init_check_port = __esm({
|
|
57574
|
+
"src/utils/check-port.ts"() {
|
|
57575
|
+
"use strict";
|
|
57576
|
+
import_node_net = require("node:net");
|
|
57577
|
+
__name(isPortListening, "isPortListening");
|
|
57578
|
+
}
|
|
57579
|
+
});
|
|
57580
|
+
|
|
57551
57581
|
// ../../node_modules/.pnpm/open@10.1.2/node_modules/open/index.js
|
|
57552
57582
|
var import_node_process5 = __toESM(require("node:process"), 1);
|
|
57553
57583
|
var import_node_buffer = require("node:buffer");
|
|
@@ -73676,6 +73706,7 @@ var configFileExists = /* @__PURE__ */ __name(async (dir) => {
|
|
|
73676
73706
|
}, "configFileExists");
|
|
73677
73707
|
|
|
73678
73708
|
// src/config/index.ts
|
|
73709
|
+
var DEFAULT_PORT = 3200;
|
|
73679
73710
|
var ConfigResolver = class {
|
|
73680
73711
|
static {
|
|
73681
73712
|
__name(this, "ConfigResolver");
|
|
@@ -73729,7 +73760,7 @@ Please fix the errors in ${CONFIG_FILE_NAME} and try again.`
|
|
|
73729
73760
|
await saveConfigFile(workspace, { appPort: appPort3 });
|
|
73730
73761
|
}
|
|
73731
73762
|
this.config = {
|
|
73732
|
-
port: port ||
|
|
73763
|
+
port: port || DEFAULT_PORT,
|
|
73733
73764
|
appPort: appPort3,
|
|
73734
73765
|
dir: workspace,
|
|
73735
73766
|
silent,
|
|
@@ -73763,7 +73794,7 @@ Please fix the errors in ${CONFIG_FILE_NAME} and try again.`
|
|
|
73763
73794
|
}
|
|
73764
73795
|
throw error;
|
|
73765
73796
|
}
|
|
73766
|
-
const port2 = port || configFile?.port ||
|
|
73797
|
+
const port2 = port || configFile?.port || DEFAULT_PORT;
|
|
73767
73798
|
let appPort2 = appPort || configFile?.appPort;
|
|
73768
73799
|
const autoPlugins = configFile?.autoPlugins ?? true;
|
|
73769
73800
|
const plugins = configFile?.plugins ?? [];
|
|
@@ -96809,9 +96840,17 @@ var proxy = (0, import_http_proxy_middleware.createProxyMiddleware)({
|
|
|
96809
96840
|
// @ts-expect-error
|
|
96810
96841
|
error: /* @__PURE__ */ __name((err, _req, res) => {
|
|
96811
96842
|
log.error(`Proxy error: ${err.message}`);
|
|
96812
|
-
|
|
96813
|
-
|
|
96814
|
-
|
|
96843
|
+
if (res && typeof res.writeHead === "function" && !res.headersSent) {
|
|
96844
|
+
try {
|
|
96845
|
+
const config = configResolver.getConfig();
|
|
96846
|
+
res.writeHead(503, { "Content-Type": "text/html" });
|
|
96847
|
+
res.end(errorPage(config.appPort));
|
|
96848
|
+
} catch (writeError) {
|
|
96849
|
+
log.debug(
|
|
96850
|
+
`Failed to send error response: ${writeError instanceof Error ? writeError.message : "Unknown error"}`
|
|
96851
|
+
);
|
|
96852
|
+
}
|
|
96853
|
+
}
|
|
96815
96854
|
}, "error"),
|
|
96816
96855
|
proxyRes: /* @__PURE__ */ __name((proxyRes) => {
|
|
96817
96856
|
applyHeaderRewrites(proxyRes);
|
|
@@ -97210,7 +97249,7 @@ async function main() {
|
|
|
97210
97249
|
return;
|
|
97211
97250
|
}
|
|
97212
97251
|
try {
|
|
97213
|
-
const port2 =
|
|
97252
|
+
const port2 = DEFAULT_PORT;
|
|
97214
97253
|
const tokenData = await oauthManager.initiateOAuthFlow(
|
|
97215
97254
|
port2,
|
|
97216
97255
|
void 0,
|
|
@@ -97339,6 +97378,18 @@ async function main() {
|
|
|
97339
97378
|
);
|
|
97340
97379
|
}
|
|
97341
97380
|
const { server } = await getServer();
|
|
97381
|
+
if (config.appPort) {
|
|
97382
|
+
const { isPortListening: isPortListening2 } = await Promise.resolve().then(() => (init_check_port(), check_port_exports));
|
|
97383
|
+
const isAppPortAvailable = await isPortListening2(config.appPort);
|
|
97384
|
+
if (!isAppPortAvailable) {
|
|
97385
|
+
log.warn(
|
|
97386
|
+
`\u26A0\uFE0F Warning: App port ${config.appPort} is not responding. Make sure your application is running on port ${config.appPort}.`
|
|
97387
|
+
);
|
|
97388
|
+
log.warn(
|
|
97389
|
+
` The Shadcn IDE Extension will still start, but proxying will not work until your app is running.`
|
|
97390
|
+
);
|
|
97391
|
+
}
|
|
97392
|
+
}
|
|
97342
97393
|
server.listen(config.port);
|
|
97343
97394
|
server.on("listening", async () => {
|
|
97344
97395
|
const address = server.address();
|