@adep/cli 0.0.9 → 0.1.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.
@@ -1,9 +1,9 @@
1
- // packages/runtime/src/functions/runtime/worker-entry.ts
1
+ // ../runtime/src/functions/runtime/worker-entry.ts
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
  import { createRequire } from "node:module";
4
4
  import { join } from "node:path";
5
5
 
6
- // packages/runtime/src/functions/runtime/cloud-container.ts
6
+ // ../runtime/src/functions/runtime/cloud-container.ts
7
7
  var KNOWN_CAPABILITY_HINTS = {
8
8
  db: {
9
9
  code: "DB_NOT_PROVISIONED",
@@ -79,11 +79,11 @@ function createCloudContainer() {
79
79
  };
80
80
  }
81
81
 
82
- // packages/runtime/src/functions/runtime/sandbox.ts
82
+ // ../runtime/src/functions/runtime/sandbox.ts
83
83
  import vm from "node:vm";
84
84
  import * as nodeModule from "node:module";
85
85
 
86
- // packages/runtime/src/functions/runtime/exports.ts
86
+ // ../runtime/src/functions/runtime/exports.ts
87
87
  function transformModule(code) {
88
88
  let out = code;
89
89
  const named = [];
@@ -125,7 +125,7 @@ function transformModule(code) {
125
125
  return out;
126
126
  }
127
127
 
128
- // packages/runtime/src/functions/runtime/sandbox.ts
128
+ // ../runtime/src/functions/runtime/sandbox.ts
129
129
  var bunTranspiler;
130
130
  function transpile(code) {
131
131
  const bun = globalThis["Bun"];
@@ -231,7 +231,7 @@ function loadFunctionModule(files, entry, sandboxGlobals, resolveBare) {
231
231
  return { handler };
232
232
  }
233
233
 
234
- // packages/runtime/src/functions/runtime/sandbox-fetch.ts
234
+ // ../runtime/src/functions/runtime/sandbox-fetch.ts
235
235
  var SandboxFetchError = class extends Error {
236
236
  code;
237
237
  constructor(code, message) {
@@ -410,7 +410,7 @@ function createSandboxFetch(options) {
410
410
  };
411
411
  }
412
412
 
413
- // packages/runtime/src/shared/capability-keys.ts
413
+ // ../runtime/src/shared/capability-keys.ts
414
414
  var RPC_CAPABILITY_KEY = "__adepRpc";
415
415
  var CHAIN_CAPABILITY_KEY = "__adepChain";
416
416
  var DB_RPC = {
@@ -428,7 +428,7 @@ var DB_RPC = {
428
428
  chain: "chain"
429
429
  };
430
430
 
431
- // packages/runtime/src/functions/runtime/chain.ts
431
+ // ../runtime/src/functions/runtime/chain.ts
432
432
  function isChainCapability(value) {
433
433
  if (typeof value !== "object" || value === null) return false;
434
434
  const spec = value[CHAIN_CAPABILITY_KEY];
@@ -499,7 +499,7 @@ function createChainClient(capability, port, pending, nextId, spec) {
499
499
  return makeRoot(void 0);
500
500
  }
501
501
 
502
- // packages/runtime/src/functions/deps/manifest.ts
502
+ // ../runtime/src/functions/deps/manifest.ts
503
503
  function splitBareSpecifier(request) {
504
504
  if (request.startsWith("@")) {
505
505
  const segments = request.split("/");
@@ -508,7 +508,7 @@ function splitBareSpecifier(request) {
508
508
  return request.split("/")[0];
509
509
  }
510
510
 
511
- // packages/runtime/src/functions/runtime/worker-entry.ts
511
+ // ../runtime/src/functions/runtime/worker-entry.ts
512
512
  function isRpcCapability(value) {
513
513
  return typeof value === "object" && value !== null && value[RPC_CAPABILITY_KEY] === true;
514
514
  }
package/package.json CHANGED
@@ -1,24 +1,49 @@
1
1
  {
2
2
  "name": "@adep/cli",
3
- "version": "0.0.9",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
- "description": "`adep` 命令行工具包位:登录 / 初始化 / 本地调试 / 部署 / 数据库维护 / 云存储 / 静态托管 / 微前端组件(widget),实现见任务单 CLI-001 ~ CLI-003 与 FE-002",
5
+ "description": "`adep` 命令行工具包位:登录 / 初始化 / 本地调试 / 部署 / 数据库维护 / 云存储 / 静态托管 / 微前端组件(widget),实现见任务单 CLI-001 ~ CLI-003 与 FE-002;子路径 `@adep/cli/vite` 提供云函数 vite 插件(CLI-014)",
6
6
  "bin": {
7
- "adep": "./dist/index.js"
7
+ "adep": "./src/index.ts"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "types": "./src/index.ts",
12
+ "default": "./src/index.ts"
13
+ },
14
+ "./vite": {
15
+ "types": "./src/vite.ts",
16
+ "default": "./src/vite.ts"
17
+ }
8
18
  },
9
19
  "files": [
10
20
  "dist"
11
21
  ],
22
+ "scripts": {
23
+ "test": "vitest run",
24
+ "init": "bun run src/index.ts init --template fullstack example1",
25
+ "build": "bun run ../../scripts/build-package.ts cli"
26
+ },
12
27
  "dependencies": {
13
28
  "commander": "14.0.2",
14
29
  "esbuild": "0.25.12"
15
30
  },
16
31
  "devDependencies": {
17
- "@adep/runtime": "0.1.3",
18
- "@adep/types": "0.1.4"
32
+ "@adep/runtime": "0.2.0",
33
+ "@adep/types": "0.2.0"
19
34
  },
20
- "scripts": {
21
- "test": "vitest run",
22
- "build": "bun run ../../scripts/build-package.ts cli"
23
- }
24
- }
35
+ "publishConfig": {
36
+ "bin": {
37
+ "adep": "./dist/index.js"
38
+ },
39
+ "exports": {
40
+ ".": {
41
+ "default": "./dist/index.js"
42
+ },
43
+ "./vite": {
44
+ "default": "./dist/vite.js"
45
+ }
46
+ }
47
+ },
48
+ "gitHead": "9c29cbb2a942afe4d4c7ae2987bcc229f6b99f9b"
49
+ }
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * adep bin 入口(CLI-001)。Bun 直接运行 TS;npm 发布与独立二进制打包归 CLI-003 / 后续任务。
4
+ */
5
+ import { buildProgram } from './cli'
6
+
7
+ const program = buildProgram()
8
+ await program.parseAsync(process.argv)