samplex 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 +7 -7
- package/dist/index.js +9 -5
- package/package.json +12 -8
- package/dist/index.cjs +0 -14659
package/README.md
CHANGED
|
@@ -38,13 +38,13 @@ npm install -g samplex # or: bun install -g samplex / pnpm install -g samplex
|
|
|
38
38
|
|
|
39
39
|
## Commands
|
|
40
40
|
|
|
41
|
-
| Command
|
|
42
|
-
|
|
|
43
|
-
| `samplex login`
|
|
44
|
-
| `samplex deploy [dir]`
|
|
45
|
-
| `samplex list`
|
|
46
|
-
| `samplex delete <slug>` | Delete a site by slug
|
|
47
|
-
| `samplex init`
|
|
41
|
+
| Command | Description |
|
|
42
|
+
| ----------------------- | ---------------------------------------- |
|
|
43
|
+
| `samplex login` | Authenticate via browser (OAuth2 + PKCE) |
|
|
44
|
+
| `samplex deploy [dir]` | Deploy a directory to a preview URL |
|
|
45
|
+
| `samplex list` | List your deployed sites |
|
|
46
|
+
| `samplex delete <slug>` | Delete a site by slug |
|
|
47
|
+
| `samplex init` | Initialize or view project config |
|
|
48
48
|
|
|
49
49
|
## Project config
|
|
50
50
|
|
package/dist/index.js
CHANGED
|
@@ -14351,8 +14351,8 @@ config(en_default());
|
|
|
14351
14351
|
// ../env/src/cli.ts
|
|
14352
14352
|
var env = createEnv({
|
|
14353
14353
|
server: {
|
|
14354
|
-
SMPL_AUTH_URL: external_exports.url().default("
|
|
14355
|
-
SMPL_API_URL: external_exports.url().default("
|
|
14354
|
+
SMPL_AUTH_URL: external_exports.url().default("https://sample.app"),
|
|
14355
|
+
SMPL_API_URL: external_exports.url().default("https://sample.app"),
|
|
14356
14356
|
SMPL_LOG_LEVEL: external_exports.enum(["debug", "info", "warn", "error", "silent"]).default("info")
|
|
14357
14357
|
},
|
|
14358
14358
|
runtimeEnv: process.env,
|
|
@@ -14364,7 +14364,10 @@ var callback_default = '<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset
|
|
|
14364
14364
|
|
|
14365
14365
|
// src/lib/auth.ts
|
|
14366
14366
|
function renderCallbackPage(success2) {
|
|
14367
|
-
return callback_default.replace("{{STATE_CLASS}}", success2 ? "success" : "error").replace("{{ICON}}", success2 ? "✓" : "✗").replace("{{TITLE}}", success2 ? "Login successful" : "Login failed").replace(
|
|
14367
|
+
return callback_default.replace("{{STATE_CLASS}}", success2 ? "success" : "error").replace("{{ICON}}", success2 ? "✓" : "✗").replace("{{TITLE}}", success2 ? "Login successful" : "Login failed").replace(
|
|
14368
|
+
"{{MESSAGE}}",
|
|
14369
|
+
success2 ? "You can close this tab and return to the CLI." : "Missing authorization code. Please try again."
|
|
14370
|
+
);
|
|
14368
14371
|
}
|
|
14369
14372
|
var API_BASE = env.SMPL_API_URL;
|
|
14370
14373
|
var CALLBACK_PORTS = [18457, 18458, 18459];
|
|
@@ -14453,6 +14456,7 @@ function buildAuthorizationUrl(params) {
|
|
|
14453
14456
|
"scope",
|
|
14454
14457
|
"openid profile email offline_access site:deploy site:read site:delete"
|
|
14455
14458
|
);
|
|
14459
|
+
url2.searchParams.set("resource", `${API_BASE}/api/auth`);
|
|
14456
14460
|
return url2.toString();
|
|
14457
14461
|
}
|
|
14458
14462
|
|
|
@@ -14592,7 +14596,7 @@ import ora2 from "ora";
|
|
|
14592
14596
|
import * as tar from "tar";
|
|
14593
14597
|
|
|
14594
14598
|
// package.json
|
|
14595
|
-
var version2 = "0.1.
|
|
14599
|
+
var version2 = "0.1.3";
|
|
14596
14600
|
|
|
14597
14601
|
// src/lib/version.ts
|
|
14598
14602
|
function loadVersion() {
|
|
@@ -14869,7 +14873,7 @@ async function listCommand() {
|
|
|
14869
14873
|
try {
|
|
14870
14874
|
const sites = await rpc("site.list");
|
|
14871
14875
|
if (sites.length === 0) {
|
|
14872
|
-
console.log("No sites deployed yet. Run `
|
|
14876
|
+
console.log("No sites deployed yet. Run `samplex deploy` to get started.");
|
|
14873
14877
|
return;
|
|
14874
14878
|
}
|
|
14875
14879
|
console.log(chalk4.bold("\nYour sites:\n"));
|
package/package.json
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "samplex",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Deploy static sites to shareable preview URLs from the command line",
|
|
5
5
|
"homepage": "https://sample.app",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Genmod",
|
|
8
8
|
"bin": {
|
|
9
|
-
"samplex": "
|
|
9
|
+
"samplex": "dist/index.js"
|
|
10
10
|
},
|
|
11
|
-
|
|
11
|
+
"files": [
|
|
12
12
|
"dist",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"README.md"
|
|
15
15
|
],
|
|
16
16
|
"type": "module",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public",
|
|
19
|
+
"provenance": false
|
|
20
|
+
},
|
|
17
21
|
"scripts": {
|
|
18
22
|
"build": "tsup src/index.ts --dts",
|
|
19
23
|
"check-types": "tsc --noEmit",
|
|
@@ -22,9 +26,9 @@
|
|
|
22
26
|
},
|
|
23
27
|
"dependencies": {
|
|
24
28
|
"chalk": "^5.3.0",
|
|
25
|
-
"commander": "^
|
|
26
|
-
"open": "^
|
|
27
|
-
"ora": "^
|
|
29
|
+
"commander": "^14.0.3",
|
|
30
|
+
"open": "^11.0.0",
|
|
31
|
+
"ora": "^9.3.0",
|
|
28
32
|
"tar": "^7.0.0"
|
|
29
33
|
},
|
|
30
34
|
"devDependencies": {
|