renku 0.0.6 → 0.0.7
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/auth.d.ts +1 -1
- package/dist/bash-complete.js +1 -1
- package/dist/bun.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/cloudflare.d.ts +2 -2
- package/dist/cloudflare.worker.d.ts +2 -2
- package/dist/context-CJSW8XEm.js +1 -0
- package/dist/data.d.ts +29 -59
- package/dist/data.js +1 -1
- package/dist/dom.d.ts +2 -2
- package/dist/{fragment-Bly9noQG.d.ts → fragment-CFpBSLG-.d.ts} +1 -1
- package/dist/{index-iMWKMtYV.d.ts → index-B4ezGLrO.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/jsx-dev-runtime.d.ts +2 -2
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/{types-BSW-pDJE.d.ts → types-DNwmCBRS.d.ts} +2 -2
- package/dist/ui.d.ts +1 -1
- package/package.json +20 -15
- package/dist/context-BZxerv82.js +0 -23
- package/dist/impl-CQ7GTRH2-Db6HOvCd.js +0 -5
- /package/dist/{impl-qmFhldR7.js → impl-BUY8ltUJ.js} +0 -0
- /package/dist/{impl-6Uc2Rt9O.js → impl-BxvCfMB-.js} +0 -0
- /package/dist/{impl-D9kbwKWf.js → impl-feCBBL4G.js} +0 -0
- /package/dist/{register-server-function-CqA4nPaJ.d.ts → register-server-function-J_wGw2NL.d.ts} +0 -0
- /package/dist/{types-BcEav58N.d.ts → types--K8aCg53.d.ts} +0 -0
- /package/dist/{types-BEYIs1ZF.d.ts → types-BOj-9dR5.d.ts} +0 -0
- /package/dist/{types-B4Ij4y1d.d.ts → types-CkYeGxWb.d.ts} +0 -0
package/dist/auth.d.ts
CHANGED
package/dist/bash-complete.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import{
|
|
2
|
+
import{n as e,t}from"./context-CJSW8XEm.js";import{proposeCompletions as n}from"@stricli/core";const r=process.argv.slice(3);process.env.COMP_LINE?.endsWith(` `)&&r.push(``),await n(e,r,t(process));try{for(let{completion:i}of await n(e,r,t(process)))process.stdout.write(`${i}\n`)}catch{}
|
package/dist/bun.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import{n as e,
|
|
2
|
+
import{n as e,t}from"./context-CJSW8XEm.js";import{run as n}from"@stricli/core";await n(e,process.argv.slice(2),t(process));
|
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { r as Routes } from "./types-
|
|
2
|
-
import { n as getAuthRoutes, r as durableObjectHandler, t as renku } from "./index-
|
|
1
|
+
import { r as Routes } from "./types-DNwmCBRS.js";
|
|
2
|
+
import { n as getAuthRoutes, r as durableObjectHandler, t as renku } from "./index-B4ezGLrO.js";
|
|
3
3
|
export { Routes, durableObjectHandler, getAuthRoutes, renku };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as Routes } from "./types-
|
|
2
|
-
import { n as getAuthRoutes, r as durableObjectHandler, t as renku } from "./index-
|
|
1
|
+
import { r as Routes } from "./types-DNwmCBRS.js";
|
|
2
|
+
import { n as getAuthRoutes, r as durableObjectHandler, t as renku } from "./index-B4ezGLrO.js";
|
|
3
3
|
import { DurableObject } from "cloudflare:workers";
|
|
4
4
|
|
|
5
5
|
//#region src/cloudflare/durable-objects/auth.d.ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildApplication as e,buildCommand as t,buildRouteMap as n}from"@stricli/core";import{buildInstallCommand as r,buildUninstallCommand as i}from"@stricli/auto-complete";import a from"node:fs";import o from"node:os";import s from"node:path";var c=`renku`,l=`0.0.7`,u=`Renku`;const d=n({routes:{ios:t({loader:async()=>{let{ios:e}=await import(`./impl-BxvCfMB-.js`);return e},parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Nested ios command`}}),android:t({loader:async()=>{let{android:e}=await import(`./impl-BxvCfMB-.js`);return e},parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Nested android command`}})},docs:{brief:`Native app generation`}}),f=n({routes:{foo:t({loader:async()=>{let{foo:e}=await import(`./impl-BUY8ltUJ.js`);return e},parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Nested foo command`}}),bar:t({loader:async()=>{let{bar:e}=await import(`./impl-BUY8ltUJ.js`);return e},parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Nested bar command`}})},docs:{brief:`Nested commands`}}),p=e(n({routes:{subdir:t({loader:async()=>import(`./impl-feCBBL4G.js`),parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Command in subdirectory`}}),nested:f,native:d,install:r(`my-app`,{bash:`__my-app_bash_complete`}),uninstall:i(`my-app`,{bash:!0})},docs:{brief:u,hideRoute:{install:!0,uninstall:!0}}}),{name:c,versionInfo:{currentVersion:l}});function m(e){return{process:e,os:o,fs:a,path:s}}export{p as n,m as t};
|
package/dist/data.d.ts
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
import { n as Loader, o as Signal } from "./types-
|
|
1
|
+
import { n as Loader, o as Signal } from "./types-BOj-9dR5.js";
|
|
2
2
|
import { RpcStub, RpcTarget } from "capnweb";
|
|
3
3
|
import { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
|
|
5
5
|
//#region src/data/schema/types.d.ts
|
|
6
|
-
|
|
6
|
+
type Schema = {
|
|
7
7
|
[key: string]: ObjectSchema;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
};
|
|
9
|
+
type EnhancedSchema<T extends Schema> = { [K in keyof T]: EnhancedObjectSchema<T[K]> };
|
|
10
|
+
type ObjectSchema = {
|
|
10
11
|
id: IdSchema;
|
|
11
12
|
[key: string]: PropertySchema;
|
|
12
|
-
}
|
|
13
|
+
};
|
|
14
|
+
type EnhancedObjectSchema<T extends ObjectSchema> = { [K in keyof T]: T[K] & StandardSchemaV1 & StandardJSONSchemaV1 } & StandardSchemaV1 & StandardJSONSchemaV1;
|
|
13
15
|
type PropertySchema = IdSchema | StringSchema | NumberSchema | BooleanSchema;
|
|
14
|
-
/**
|
|
15
|
-
* Enhanced ObjectSchema with Standard Schema v1 support.
|
|
16
|
-
* Includes validation and JSON Schema generation capabilities.
|
|
17
|
-
*/
|
|
18
|
-
type EnhancedObjectSchema<T extends ObjectSchema> = T & StandardSchemaV1<Item<T>, Item<T>> & StandardJSONSchemaV1<Item<T>, Item<T>>;
|
|
19
|
-
/**
|
|
20
|
-
* Enhanced Schema type where each collection becomes a Standard Schema.
|
|
21
|
-
*/
|
|
22
|
-
type EnhancedSchema<T extends Schema> = { [K in keyof T]: EnhancedObjectSchema<T[K]> };
|
|
23
16
|
interface IdSchema extends PropertyBaseSchema {
|
|
24
17
|
type: "string";
|
|
25
18
|
required: true;
|
|
@@ -69,15 +62,6 @@ declare class MessageQueue {
|
|
|
69
62
|
add(message: SyncMessage): void;
|
|
70
63
|
}
|
|
71
64
|
//#endregion
|
|
72
|
-
//#region src/data/db/types.d.ts
|
|
73
|
-
type Binding = string | number;
|
|
74
|
-
interface Database {
|
|
75
|
-
exec: (sql: string, ...bind: Binding[]) => void;
|
|
76
|
-
query: <T = unknown>(sql: string, ...bindings: unknown[]) => T[];
|
|
77
|
-
transaction: (callback: (db: Database) => void) => void;
|
|
78
|
-
clientId: string;
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
65
|
//#region src/data/collection/collection.d.ts
|
|
82
66
|
declare class Collection<T extends Schema, K$1 extends keyof T> {
|
|
83
67
|
#private;
|
|
@@ -85,14 +69,12 @@ declare class Collection<T extends Schema, K$1 extends keyof T> {
|
|
|
85
69
|
name,
|
|
86
70
|
obj,
|
|
87
71
|
clientId,
|
|
88
|
-
messageQueue
|
|
89
|
-
db
|
|
72
|
+
messageQueue
|
|
90
73
|
}: {
|
|
91
74
|
name: string;
|
|
92
75
|
obj: T[K$1];
|
|
93
76
|
clientId: string;
|
|
94
77
|
messageQueue: MessageQueue;
|
|
95
|
-
db?: Database;
|
|
96
78
|
});
|
|
97
79
|
mock(): Item<T[K$1]>;
|
|
98
80
|
get items(): Signal.State<Item<T[K$1]>[]>;
|
|
@@ -104,6 +86,7 @@ declare class Collection<T extends Schema, K$1 extends keyof T> {
|
|
|
104
86
|
first(params?: Omit<QueryParams<T, K$1>, "single" | "limit">): Signal.Computed<Item<T[K$1]> | undefined>;
|
|
105
87
|
all(): Signal.Computed<Item<T[K$1]>[]>;
|
|
106
88
|
add(item: Item<T[K$1]>): Item<T[K$1]>;
|
|
89
|
+
loadItems(items: Item<T[K$1]>[]): void;
|
|
107
90
|
}
|
|
108
91
|
//#endregion
|
|
109
92
|
//#region src/data/collection/remote-collection.d.ts
|
|
@@ -139,6 +122,19 @@ type QueryParams<T extends Schema, K$1 extends keyof T> = {
|
|
|
139
122
|
limit?: number;
|
|
140
123
|
first?: boolean;
|
|
141
124
|
};
|
|
125
|
+
/**
|
|
126
|
+
* Type for initial data load - maps each collection name to an array of items.
|
|
127
|
+
*/
|
|
128
|
+
type LoadData<T extends Schema> = { [K in keyof T]: Item<T[K]>[] };
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/data/db/types.d.ts
|
|
131
|
+
type Binding = string | number;
|
|
132
|
+
interface Database {
|
|
133
|
+
exec: (sql: string, ...bind: Binding[]) => void;
|
|
134
|
+
query: <T = unknown>(sql: string, ...bindings: unknown[]) => T[];
|
|
135
|
+
transaction: (callback: (db: Database) => void) => void;
|
|
136
|
+
clientId: string;
|
|
137
|
+
}
|
|
142
138
|
//#endregion
|
|
143
139
|
//#region src/data/data/data.d.ts
|
|
144
140
|
declare class Data<T extends Schema> extends RpcTarget {
|
|
@@ -153,6 +149,7 @@ declare class Data<T extends Schema> extends RpcTarget {
|
|
|
153
149
|
});
|
|
154
150
|
protected get _collections(): Collections<T>;
|
|
155
151
|
protected get _remoteCollections(): RemoteCollections<T>;
|
|
152
|
+
protected get _db(): Database | undefined;
|
|
156
153
|
get schema(): T;
|
|
157
154
|
get clientId(): string;
|
|
158
155
|
ingest(message: SyncMessage): void;
|
|
@@ -176,7 +173,7 @@ declare class ServerData<T extends Schema> extends Data<T> {
|
|
|
176
173
|
storage: DurableObjectStorage;
|
|
177
174
|
}): ServerData<T>;
|
|
178
175
|
get collections(): RemoteCollections<T>;
|
|
179
|
-
load():
|
|
176
|
+
load(): LoadData<T>;
|
|
180
177
|
connect({
|
|
181
178
|
clientId,
|
|
182
179
|
ingest
|
|
@@ -218,37 +215,10 @@ declare class ClientData<T extends Schema> extends Data<T> {
|
|
|
218
215
|
}
|
|
219
216
|
//#endregion
|
|
220
217
|
//#region src/data/schema/schema.d.ts
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
* Each collection in the schema becomes its own Standard Schema that supports:
|
|
226
|
-
* - Item-level validation (required fields, type checking)
|
|
227
|
-
* - JSON Schema generation (draft-2020-12, draft-07)
|
|
228
|
-
*
|
|
229
|
-
* @param inputSchema - The Renku schema definition
|
|
230
|
-
* @returns Enhanced schema with Standard Schema support
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* ```ts
|
|
234
|
-
* const mySchema = schema({
|
|
235
|
-
* user: {
|
|
236
|
-
* id,
|
|
237
|
-
* email: { type: "string", required: true },
|
|
238
|
-
* age: { type: "number" },
|
|
239
|
-
* },
|
|
240
|
-
* });
|
|
241
|
-
*
|
|
242
|
-
* // Validate an item
|
|
243
|
-
* const result = mySchema.user["~standard"].validate({ ... });
|
|
244
|
-
*
|
|
245
|
-
* // Generate JSON Schema
|
|
246
|
-
* const jsonSchema = mySchema.user["~standard"].jsonSchema.output({
|
|
247
|
-
* target: "draft-2020-12"
|
|
248
|
-
* });
|
|
249
|
-
* ```
|
|
250
|
-
*/
|
|
251
|
-
declare const schema$1: <T extends Schema>(inputSchema: T) => EnhancedSchema<T>;
|
|
218
|
+
declare const schema$1: <const T extends Schema>(definition: T) => T;
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/data/schema/enhanced-schema.d.ts
|
|
221
|
+
declare const enhancedSchema: <T extends Schema>(definition: T) => EnhancedSchema<T>;
|
|
252
222
|
//#endregion
|
|
253
223
|
//#region src/data/schema/id.d.ts
|
|
254
224
|
declare const id: IdSchema;
|
|
@@ -264,4 +234,4 @@ declare const id: IdSchema;
|
|
|
264
234
|
*/
|
|
265
235
|
declare function validatePropertyValue(propertySchema: PropertySchema, value: unknown): StandardSchemaV1.Result<string | number | boolean>;
|
|
266
236
|
//#endregion
|
|
267
|
-
export { ClientData, type
|
|
237
|
+
export { ClientData, type IdSchema, type Item, type LoadData, type Schema, ServerData, enhancedSchema, id, schema$1 as schema, validatePropertyValue };
|
package/dist/data.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./signal-store-0zk-69gB.js";import{n as e,t}from"./create-computed-CgSmvZ_e.js";import{t as n}from"./create-loader-Bnk94Dhg.js";import{
|
|
1
|
+
import"./signal-store-0zk-69gB.js";import{n as e,t}from"./create-computed-CgSmvZ_e.js";import{t as n}from"./create-loader-Bnk94Dhg.js";import{RpcTarget as r}from"capnweb";const i=e=>{switch(e){case`string`:return`TEXT`;case`number`:return`INTEGER`;case`boolean`:return`INTEGER`;default:throw Error(`Unsupported type: ${String(e)}`)}},a=e=>{let t=``;for(let[n,r]of Object.entries(e).filter(([e])=>e!==`~standard`)){let e=Object.entries(r).filter(([e])=>e!==`~standard`).map(([e,t])=>`${e} ${i(t.type)}`).join(`, `);e&&(t+=`CREATE TABLE IF NOT EXISTS obj_${n} (${e});`)}return t+=`CREATE TABLE IF NOT EXISTS __renku (id TEXT NOT NULL PRIMARY KEY, value TEXT NOT NULL);`,t+=`INSERT INTO __renku (id, value) VALUES ('client_id', '${crypto.randomUUID()}') ON CONFLICT (id) DO NOTHING;`,t+=`CREATE TABLE IF NOT EXISTS __crdt (id TEXT NOT NULL PRIMARY KEY, timestamp TEXT NOT NULL, client TEXT NOT NULL, object TEXT NOT NULL, item TEXT NOT NULL, updates TEXT);`,t},o=({db:e,schema:t})=>{let n=a(t);e.exec(n);let r=e.query(`SELECT value FROM __renku WHERE id = 'client_id' LIMIT 1`);if(!r[0])throw Error(`Client ID not found`);e.clientId=r[0].value},s=({client:e,object:t,item:n})=>{let{id:r,...i}=n;return{id:crypto.randomUUID(),timestamp:Date.now().toString(),client:e,object:t,item:r,updates:JSON.stringify(i)}};var c=class{#e=new Set;subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(e){console.log(`this.#subscriptions`,this.#e);for(let t of this.#e){if(t.filter&&!t.filter(e))continue;console.log(`✉️`,`Dispatching`,t.label);let n=t.subscriber(e);n instanceof Promise&&n.catch(e=>{console.error(`MessageQueue subscriber failed.`,e)})}}add(e){this.#t(e)}},l=class{#e;#t;#n;#r=e([]);#i;constructor({name:e,obj:t,clientId:n,messageQueue:r}){this.#e=n,this.#t=e,this.#n=t,this.#i=r,this.#i.subscribe({subscriber:e=>this.#a(e),filter:e=>e.object===this.#t,label:`Collection: ${this.#t}`})}mock(){return Object.entries(this.#n).reduce((e,[t,n])=>(e[t]=n.mock?n.mock():void 0,e),{})}#a(e){let t={id:e.item,...JSON.parse(e.updates)};this.#r.set(this.#r.get().concat(t))}get items(){return this.#r}query({filter:e,limit:n,first:r}={}){return t(()=>{let t=this.#r.get().filter(e||(()=>!0));return(n||r)&&(t=t.slice(0,r?1:n)),t})}first(e={}){return e.first=!0,t(()=>{let t=this.query(e).get();return t.length>0?t[0]:void 0})}all(){return this.query()}add(e){let t=s({client:this.#e,object:this.#t,item:e});return this.#i.add(t),e}loadItems(e){this.#r.set(e)}};const u=({schema:e,clientId:t,messageQueue:n})=>Object.entries(e).reduce((e,[r,i])=>{let a=r;return e[a]=new l({name:r,obj:i,clientId:t,messageQueue:n}),e},{}),d=e=>t=>{e.transaction(e=>{if(e.exec(`INSERT INTO __crdt (id, timestamp, client, object, item, updates) VALUES (?, ?, ?, ?, ?, ?);`,t.id,t.timestamp,t.client,t.object,t.item,t.updates),t.updates===`DELETE`)e.exec(`DELETE FROM obj_${t.object} WHERE id = ?;`,t.item);else{let n=[t.item],r=JSON.parse(t.updates),i=[`id`].concat(Object.keys(r));n.push(...Object.values(r));let a=`INSERT INTO obj_${t.object} (${i.join(`, `)}) VALUES (${n.map(()=>`?`).join(`, `)});`;e.exec(a,...n)}})};var f=class extends r{#e;constructor(e){super(),this.#e=e}get items(){return this.#e.items.get()}query(e={}){return this.#e.query(e).get()}first(e={}){return this.#e.first(e).get()}all(){return this.query()}add(e){this.#e.add(e)}};const p=e=>{let t=Object.entries(e).reduce((e,[t,n])=>{let r=t;return e[r]=new f(n),e},{});return console.log(`remoteCollections:`,t),t};var m=class extends r{#e;#t;#n;messageQueue=new c;#r;#i;constructor({schema:e,db:t}){super(),this.#e=e,t?(this.#n=t,this.#t=this.#n.clientId,this.messageQueue.subscribe({subscriber:d(this.#n),label:`Local database (Client ID: ${this.#t})`})):this.#t=crypto.randomUUID(),this.#r=u({schema:this.#e,clientId:this.#t,messageQueue:this.messageQueue}),this.#i=p(this.#r)}get _collections(){return this.#r}get _remoteCollections(){return this.#i}get _db(){return this.#n}get schema(){return this.#e}get clientId(){return this.#t}ingest(e){console.log(`📳📳📳`,`Ingest`,e),this.messageQueue.add(e)}async[Symbol.dispose](){console.log(`🗑️🗑️🗑️`,`Data RPC disposing (Client ID: ${this.clientId})`)}},h=class e extends m{#e;#t;constructor({schema:e,db:t,remote:n}){if(super({schema:e,db:t}),this.#e=n,this.#e){this.#e.connect({clientId:this.clientId,ingest:this.ingest.bind(this)}).then(e=>(this.#t=e,this.load())).catch(e=>{console.error(`Remote connect or load failed:`,e)});let e=this.messageQueue.subscribe({subscriber:async e=>{await this.#e?.ingest(e),console.log(`Send to remote`,e)},filter:e=>e.client===this.clientId,label:`Remote`});this.#e.onRpcBroken(()=>{console.log(`Remote connection broken, unsubscribing ...`),e()})}}static async client({schema:t,remote:n}){return typeof n==`function`&&(n=await n()),new e({schema:t,db:!1,remote:n})}static signal({schema:e,remote:t}){return n(()=>this.client({schema:e,remote:t}))}get collections(){return this._collections}async load(){if(!this.#e)return;let e=await this.#e.load();for(let t of Object.keys(e)){let n=t,r=e[n];this._collections[n].loadItems(r)}}async[Symbol.dispose](){console.log(`🗑️ Client Data RPC disposing (CID: ${this.clientId})`),this.#t&&await this.#t()}};const g=e=>{let t={exec:(t,...n)=>e.sql.exec(t,...n),query:(t,...n)=>e.sql.exec(t,...n).toArray(),transaction:n=>e.transactionSync(()=>n(t))};return t};var _=class e extends m{constructor({schema:e,db:t}){super({schema:e,db:t})}static durableObject({schema:t,storage:n}){let r=g(n);return o({db:r,schema:t}),new e({schema:t,db:r})}get collections(){return this._remoteCollections}load(){let e={};for(let t of Object.keys(this.schema)){let n=t;e[n]=this._db?.query(`SELECT * FROM obj_${t}`)??[]}return e}async connect({clientId:e,ingest:t}){console.log(`📳📳📳`,`connect from`,e,t),t.onRpcBroken(()=>{console.log(`📳📳📳`,e,`Ingest RPC broken`)});let n=t.dup();return console.log(`Subscribing client`,e),this.messageQueue.subscribe({subscriber:async e=>await n({...e,id:`${e.id}-CONNECT-${crypto.randomUUID()}`}),filter:t=>t.client!==e,label:`Client: ${e}`})}};const v=e=>e;function y(e,t,n){return e.type===`string`?typeof t==`string`?{value:t}:{issues:[{message:`Expected string for ${n}, got ${typeof t}`}]}:e.type===`number`?typeof t==`number`?{value:t}:{issues:[{message:`Expected number for ${n}, got ${typeof t}`}]}:e.type===`boolean`?typeof t==`boolean`?{value:t}:{issues:[{message:`Expected boolean for ${n}, got ${typeof t}`}]}:{issues:[{message:`Unknown property type for ${n}`}]}}function b(e,t){return n=>{if(typeof n!=`object`||!n||Array.isArray(n))return{issues:[{message:`Expected object for ${e}, got ${typeof n}`}]};let r=n,i=[];for(let[e,n]of Object.entries(t)){if(n.required&&!(e in r)){i.push({message:`Missing required field: ${e}`,path:[e]});continue}if(e in r){let t=y(n,r[e],e);if(t.issues)for(let n of t.issues)i.push({...n,path:[e,...n.path||[]]})}}return i.length>0?{issues:i}:{value:r}}}function x(e,t){return y(e,t,`property`)}function S(e){let t={};return t.type=e.type,t}function C(e){let t=t=>{if(t.target!==`draft-2020-12`&&t.target!==`draft-07`)throw Error(`Unsupported JSON Schema target: ${t.target}. Supported targets: draft-2020-12, draft-07`);let n={},r=[];for(let[t,i]of Object.entries(e))n[t]=S(i),i.required===!0&&r.push(t);let i={$schema:t.target===`draft-2020-12`?`https://json-schema.org/draft/2020-12/schema`:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:n,additionalProperties:!1};return r.length>0&&(i.required=r),i};return{input:t,output:t}}const w=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]={...r,"~standard":{version:1,vendor:`renku`,validate:b(n,r),jsonSchema:C(r),types:{input:void 0,output:void 0}}};return t},T={type:`string`,required:!0,unique:!0,mock:()=>crypto.randomUUID().toString()};export{h as ClientData,_ as ServerData,w as enhancedSchema,T as id,v as schema,x as validatePropertyValue};
|
package/dist/dom.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as RenkuNode, r as FunctionComponent } from "./types-
|
|
2
|
-
import { r as Routes } from "./types-
|
|
1
|
+
import { o as RenkuNode, r as FunctionComponent } from "./types-CkYeGxWb.js";
|
|
2
|
+
import { r as Routes } from "./types-DNwmCBRS.js";
|
|
3
3
|
|
|
4
4
|
//#region src/router/router.d.ts
|
|
5
5
|
declare const Router: FunctionComponent<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as LayoutComponent, r as FunctionComponent } from "./types-
|
|
2
|
-
import { r as Routes } from "./types-
|
|
3
|
-
import { a as RpcTarget, i as RpcStub, n as Loader, o as Signal, r as RpcCompatible, t as Context } from "./types-
|
|
4
|
-
import { t as registerServerFunction } from "./register-server-function-
|
|
1
|
+
import { a as LayoutComponent, r as FunctionComponent } from "./types-CkYeGxWb.js";
|
|
2
|
+
import { r as Routes } from "./types-DNwmCBRS.js";
|
|
3
|
+
import { a as RpcTarget, i as RpcStub, n as Loader, o as Signal, r as RpcCompatible, t as Context } from "./types-BOj-9dR5.js";
|
|
4
|
+
import { t as registerServerFunction } from "./register-server-function-J_wGw2NL.js";
|
|
5
5
|
|
|
6
6
|
//#region src/reactivity/create-computed.d.ts
|
|
7
7
|
declare const createComputed: <T>(fn: () => T) => Signal.Computed<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as JSX } from "./types-
|
|
2
|
-
import { t as Fragment } from "./fragment-
|
|
1
|
+
import { i as JSX } from "./types-CkYeGxWb.js";
|
|
2
|
+
import { t as Fragment } from "./fragment-CFpBSLG-.js";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx/jsx-dev.d.ts
|
|
5
5
|
declare const jsxDEV: (type: JSX.ElementType, props: any, key: string | null | undefined, _isStaticChildren: boolean, _source: {
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as JSX } from "./types-
|
|
2
|
-
import { t as Fragment } from "./fragment-
|
|
1
|
+
import { i as JSX } from "./types-CkYeGxWb.js";
|
|
2
|
+
import { t as Fragment } from "./fragment-CFpBSLG-.js";
|
|
3
3
|
|
|
4
4
|
//#region src/jsx/jsx.d.ts
|
|
5
5
|
declare const jsx: (type: JSX.ElementType, props: any, key: string | null | undefined) => JSX.Element;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ClientComponent } from "./types-
|
|
2
|
-
import { t as registerServerFunction } from "./register-server-function-
|
|
1
|
+
import { t as ClientComponent } from "./types-CkYeGxWb.js";
|
|
2
|
+
import { t as registerServerFunction } from "./register-server-function-J_wGw2NL.js";
|
|
3
3
|
|
|
4
4
|
//#region src/server/register-client-reference.d.ts
|
|
5
5
|
declare const registerClientReference: (_fn: () => void, path: string, name: string) => ClientComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as AuthFn } from "./types
|
|
2
|
-
import { r as FunctionComponent } from "./types-
|
|
1
|
+
import { n as AuthFn } from "./types--K8aCg53.js";
|
|
2
|
+
import { r as FunctionComponent } from "./types-CkYeGxWb.js";
|
|
3
3
|
|
|
4
4
|
//#region src/router/types.d.ts
|
|
5
5
|
type Path = `/${string}`;
|
package/dist/ui.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "renku",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Renku",
|
|
6
6
|
"homepage": "https://renku.dev",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/renkudev/renku/issues"
|
|
9
9
|
},
|
|
10
|
-
"
|
|
10
|
+
"license": "UNLICENSED",
|
|
11
11
|
"author": {
|
|
12
12
|
"name": "Benedikt Müller",
|
|
13
13
|
"email": "ben@renku.dev",
|
|
14
14
|
"url": "http://bndkt.com"
|
|
15
15
|
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/renkudev/renku.git"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"__renku_bash_complete": "dist/bash-complete.js",
|
|
22
|
+
"renku": "dist/cli.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"package.json",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
16
29
|
"type": "module",
|
|
17
30
|
"imports": {
|
|
18
31
|
"#renku/jsx-dev-runtime": "./src/jsx/jsx-dev-runtime.ts",
|
|
@@ -78,15 +91,6 @@
|
|
|
78
91
|
"import": "./dist/vite.js"
|
|
79
92
|
}
|
|
80
93
|
},
|
|
81
|
-
"bin": {
|
|
82
|
-
"__renku_bash_complete": "./dist/bash-complete.js",
|
|
83
|
-
"renku": "./dist/cli.js"
|
|
84
|
-
},
|
|
85
|
-
"files": [
|
|
86
|
-
"README.md",
|
|
87
|
-
"dist",
|
|
88
|
-
"package.json"
|
|
89
|
-
],
|
|
90
94
|
"scripts": {
|
|
91
95
|
"dev": "tsdown --watch",
|
|
92
96
|
"lint": "oxlint --type-aware",
|
|
@@ -103,10 +107,11 @@
|
|
|
103
107
|
"devDependencies": {
|
|
104
108
|
"@stricli/auto-complete": "1.2.4",
|
|
105
109
|
"@stricli/core": "1.2.4",
|
|
106
|
-
"@types/bun": "1.3.
|
|
107
|
-
"
|
|
110
|
+
"@types/bun": "1.3.5",
|
|
111
|
+
"@types/node": "25.0.3",
|
|
112
|
+
"tsdown": "0.18.2",
|
|
108
113
|
"typescript": "5.9.3",
|
|
109
|
-
"vite": "
|
|
110
|
-
"wrangler": "4.
|
|
114
|
+
"vite": "8.0.0-beta.4",
|
|
115
|
+
"wrangler": "4.56.0"
|
|
111
116
|
}
|
|
112
117
|
}
|
package/dist/context-BZxerv82.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import e from"node:fs";import t from"node:os";import n from"node:path";function r(e,t){let n=e.env?.[t];return typeof n==`string`&&n!==`0`}var i={UnknownCommand:-5,InvalidArgument:-4,ContextLoadError:-3,CommandLoadError:-2,InternalError:-1,Success:0,CommandRunError:1};function a(e){return e.replace(/-./g,e=>e[1].toUpperCase())}function o(e){return Array.from(e).map((e,t)=>{let n=e.toUpperCase(),r=e.toLowerCase();return t===0||n!==e||n===r?e:`-${r}`}).join(``)}function s(e){let t=new Map;return{get:(...n)=>t.get(n.join(`,`))??e,set:(e,...n)=>{t.set(n.join(`,`),e)}}}function c(e,t,n){let{threshold:r,weights:i}=n;if(e===t)return 0;let a=Math.abs(e.length-t.length);if(typeof r==`number`&&a>r)return 1/0;let o=s(1/0);o.set(0,-1,-1);for(let e=0;e<t.length;++e)o.set((e+1)*i.insertion,-1,e);for(let t=0;t<e.length;++t)o.set((t+1)*i.deletion,t,-1);let c=-1/0;for(let n=0;n<e.length;++n){let a=1/0;for(let r=0;r<=t.length-1;++r){let s=e[n]===t[r]?0:1,c=[o.get(n-1,r)+i.deletion,o.get(n,r-1)+i.insertion,o.get(n-1,r-1)+s*i.substitution];e[n]===t[r-1]&&e[n-1]===t[r]&&c.push(o.get(n-2,r-2)+s*i.transposition);let l=Math.min(...c);o.set(l,n,r),l<a&&(a=l)}if(a>r){if(c>r)return 1/0;c=a}else c=-1/0}let l=o.get(e.length-1,t.length-1);return l>r?1/0:l}function l(e,t,n){let r=e[1]-t[1];if(r!==0)return r;let i=e[0].startsWith(n),a=t[0].startsWith(n);return i&&!a?-1:!i&&a?1:e[0].localeCompare(t[0])}function u(e,t,n){let r=t.map(t=>[t,c(e,t,n)]).filter(([,e])=>e<=n.threshold),i=Math.min(...r.map(([,e])=>e));return r.filter(([,e])=>e===i).sort((t,n)=>l(t,n,e)).map(([e])=>e)}var d=class extends Error{};function f(e){return e instanceof Error?e.stack??String(e):String(e)}function p(e,t){let n=[],r=Math.max(e.length,t.length);for(let i=0;i<r;++i)n[i]=Math.max(e[i],t[i]);return n}function m(e,t){if(e.length===0)return[];let n=Array(Math.max(...e.map(e=>e.length))).fill(0,0),r=e.reduce((e,t)=>p(e,t.map(e=>e.length)),n);return e.map(e=>{let n=(e[0]??``).padEnd(r[0]);return e.slice(1).reduce((e,n,i,a)=>{let o=a.length===i+1?n:n.padEnd(r[i+1]);return[...e,t?.[i]??` `,o]},[n]).join(``).trimEnd()})}function h(e,t){if(e.length<=1)return e[0]??``;if(e.length===2)return e.join(` ${t.conjunction} `);let n=e.slice(0,e.length-1).join(`, `);return t.serialComma&&(n+=`,`),[n,t.conjunction,e[e.length-1]].join(` `)}function ee(e,t){return e.reduce((e,n)=>{let r=t(n),i=e[r]??[];return i.push(n),e[r]=i,e},{})}function te(e,t){return ee(e,e=>e[t])}async function g(e){let t=te(await Promise.allSettled(e),`status`);return t.rejected&&t.rejected.length>0?{status:`rejected`,reasons:t.rejected.map(e=>e.reason)}:{status:`fulfilled`,value:t.fulfilled?.map(e=>e.value)??[]}}var ne=new Set([`true`,`t`,`yes`,`y`,`on`,`1`]),re=new Set([`false`,`f`,`no`,`n`,`off`,`0`]),ie=e=>{let t=e.toLowerCase();if(ne.has(t))return!0;if(re.has(t))return!1;throw SyntaxError(`Cannot convert ${e} to a boolean`)},ae=e=>{let t=Number(e);if(Number.isNaN(t))throw SyntaxError(`Cannot convert ${e} to a number`);return t},_=class extends d{_brand};function oe(e,t){let n=t[e.constructor.name];return n?n(e):e.message}function se(e,t,n){return Object.fromEntries(Object.entries(t).map(([t,r])=>{let i=r,a=e[i];if(!a)throw new v(x(i,n),[],t);return[t,[i,a]]}))}var v=class extends _{input;corrections;aliasName;constructor(e,t,n){let r=`No flag registered for --${e}`;if(n)r+=` (aliased from -${n})`;else if(t.length>0){let e=h(t.map(e=>`--${e}`),{kind:`conjunctive`,conjunction:`or`,serialComma:!0});r+=`, did you mean ${e}?`}super(r),this.input=e,this.corrections=t,this.aliasName=n}},y=class extends _{input;constructor(e){super(`No alias registered for -${e}`),this.input=e}};function b(e,t){return e.placeholder?e.placeholder:typeof t==`number`?`arg${t}`:`args`}function x(e,t){return t===`allow-kebab-for-camel`?o(e):e}var S=class extends _{externalFlagNameOrPlaceholder;input;exception;constructor(e,t,n){super(`Failed to parse "${t}" for ${e}: ${n instanceof Error?n.message:String(n)}`),this.externalFlagNameOrPlaceholder=e,this.input=t,this.exception=n}};function C(e,t,n,r){try{return t.parse.call(r,n)}catch(t){throw new S(e,n,t)}}var w=class extends _{externalFlagName;input;values;constructor(e,t,n,r){let i=`Expected "${t}" to be one of (${n.join(`|`)})`;if(r.length>0){let e=h(r.map(e=>`"${e}"`),{kind:`conjunctive`,conjunction:`or`,serialComma:!0});i+=`, did you mean ${e}?`}super(i),this.externalFlagName=e,this.input=t,this.values=n}},T=class extends _{externalFlagName;nextFlagName;constructor(e,t){let n=`Expected input for flag --${e}`;t&&(n+=` but encountered --${t} instead`),super(n),this.externalFlagName=e,this.nextFlagName=t}},E=class extends _{expectedCount;input;constructor(e,t){super(`Too many arguments, expected ${e} but encountered "${t}"`),this.expectedCount=e,this.input=t}},D=class extends _{placeholder;limit;constructor(e,t){let n;t?(n=`Expected at least ${t[0]} argument(s) for ${e}`,t[1]===0?n+=` but found none`:n+=` but only found ${t[1]}`):n=`Expected argument for ${e}`,super(n),this.placeholder=e,this.limit=t}};function O(e){if(e.startsWith(`no`)&&e.length>2){if(e[2]===`-`)return e.slice(4);let t=e[2];return t===t.toUpperCase()?t.toLowerCase()+e.slice(3):void 0}}function k(e,t,n){let r=e,i=t[r];if(!i){let e=O(r);if(e&&(i=t[e],i&&i.kind==`boolean`))return{namedFlag:[e,i],negated:!0}}let s=a(e);if(n.caseStyle===`allow-kebab-for-camel`&&!i){if(i=t[s],i)return{namedFlag:[s,i]};let e=O(s);if(e&&(i=t[e],i&&i.kind==`boolean`))return{namedFlag:[e,i],negated:!0}}if(!i){if(s in t)throw new v(e,[s]);let i=o(e);throw i in t?new v(e,[i]):new v(e,u(r,Object.keys(t),n.distanceOptions))}return{namedFlag:[r,i]}}function A(e){return e.namedFlag[1].kind===`boolean`||e.namedFlag[1].kind===`counter`}var j=/^-([a-z]+)$/i,ce=/^--([a-z][a-z-.\d_]+)$/i;function le(e,t,n,r){let i=j.exec(e);if(i){let e=i[1];return Array.from(e).map(e=>{let t=e,r=n[t];if(!r)throw new y(t);return{namedFlag:r}})}let a=ce.exec(e);if(a){let e=a[1];return[k(e,t,r)]}return[]}var ue=/^--([a-z][a-z-.\d_]+)=(.+)$/i,de=/^-([a-z])=(.+)$/i,fe=class extends _{externalFlagName;valueText;constructor(e,t){super(`Cannot negate flag --${e} and pass "${t}" as value`),this.externalFlagName=e,this.valueText=t}};function pe(e,t,n,r){let i=ue.exec(e);if(i){let e=i[1],{namedFlag:n,negated:a}=k(e,t,r),o=i[2];if(a)throw new fe(e,o);return[n,o]}let a=de.exec(e);if(a){let e=a[1],t=n[e];if(!t)throw new y(e);return[t,a[2]]}}async function me(e,t,n,r,i){if(!n){if(`default`in t&&typeof t.default<`u`)return t.kind===`boolean`||t.kind===`enum`?t.default:C(e,t,t.default,i);if(t.optional)return;if(t.kind===`boolean`)return!1;if(t.kind===`counter`)return 0;throw new T(e)}if(t.kind===`counter`)return n.reduce((t,n)=>{try{return t+ae.call(i,n)}catch(t){throw new S(e,n,t)}},0);if(`variadic`in t&&t.variadic){if(t.kind===`enum`){for(let i of n)if(!t.values.includes(i)){let n=u(i,t.values,r.distanceOptions);throw new w(e,i,t.values,n)}return n}return Promise.all(n.map(n=>C(e,t,n,i)))}let a=n[0];if(t.kind===`boolean`)try{return ie.call(i,a)}catch(t){throw new S(e,a,t)}if(t.kind===`enum`){if(!t.values.includes(a)){let n=u(a,t.values,r.distanceOptions);throw new w(e,a,t.values,n)}return a}return C(e,t,a,i)}var he=class extends _{externalFlagName;previousInput;input;constructor(e,t,n){super(`Too many arguments for --${e}, encountered "${n}" after "${t}"`),this.externalFlagName=e,this.previousInput=t,this.input=n}};function M(e){return e.kind===`counter`?!0:`variadic`in e?!!e.variadic:!1}function N(e,t,[n,r],i){let a=e.get(n)??[];if(a.length>0&&!M(r))throw new he(x(n,t),a[0],i);if(`variadic`in r&&typeof r.variadic==`string`){let t=i.split(r.variadic);e.set(n,[...a,...t])}else e.set(n,[...a,i])}function P(e,t,n){if(t.get(n)){let t=e[n];return!M(t)}return!1}function F(e,t){let{flags:n={},aliases:r={},positional:i={kind:`tuple`,parameters:[]}}=e,a=se(n,r,t.caseStyle),s=[],c=new Map,l=0,u,f=!1;return{next:e=>{if(!f&&t.allowArgumentEscapeSequence&&e===`--`){if(u)if(u[1].kind===`parsed`&&u[1].inferEmpty)N(c,t.caseStyle,u,``),u=void 0;else throw new T(x(u[0],t.caseStyle));f=!0;return}if(!f){let r=pe(e,n,a,t);if(r){if(u)if(u[1].kind===`parsed`&&u[1].inferEmpty)N(c,t.caseStyle,u,``),u=void 0;else throw new T(x(u[0],t.caseStyle),x(r[0][0],t.caseStyle));N(c,t.caseStyle,...r);return}let i=le(e,n,a,t);if(i.length>0){if(u)if(u[1].kind===`parsed`&&u[1].inferEmpty)N(c,t.caseStyle,u,``),u=void 0;else throw new T(x(u[0],t.caseStyle),x(i[0].namedFlag[0],t.caseStyle));if(i.every(A))for(let e of i)e.namedFlag[1].kind===`boolean`?N(c,t.caseStyle,e.namedFlag,e.negated?`false`:`true`):N(c,t.caseStyle,e.namedFlag,`1`);else if(i.length>1)throw new T(x(i.find(e=>!A(e)).namedFlag[0],t.caseStyle));else u=i[0].namedFlag;return}}if(u)N(c,t.caseStyle,u,e),u=void 0;else{if(i.kind===`tuple`){if(l>=i.parameters.length)throw new E(i.parameters.length,e)}else if(typeof i.maximum==`number`&&l>=i.maximum)throw new E(i.maximum,e);s[l]=e,++l}},parseArguments:async e=>{let r=[],a;i.kind===`array`?(typeof i.minimum==`number`&&l<i.minimum&&r.push(new D(b(i.parameter),[i.minimum,l])),a=g(s.map(async(t,n)=>C(b(i.parameter,n+1),i.parameter,t,e)))):a=g(i.parameters.map(async(t,n)=>{let r=b(t,n+1),i=s[n];if(typeof i!=`string`){if(typeof t.default==`string`)return C(r,t,t.default,e);if(t.optional)return;throw new D(r)}return C(r,t,i,e)})),u&&u[1].kind===`parsed`&&u[1].inferEmpty&&(N(c,t.caseStyle,u,``),u=void 0);let o=g(Object.entries(n).map(async n=>{let[r,i]=n,a=x(r,t.caseStyle);if(u&&u[0]===r)throw new T(a);return[r,await me(a,i,c.get(r),t,e)]})),[f,p]=await Promise.all([a,o]);if(f.status===`rejected`)for(let e of f.reasons)r.push(e);if(p.status===`rejected`)for(let e of p.reasons)r.push(e);if(r.length>0)return{success:!1,errors:r};if(f.status===`rejected`)throw new d(`Unknown failure while scanning positional arguments`);if(p.status===`rejected`)throw new d(`Unknown failure while scanning flag arguments`);return{success:!0,arguments:[Object.fromEntries(p.value),...f.value]}},proposeCompletions:async({partial:e,completionConfig:s,text:d,context:p,includeVersionFlag:m})=>{if(u)return I(u[1],p,e);let h=[];if(!f){let i=j.exec(e);if(s.includeAliases){if(e===``||e===`-`){let e=Object.entries(r).filter(e=>!P(n,c,e[1]));for(let[t]of e){let e=a[t];e&&h.push({kind:`argument:flag`,completion:`-${t}`,brief:e[1].brief})}}else if(i){let o=Array.from(i[1]);if(o.includes(`h`)||m&&o.includes(`v`))return[];let s=new Map(c);for(let e of o){let n=a[e];if(!n)throw new y(e);N(s,t.caseStyle,n,n[1].kind===`boolean`?`true`:`1`)}let l=o[o.length-1];if(l){let t=a[l];t&&h.push({kind:`argument:flag`,completion:e,brief:t[1].brief})}let u=Object.entries(r).filter(e=>!P(n,s,e[1]));for(let[t]of u){let n=a[t];n&&h.push({kind:`argument:flag`,completion:`${e}${t}`,brief:n[1].brief})}}}if(e===``||e===`-`||e.startsWith(`--`)){t.allowArgumentEscapeSequence&&h.push({kind:`argument:flag`,completion:`--`,brief:d.briefs.argumentEscapeSequence});let r=Object.entries(n).filter(([e])=>!P(n,c,e));t.caseStyle===`allow-kebab-for-camel`&&(r=r.map(([e,t])=>[o(e),t]));let i=r.map(([e,t])=>[`--${e}`,t]).filter(([t])=>t.startsWith(e));h.push(...i.map(([e,t])=>({kind:`argument:flag`,completion:e,brief:t.brief})))}}if(i.kind===`array`){if(i.parameter.proposeCompletions&&(typeof i.maximum!=`number`||l<i.maximum)){let t=await i.parameter.proposeCompletions.call(p,e);h.push(...t.map(e=>({kind:`argument:value`,completion:e,brief:i.parameter.brief})))}}else{let t=i.parameters[l];if(t?.proposeCompletions){let n=await t.proposeCompletions.call(p,e);h.push(...n.map(e=>({kind:`argument:value`,completion:e,brief:t.brief})))}}return h.filter(({completion:t})=>t.startsWith(e))}}}async function I(e,t,n){if(typeof e.variadic==`string`&&n.endsWith(e.variadic))return I(e,t,``);let r;return r=e.kind===`enum`?e.values:e.proposeCompletions?await e.proposeCompletions.call(t,n):[],r.map(t=>({kind:`argument:value`,completion:t,brief:e.brief})).filter(({completion:e})=>e.startsWith(n))}function ge(e,t,n){let r=t===`allow-kebab-for-camel`?`convert-camel-to-kebab`:t,i=e.getAllEntries();return n.includeHiddenRoutes||(i=i.filter(e=>!e.hidden)),i.flatMap(e=>{let t=e.name[r];return n.includeAliases?[t,...e.aliases]:[t]})}var _e={headers:{usage:`USAGE`,aliases:`ALIASES`,commands:`COMMANDS`,flags:`FLAGS`,arguments:`ARGUMENTS`},keywords:{default:`default =`,separator:`separator =`},briefs:{help:`Print help information and exit`,helpAll:`Print help information (including hidden commands/flags) and exit`,version:`Print version information and exit`,argumentEscapeSequence:`All subsequent inputs should be interpreted as arguments`},noCommandRegisteredForInput:({input:e,corrections:t})=>{let n=`No command registered for \`${e}\``;return t.length>0?`${n}, did you mean ${h(t,{kind:`conjunctive`,conjunction:`or`,serialComma:!0})}?`:n},noTextAvailableForLocale:({requestedLocale:e,defaultLocale:t})=>`Application does not support "${e}" locale, defaulting to "${t}"`,exceptionWhileParsingArguments:e=>e instanceof _?oe(e,{}):`Unable to parse arguments, ${f(e)}`,exceptionWhileLoadingCommandFunction:e=>`Unable to load command function, ${f(e)}`,exceptionWhileLoadingCommandContext:e=>`Unable to load command context, ${f(e)}`,exceptionWhileRunningCommand:e=>`Command failed, ${f(e)}`,commandErrorResult:e=>e.message,currentVersionIsNotLatest:({currentVersion:e,latestVersion:t,upgradeCommand:n})=>n?`Latest available version is ${t} (currently running ${e}), upgrade with "${n}"`:`Latest available version is ${t} (currently running ${e})`};function ve(e){if(e.startsWith(`en`))return _e}function L(e,t,n){return!n.disableAnsiColor&&!r(e,`STRICLI_NO_COLOR`)&&(t.getColorDepth?.(e.env)??1)>=4}async function ye({loader:e,parameters:t},{context:n,inputs:r,scannerConfig:a,errorFormatting:o,documentationConfig:s,determineExitCode:c}){let l=e(),u;try{let e=F(t,a);for(let t of r)e.next(t);let c=await e.parseArguments(n);if(c.success)u=c.arguments;else{let e=L(n.process,n.process.stderr,s);for(let t of c.errors){let r=o.exceptionWhileParsingArguments(t,e);n.process.stderr.write(e?`\x1B[1m\x1B[31m${r}\x1B[39m\x1B[22m
|
|
2
|
-
`:`${r}
|
|
3
|
-
`)}return i.InvalidArgument}}catch(e){let t=L(n.process,n.process.stderr,s),r=o.exceptionWhileParsingArguments(e,t);return n.process.stderr.write(t?`\x1B[1m\x1B[31m${r}\x1B[39m\x1B[22m
|
|
4
|
-
`:`${r}
|
|
5
|
-
`),i.InvalidArgument}let d;try{let e=await l;d=typeof e==`function`?e:e.default}catch(e){let t=L(n.process,n.process.stderr,s),r=o.exceptionWhileLoadingCommandFunction(e,t);return n.process.stderr.write(t?`\x1B[1m\x1B[31m${r}\x1B[39m\x1B[22m
|
|
6
|
-
`:`${r}
|
|
7
|
-
`),i.CommandLoadError}try{let e=await d.call(n,...u);if(e instanceof Error){let t=L(n.process,n.process.stderr,s),r=o.commandErrorResult(e,t);return n.process.stderr.write(t?`\x1B[1m\x1B[31m${r}\x1B[39m\x1B[22m
|
|
8
|
-
`:`${r}
|
|
9
|
-
`),c?c(e):i.CommandRunError}}catch(e){let t=L(n.process,n.process.stderr,s),r=o.exceptionWhileRunningCommand(e,t);return n.process.stderr.write(t?`\x1B[1m\x1B[31m${r}\x1B[39m\x1B[22m
|
|
10
|
-
`:`${r}
|
|
11
|
-
`),c?c(e):i.CommandRunError}return i.Success}var R=Symbol(`RouteMap`),z=Symbol(`Command`);function B(e,t,n){let r=[...n],i=[],o,s=e,c,l=!0,u=!1;return{next:e=>{if(e===`--help`||e===`-h`){u=!0,c||=s;return}else if(e===`--helpAll`||e===`--help-all`||e===`-H`){u=`all`,c||=s;return}if(c){i.push(e);return}if(s.kind===z){c=s,i.push(e);return}let n=a(e),d=e,f=s.getRoutingTargetForInput(d);if(t.caseStyle===`allow-kebab-for-camel`&&!f&&(f=s.getRoutingTargetForInput(n),f&&(d=n)),!f){let t=s.getDefaultCommand();if(t){l=!1,o=[s,``],i.push(e),s=t;return}return{input:e,routeMap:s}}l=!1,o=[s,e],s=f,r.push(e)},finish:()=>{if(c??=s,c.kind===R&&!u){let e=c.getDefaultCommand();e&&(o=[c,``],c=e,l=!1)}let e=o?o[0].getOtherAliasesForInput(o[1],t.caseStyle):{original:[],"convert-camel-to-kebab":[]};return{target:c,unprocessedInputs:i,helpRequested:u,prefix:r,rootLevel:l,aliases:e}}}}async function be({root:e,defaultText:t,config:n},a,o){let s=t;if(o.locale){let e=n.localization.loadText(o.locale);if(e)s=e;else{let e=L(o.process,o.process.stderr,n.documentation),t=s.noTextAvailableForLocale({requestedLocale:o.locale,defaultLocale:n.localization.defaultLocale,ansiColor:e});o.process.stderr.write(e?`\x1B[1m\x1B[33m${t}\x1B[39m\x1B[22m
|
|
12
|
-
`:`${t}
|
|
13
|
-
`)}}if(n.versionInfo?.getLatestVersion&&!r(o.process,`STRICLI_SKIP_VERSION_CHECK`)){let e;e=`currentVersion`in n.versionInfo?n.versionInfo.currentVersion:await n.versionInfo.getCurrentVersion.call(o);let t=await n.versionInfo.getLatestVersion.call(o,e);if(t&&e!==t){let r=L(o.process,o.process.stderr,n.documentation),i=s.currentVersionIsNotLatest({currentVersion:e,latestVersion:t,upgradeCommand:n.versionInfo.upgradeCommand,ansiColor:r});o.process.stderr.write(r?`\x1B[1m\x1B[33m${i}\x1B[39m\x1B[22m
|
|
14
|
-
`:`${i}
|
|
15
|
-
`)}}let c=a.slice();if(n.versionInfo&&(c[0]===`--version`||c[0]===`-v`)){let e;return e=`currentVersion`in n.versionInfo?n.versionInfo.currentVersion:await n.versionInfo.getCurrentVersion.call(o),o.process.stdout.write(e+`
|
|
16
|
-
`),i.Success}let l=B(e,n.scanner,[n.name]),d;for(;c.length>0&&!d;){let e=c.shift();d=l.next(e)}if(d){let e=ge(d.routeMap,n.scanner.caseStyle,n.completion),t=u(d.input,e,n.scanner.distanceOptions).map(e=>`\`${e}\``),r=L(o.process,o.process.stderr,n.documentation),a=s.noCommandRegisteredForInput({input:d.input,corrections:t,ansiColor:r});return o.process.stderr.write(r?`\x1B[1m\x1B[31m${a}\x1B[39m\x1B[22m
|
|
17
|
-
`:`${a}
|
|
18
|
-
`),i.UnknownCommand}let f=l.finish();if(f.helpRequested||f.target.kind===R){let e=L(o.process,o.process.stdout,n.documentation);return o.process.stdout.write(f.target.formatHelp({prefix:f.prefix,includeVersionFlag:!!n.versionInfo&&f.rootLevel,includeArgumentEscapeSequenceFlag:n.scanner.allowArgumentEscapeSequence,includeHelpAllFlag:f.helpRequested===`all`||n.documentation.alwaysShowHelpAllFlag,includeHidden:f.helpRequested===`all`,config:n.documentation,aliases:f.aliases[n.documentation.caseStyle],text:s,ansiColor:e})),i.Success}let p;if(`forCommand`in o)try{p=await o.forCommand({prefix:f.prefix})}catch(e){let t=L(o.process,o.process.stderr,n.documentation),r=s.exceptionWhileLoadingCommandContext(e,t);return o.process.stderr.write(t?`\x1B[1m\x1B[31m${r}\x1B[39m\x1B[22m`:r),i.ContextLoadError}else p=o;return ye(f.target,{context:p,inputs:f.unprocessedInputs,scannerConfig:n.scanner,documentationConfig:n.documentation,errorFormatting:s,determineExitCode:n.determineExitCode})}function V(e,t){return t===`convert-camel-to-kebab`?o(e):e}function xe(e,t){return t===`convert-camel-to-kebab`?`no-${o(e)}`:`no${e[0].toUpperCase()}${e.slice(1)}`}function Se(e){let t=e.scanner?.caseStyle??`original`,n;if(e.documentation?.caseStyle){if(t===`original`&&e.documentation.caseStyle===`convert-camel-to-kebab`)throw new d(`Cannot convert route and flag names on display but scan as original`);n=e.documentation.caseStyle}else n=t===`allow-kebab-for-camel`?`convert-camel-to-kebab`:t;let r={caseStyle:t,allowArgumentEscapeSequence:e.scanner?.allowArgumentEscapeSequence??!1,distanceOptions:e.scanner?.distanceOptions??{threshold:7,weights:{insertion:1,deletion:3,substitution:2,transposition:0}}},i={alwaysShowHelpAllFlag:e.documentation?.alwaysShowHelpAllFlag??!1,useAliasInUsageLine:e.documentation?.useAliasInUsageLine??!1,onlyRequiredInUsageLine:e.documentation?.onlyRequiredInUsageLine??!1,caseStyle:n,disableAnsiColor:e.documentation?.disableAnsiColor??!1},a={includeAliases:e.completion?.includeAliases??i.useAliasInUsageLine,includeHiddenRoutes:e.completion?.includeHiddenRoutes??!1,...e.completion};return{...e,scanner:r,completion:a,documentation:i,localization:{defaultLocale:`en`,loadText:ve,...e.localization}}}function Ce(e,t){let n=Se(t);if(e.kind===z&&n.versionInfo){if(e.usesFlag(`version`))throw new d(`Unable to use command with flag --version as root when version info is supplied`);if(e.usesFlag(`v`))throw new d(`Unable to use command with alias -v as root when version info is supplied`)}let r=n.localization.loadText(n.localization.defaultLocale);if(!r)throw new d(`No text available for the default locale "${n.localization.defaultLocale}"`);return{root:e,config:n,defaultText:r}}async function we({parameters:e},t){try{let n=F(e,t.scannerConfig);for(let e of t.inputs)n.next(e);return await n.proposeCompletions(t)}catch{return[]}}async function Te(e,{partial:t,scannerConfig:n,completionConfig:r}){let i=e.getAllEntries();r.includeHiddenRoutes||(i=i.filter(e=>!e.hidden));let a=n.caseStyle===`allow-kebab-for-camel`?`convert-camel-to-kebab`:n.caseStyle;return i.flatMap(e=>{let t=e.target.kind===z?`routing-target:command`:`routing-target:route-map`,n=e.target.brief,i={kind:t,completion:e.name[a],brief:n};return r.includeAliases?[i,...e.aliases.map(e=>({kind:t,completion:e,brief:n}))]:[i]}).filter(({completion:e})=>e.startsWith(t))}async function Ee({root:e,config:t,defaultText:n},r,i){if(r.length===0)return[];let a=B(e,t.scanner,[]),o=r.slice(0,-1),s;for(;o.length>0&&!s;){let e=o.shift();s=a.next(e)}if(s)return[];let c=a.finish();if(c.helpRequested)return[];let l;if(`forCommand`in i)try{l=await i.forCommand({prefix:c.prefix})}catch{return[]}else l=i;let u=r[r.length-1];return c.target.kind===R?Te(c.target,{context:l,partial:u,scannerConfig:t.scanner,completionConfig:t.completion}):we(c.target,{context:l,inputs:c.unprocessedInputs,partial:u,scannerConfig:t.scanner,completionConfig:t.completion,text:n,includeVersionFlag:!!t.versionInfo&&c.rootLevel})}function H(e){return`default`in e&&typeof e.default<`u`}function U(e){return e.optional??H(e)}function W(e){return`(${e})`}function G(e){return`[${e}]`}function K(e){return`${e}...`}function De(e){return`<${e}>`}function Oe(e){return`[<${e}>]`}function ke(e){return`<${e}>...`}function q(e,t){let n=Object.entries(e.flags??{}).filter(([,e])=>!(e.hidden||t.config.onlyRequiredInUsageLine&&U(e))).map(([n,r])=>{let i=t.config.caseStyle===`convert-camel-to-kebab`?`--${o(n)}`:`--${n}`;if(e.aliases&&t.config.useAliasInUsageLine){let t=Object.entries(e.aliases).filter(e=>e[1]===n);t.length===1&&t[0]&&(i=`-${t[0][0]}`)}if(r.kind===`boolean`)return[r,i];if(r.kind===`enum`&&typeof r.placeholder!=`string`)return[r,`${i} ${r.values.join(`|`)}`];let a=r.placeholder??`value`;return[r,`${i} ${a}`]}).map(([e,t])=>e.kind===`parsed`&&e.variadic?U(e)?K(G(t)):K(W(t)):U(e)?G(t):W(t)),r=[],i=e.positional;if(i)if(i.kind===`array`)r=[ke(i.parameter.placeholder??`args`)];else{let e=i.parameters;t.config.onlyRequiredInUsageLine&&(e=e.filter(e=>!e.optional&&typeof e.default>`u`)),r=e.map((e,t)=>{let n=e.placeholder??`arg${t+1}`;return e.optional||typeof e.default<`u`?Oe(n):De(n)})}return[...t.prefix,...n,...r].join(` `)}function J(e,t,n){let{keywords:r,briefs:i}=n.text,a=Object.entries(e).filter(([,e])=>!(e.hidden&&!n.includeHidden)),o=a.some(([,e])=>U(e)),s=a.map(([e,i])=>{let a=Object.entries(t).filter(t=>t[1]===e).map(([e])=>`-${e}`),s=`--`+V(e,n.config.caseStyle);if(i.kind===`boolean`&&i.default!==!1){let t=xe(e,n.config.caseStyle);s=`${s}/--${t}`}U(i)?s=`[${s}]`:o&&(s=` ${s}`),i.kind===`parsed`&&i.variadic&&(s=`${s}...`);let c=[];if(i.kind===`enum`){let e=i.values.join(`|`);c.push(e)}if(H(i)){let e=n.ansiColor?`\x1B[90m${r.default}\x1B[39m`:r.default;c.push(`${e} ${i.default===``?`""`:String(i.default)}`)}if(`variadic`in i&&typeof i.variadic==`string`){let e=n.ansiColor?`\x1B[90m${r.separator}\x1B[39m`:r.separator;c.push(`${e} ${i.variadic}`)}let l=c.length>0?`[${c.join(`, `)}]`:void 0;return{aliases:a.join(` `),flagName:s,brief:i.brief,suffix:l,hidden:i.hidden}});if(s.push({aliases:`-h`,flagName:o?` --help`:`--help`,brief:i.help}),n.includeHelpAllFlag){let e=V(`helpAll`,n.config.caseStyle);s.push({aliases:`-H`,flagName:o?` --${e}`:`--${e}`,brief:i.helpAll,hidden:!n.config.alwaysShowHelpAllFlag})}return n.includeVersionFlag&&s.push({aliases:`-v`,flagName:o?` --version`:`--version`,brief:i.version}),n.includeArgumentEscapeSequenceFlag&&s.push({aliases:``,flagName:o?` --`:`--`,brief:i.argumentEscapeSequence}),m(s.map(e=>n.ansiColor?[e.hidden?`\x1B[90m${e.aliases}\x1B[39m`:`\x1B[97m${e.aliases}\x1B[39m`,e.hidden?`\x1B[90m${e.flagName}\x1B[39m`:`\x1B[97m${e.flagName}\x1B[39m`,e.hidden?`\x1B[90m${e.brief}\x1B[39m`:`\x1B[03m${e.brief}\x1B[23m`,e.suffix??``]:[e.aliases,e.flagName,e.brief,e.suffix??``]),[` `,` `,` `])}function*Y(e){if(yield e.config.useAliasInUsageLine?`-h`:`--help`,e.includeHelpAllFlag){let t=V(`helpAll`,e.config.caseStyle);yield e.config.useAliasInUsageLine?`-H`:`--${t}`}e.includeVersionFlag&&(yield e.config.useAliasInUsageLine?`-v`:`--version`)}function Ae(e,t){if(e.kind===`array`){let n=e.parameter.placeholder??`args`;return m([[t.ansiColor?`\x1B[97m${n}...\x1B[39m`:`${n}...`,t.ansiColor?`\x1B[3m${e.parameter.brief}\x1B[23m`:e.parameter.brief]],[` `])}let{keywords:n}=t.text,r=e.parameters.some(e=>e.optional);return m(e.parameters.map((e,i)=>{let a=e.placeholder??`arg${i+1}`,o;return e.optional?a=`[${a}]`:r&&(a=` ${a}`),e.default&&(o=`[${t.ansiColor?`\x1B[90m${n.default}\x1B[39m`:n.default} ${e.default}]`),[t.ansiColor?`\x1B[97m${a}\x1B[39m`:a,t.ansiColor?`\x1B[3m${e.brief}\x1B[23m`:e.brief,o??``]}),[` `,` `])}function*je(e,t,n){let{brief:r,fullDescription:i,customUsage:a}=t,{headers:o}=n.text,s=n.prefix.join(` `);if(yield n.ansiColor?`\x1B[1m${o.usage}\x1B[22m`:o.usage,a)for(let e of a)if(typeof e==`string`)yield` ${s} ${e}`;else{let t=n.ansiColor?`\x1B[3m${e.brief}\x1B[23m`:e.brief;yield` ${s} ${e.input}
|
|
19
|
-
${t}`}else yield` ${q(e,n)}`;for(let e of Y(n))yield` ${s} ${e}`;if(yield``,yield i??r,n.aliases&&n.aliases.length>0){let e=n.prefix.slice(0,-1).join(` `);yield``,yield n.ansiColor?`\x1B[1m${o.aliases}\x1B[22m`:o.aliases;for(let t of n.aliases)yield` ${e} ${t}`}yield``,yield n.ansiColor?`\x1B[1m${o.flags}\x1B[22m`:o.flags;for(let t of J(e.flags??{},e.aliases??{},n))yield` ${t}`;let c=e.positional??{kind:`tuple`,parameters:[]};if(c.kind===`array`||c.parameters.length>0){yield``,yield n.ansiColor?`\x1B[1m${o.arguments}\x1B[22m`:o.arguments;for(let e of Ae(c,n))yield` ${e}`}}function Me(e,t){for(let n of t)if(n in e)throw new d(`Unable to use reserved flag --${n}`)}function Ne(e,t){for(let n of t)if(n in e)throw new d(`Unable to use reserved alias -${n}`)}function*Pe(e){yield`no-${o(e)}`,yield`no${e[0].toUpperCase()}${e.slice(1)}`}function Fe(e){let t=Object.entries(e).filter(([,e])=>e.kind===`boolean`&&!e.optional);for(let[n]of t)for(let t of Pe(n))if(t in e)throw new d(`Unable to allow negation for --${n} as it conflicts with --${t}`)}function Ie(e){for(let[t,n]of Object.entries(e))if(`variadic`in n&&typeof n.variadic==`string`){if(n.variadic.length<1)throw new d(`Unable to use "" as variadic separator for --${t} as it is empty`);if(/\s/.test(n.variadic))throw new d(`Unable to use "${n.variadic}" as variadic separator for --${t} as it contains whitespace`)}}function X(e){let{flags:t={},aliases:n={}}=e.parameters;Me(t,[`help`,`helpAll`,`help-all`]),Ne(n,[`h`,`H`]),Fe(t),Ie(t);let r;return r=`func`in e?async()=>e.func:e.loader,{kind:z,loader:r,parameters:e.parameters,get brief(){return e.docs.brief},formatUsageLine:t=>q(e.parameters,t),formatHelp:t=>[...je(e.parameters,e.docs,t)].join(`
|
|
20
|
-
`)+`
|
|
21
|
-
`,usesFlag:e=>e in t||e in n}}function*Le(e,t,n){let{brief:r,fullDescription:i,hideRoute:a}=t,{headers:s}=n.text;yield n.ansiColor?`\x1B[1m${s.usage}\x1B[22m`:s.usage;for(let[t,r]of Object.entries(e))if(!a||!a[t]||n.includeHidden){let e=n.config.caseStyle===`convert-camel-to-kebab`?o(t):t;yield` ${r.formatUsageLine({...n,prefix:[...n.prefix,e]})}`}let c=n.prefix.join(` `);for(let e of Y(n))yield` ${c} ${e}`;if(yield``,yield i??r,n.aliases&&n.aliases.length>0){let e=n.prefix.slice(0,-1).join(` `);yield``,yield n.ansiColor?`\x1B[1m${s.aliases}\x1B[22m`:s.aliases;for(let t of n.aliases)yield` ${e} ${t}`}yield``,yield n.ansiColor?`\x1B[1m${s.flags}\x1B[22m`:s.flags;for(let e of J({},{},n))yield` ${e}`;yield``,yield n.ansiColor?`\x1B[1m${s.commands}\x1B[22m`:s.commands;let l=m(Object.entries(e).filter(([e])=>!a||!a[e]||n.includeHidden).map(([e,t])=>({routeName:V(e,n.config.caseStyle),brief:t.brief,hidden:a&&a[e]})).map(e=>n.ansiColor?[e.hidden?`\x1B[90m${e.routeName}\x1B[39m`:`\x1B[97m${e.routeName}\x1B[39m`,e.hidden?`\x1B[90m${e.brief}\x1B[39m`:`\x1B[03m${e.brief}\x1B[23m`]:[e.routeName,e.brief]),[` `]);for(let e of l)yield` ${e}`}function Z({routes:e,defaultCommand:t,docs:n,aliases:r}){if(Object.entries(e).length===0)throw new d(`Route map must contain at least one route`);let i=r??{},s=new Map;for(let[t,n]of Object.entries(i)){if(t in e)throw new d(`Cannot use "${t}" as an alias when a route with that name already exists`);let r=s.get(n)??[];s.set(n,[...r,t])}let c=t?e[t]:void 0;if(c&&c.kind===R)throw new d(`Cannot use "${t}" as the default command because it is not a Command`);let l=t=>{if(t in i)return i[t];if(t in e)return t};return{kind:R,get brief(){return n.brief},formatUsageLine(e){let t=this.getAllEntries().filter(e=>!e.hidden).map(t=>t.name[e.config.caseStyle]);return`${e.prefix.join(` `)} ${t.join(`|`)} ...`},formatHelp:t=>[...Le(e,n,t)].join(`
|
|
22
|
-
`)+`
|
|
23
|
-
`,getDefaultCommand:()=>c,getOtherAliasesForInput:(e,n)=>{if(t){if(e===t)return{original:[``],"convert-camel-to-kebab":[``]};if(e===``)return{original:[t],"convert-camel-to-kebab":[t]}}let r=a(e),i=l(e);if(!i&&n===`allow-kebab-for-camel`&&(i=l(r)),!i)return{original:[],"convert-camel-to-kebab":[]};let c=[i,...s.get(i)??[]].filter(t=>t!==e&&t!==r);return{original:c,"convert-camel-to-kebab":c.map(o)}},getRoutingTargetForInput:t=>e[t in i?i[t]:t],getAllEntries(){let t=n.hideRoute;return Object.entries(e).map(([e,n])=>({name:{original:e,"convert-camel-to-kebab":o(e)},target:n,aliases:s.get(e)??[],hidden:t?.[e]??!1}))}}}async function Re(e,t,n){let r=await be(e,t,n);n.process.exitCode=r}function Q(e,t){if(e.length<=1)return e[0]??``;if(e.length===2)return e.join(` ${t.conjunction} `);let n=e.slice(0,e.length-1).join(`, `);return t.serialComma&&(n+=`,`),[n,t.conjunction,e[e.length-1]].join(` `)}var $={parse:String,brief:`Target command run by user`,placeholder:`targetCommand`};X({loader:async()=>{let{install:e}=await import(`./impl-CQ7GTRH2-Db6HOvCd.js`);return e},parameters:{flags:{bash:{kind:`parsed`,brief:`Command executed by bash to generate completion proposals`,parse:String,optional:!0,placeholder:`command`}},positional:{kind:`tuple`,parameters:[$]}},docs:{brief:`Installs autocomplete support for target command on all provided shell types`}});function ze(e,t){return X({loader:async()=>{let{install:n}=await import(`./impl-CQ7GTRH2-Db6HOvCd.js`);return function(){return n.call(this,t,e)}},parameters:{},docs:{brief:`Installs ${Q(Object.keys(t),{conjunction:`and`,serialComma:!0})} autocomplete support for ${e}`}})}X({loader:async()=>{let{uninstall:e}=await import(`./impl-CQ7GTRH2-Db6HOvCd.js`);return e},parameters:{flags:{bash:{kind:`boolean`,brief:`Uninstall autocompletion for bash`,optional:!0}},positional:{kind:`tuple`,parameters:[$]}},docs:{brief:`Uninstalls autocomplete support for target command on all selected shell types`}});function Be(e,t){return X({loader:async()=>{let{uninstall:n}=await import(`./impl-CQ7GTRH2-Db6HOvCd.js`);return function(){return n.call(this,t,e)}},parameters:{},docs:{brief:`Uninstalls ${Q(Object.entries(t).filter(([,e])=>e).map(([e])=>e),{conjunction:`and`,serialComma:!0})} autocomplete support for ${e}`}})}var Ve=`renku`,He=`0.0.6`,Ue=`Renku`;const We=Z({routes:{ios:X({loader:async()=>{let{ios:e}=await import(`./impl-6Uc2Rt9O.js`);return e},parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Nested ios command`}}),android:X({loader:async()=>{let{android:e}=await import(`./impl-6Uc2Rt9O.js`);return e},parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Nested android command`}})},docs:{brief:`Native app generation`}}),Ge=Z({routes:{foo:X({loader:async()=>{let{foo:e}=await import(`./impl-qmFhldR7.js`);return e},parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Nested foo command`}}),bar:X({loader:async()=>{let{bar:e}=await import(`./impl-qmFhldR7.js`);return e},parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Nested bar command`}})},docs:{brief:`Nested commands`}}),Ke=Ce(Z({routes:{subdir:X({loader:async()=>import(`./impl-D9kbwKWf.js`),parameters:{positional:{kind:`tuple`,parameters:[]},flags:{foo:{kind:`parsed`,optional:!0,parse:String,brief:`Foo`}}},docs:{brief:`Command in subdirectory`}}),nested:Ge,native:We,install:ze(`my-app`,{bash:`__my-app_bash_complete`}),uninstall:Be(`my-app`,{bash:!0})},docs:{brief:Ue,hideRoute:{install:!0,uninstall:!0}}}),{name:Ve,versionInfo:{currentVersion:He}});function qe(r){return{process:r,os:t,fs:e,path:n}}export{Ee as i,Ke as n,Re as r,qe as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import e from"node:fs";import t from"node:os";import n from"node:path";function r(e){return`# @stricli/auto-complete START [${e}]`}var i=`# @stricli/auto-complete END`;async function a(a){let{os:o=t,fs:s=e,path:c=n}=a;if(!a.process.env.SHELL?.includes(`bash`)){a.process.stderr.write(`Skipping bash as shell was not detected.
|
|
2
|
-
`);return}let l=o.homedir(),u=c.join(l,`.bashrc`),d;try{d=(await s.promises.readFile(u)).toString().split(/\n/)}catch{a.process.stderr.write(`Expected to edit ~/.bashrc but file was not found.
|
|
3
|
-
`);return}return{install:async(e,t)=>{let n=r(e),o=d.indexOf(n),c=`__${e}_complete`,l=[n,`${c}() { export COMP_LINE; COMPREPLY=( $(${t} $COMP_LINE) ); return 0; }`,`complete -o default -o nospace -F ${c} ${e}`,i];if(o>=0){let e=d.indexOf(i,o);d.splice(o,e-o+1,...l)}else d.push(...l);await s.promises.writeFile(u,d.join(`
|
|
4
|
-
`)),a.process.stdout.write("Restart bash shell or run `source ~/.bashrc` to load changes.\n")},uninstall:async e=>{let t=r(e),n=d.indexOf(t);if(n>=0){let e=d.indexOf(i,n);d.splice(n,e-n+1)}await s.promises.writeFile(u,d.join(`
|
|
5
|
-
`)),a.process.stdout.write("Restart bash shell or run `source ~/.bashrc` to load changes.\n")}}}async function o(e,t){e.bash&&await(await a(this))?.install(t,e.bash)}async function s(e,t){e.bash&&await(await a(this))?.uninstall(t)}export{o as install,s as uninstall};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{register-server-function-CqA4nPaJ.d.ts → register-server-function-J_wGw2NL.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|