veryfront 0.1.13 → 0.1.15
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/esm/cli/app/data/slug-words.d.ts.map +1 -1
- package/esm/cli/app/data/slug-words.js +225 -90
- package/esm/cli/app/operations/project-creation.js +4 -3
- package/esm/cli/app/shell.js +1 -1
- package/esm/cli/app/utils.d.ts +5 -4
- package/esm/cli/app/utils.d.ts.map +1 -1
- package/esm/cli/app/utils.js +0 -23
- package/esm/cli/app/views/dashboard.d.ts +1 -1
- package/esm/cli/app/views/dashboard.d.ts.map +1 -1
- package/esm/cli/app/views/dashboard.js +22 -4
- package/esm/cli/auth/callback-server.d.ts.map +1 -1
- package/esm/cli/auth/callback-server.js +3 -2
- package/esm/cli/commands/dev/handler.d.ts.map +1 -1
- package/esm/cli/commands/dev/handler.js +2 -0
- package/esm/cli/commands/init/init-command.d.ts.map +1 -1
- package/esm/cli/commands/init/init-command.js +20 -3
- package/esm/cli/commands/init/interactive-wizard.d.ts +3 -2
- package/esm/cli/commands/init/interactive-wizard.d.ts.map +1 -1
- package/esm/cli/commands/init/interactive-wizard.js +55 -27
- package/esm/cli/mcp/remote-file-tools.d.ts +0 -6
- package/esm/cli/mcp/remote-file-tools.d.ts.map +1 -1
- package/esm/cli/mcp/remote-file-tools.js +37 -15
- package/esm/cli/shared/reserve-slug.d.ts.map +1 -1
- package/esm/cli/shared/reserve-slug.js +8 -3
- package/esm/cli/utils/env-prompt.d.ts.map +1 -1
- package/esm/cli/utils/env-prompt.js +3 -0
- package/esm/deno.d.ts +5 -1
- package/esm/deno.js +11 -4
- package/esm/src/agent/chat-handler.d.ts +4 -3
- package/esm/src/agent/chat-handler.d.ts.map +1 -1
- package/esm/src/agent/chat-handler.js +55 -4
- package/esm/src/agent/react/index.d.ts +1 -1
- package/esm/src/agent/react/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts +18 -0
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts.map +1 -0
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.js +54 -0
- package/esm/src/agent/react/use-chat/browser-inference/types.d.ts +43 -0
- package/esm/src/agent/react/use-chat/browser-inference/types.d.ts.map +1 -0
- package/esm/src/agent/react/use-chat/browser-inference/types.js +4 -0
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts +23 -0
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts.map +1 -0
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.js +67 -0
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.d.ts +8 -0
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.d.ts.map +1 -0
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.js +97 -0
- package/esm/src/agent/react/use-chat/index.d.ts +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +12 -0
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +120 -6
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +59 -7
- package/esm/src/build/production-build/templates.d.ts +2 -2
- package/esm/src/build/production-build/templates.d.ts.map +1 -1
- package/esm/src/build/production-build/templates.js +2 -68
- package/esm/src/chat/index.d.ts +1 -1
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/errors/veryfront-error.d.ts +3 -0
- package/esm/src/errors/veryfront-error.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/deno/adapter.d.ts.map +1 -1
- package/esm/src/platform/adapters/runtime/deno/adapter.js +24 -3
- package/esm/src/platform/compat/http/deno-server.d.ts.map +1 -1
- package/esm/src/platform/compat/http/deno-server.js +23 -2
- package/esm/src/provider/index.d.ts +1 -1
- package/esm/src/provider/index.d.ts.map +1 -1
- package/esm/src/provider/index.js +1 -1
- package/esm/src/provider/local/ai-sdk-adapter.d.ts +19 -0
- package/esm/src/provider/local/ai-sdk-adapter.d.ts.map +1 -0
- package/esm/src/provider/local/ai-sdk-adapter.js +164 -0
- package/esm/src/provider/local/env.d.ts +10 -0
- package/esm/src/provider/local/env.d.ts.map +1 -0
- package/esm/src/provider/local/env.js +23 -0
- package/esm/src/provider/local/local-engine.d.ts +61 -0
- package/esm/src/provider/local/local-engine.d.ts.map +1 -0
- package/esm/src/provider/local/local-engine.js +211 -0
- package/esm/src/provider/local/model-catalog.d.ts +30 -0
- package/esm/src/provider/local/model-catalog.d.ts.map +1 -0
- package/esm/src/provider/local/model-catalog.js +58 -0
- package/esm/src/provider/model-registry.d.ts +14 -0
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +58 -2
- package/esm/src/proxy/main.js +34 -6
- package/esm/src/proxy/server-resolver.d.ts +23 -0
- package/esm/src/proxy/server-resolver.d.ts.map +1 -0
- package/esm/src/proxy/server-resolver.js +124 -0
- package/esm/src/react/components/ai/chat/components/inference-badge.d.ts +8 -0
- package/esm/src/react/components/ai/chat/components/inference-badge.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/inference-badge.js +36 -0
- package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts +7 -0
- package/esm/src/react/components/ai/chat/components/upgrade-cta.d.ts.map +1 -0
- package/esm/src/react/components/ai/chat/components/upgrade-cta.js +33 -0
- package/esm/src/react/components/ai/chat/index.d.ts +7 -1
- package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/ai/chat/index.js +16 -4
- package/esm/src/sandbox/index.d.ts +31 -0
- package/esm/src/sandbox/index.d.ts.map +1 -0
- package/esm/src/sandbox/index.js +30 -0
- package/esm/src/sandbox/sandbox.d.ts +48 -0
- package/esm/src/sandbox/sandbox.d.ts.map +1 -0
- package/esm/src/sandbox/sandbox.js +178 -0
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/import-finder.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/import-finder.js +8 -2
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.d.ts +1 -0
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/index.js +1 -0
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/transform.d.ts.map +1 -1
- package/esm/src/transforms/pipeline/stages/ssr-vf-modules/transform.js +15 -1
- package/package.json +8 -1
- package/src/cli/app/data/slug-words.ts +225 -90
- package/src/cli/app/operations/project-creation.ts +3 -3
- package/src/cli/app/shell.ts +1 -1
- package/src/cli/app/utils.ts +0 -30
- package/src/cli/app/views/dashboard.ts +27 -4
- package/src/cli/auth/callback-server.ts +3 -2
- package/src/cli/commands/dev/handler.ts +2 -0
- package/src/cli/commands/init/init-command.ts +30 -3
- package/src/cli/commands/init/interactive-wizard.ts +62 -34
- package/src/cli/mcp/remote-file-tools.ts +50 -15
- package/src/cli/shared/reserve-slug.ts +9 -2
- package/src/cli/utils/env-prompt.ts +3 -0
- package/src/deno.js +11 -4
- package/src/src/agent/chat-handler.ts +57 -4
- package/src/src/agent/react/index.ts +2 -0
- package/src/src/agent/react/use-chat/browser-inference/browser-engine.ts +81 -0
- package/src/src/agent/react/use-chat/browser-inference/types.ts +52 -0
- package/src/src/agent/react/use-chat/browser-inference/worker-client.ts +89 -0
- package/src/src/agent/react/use-chat/browser-inference/worker-script.ts +98 -0
- package/src/src/agent/react/use-chat/index.ts +2 -0
- package/src/src/agent/react/use-chat/types.ts +20 -0
- package/src/src/agent/react/use-chat/use-chat.ts +148 -8
- package/src/src/agent/runtime/index.ts +72 -6
- package/src/src/build/production-build/templates.ts +2 -68
- package/src/src/chat/index.ts +2 -0
- package/src/src/errors/veryfront-error.ts +2 -1
- package/src/src/platform/adapters/runtime/deno/adapter.ts +25 -3
- package/src/src/platform/compat/http/deno-server.ts +28 -1
- package/src/src/provider/index.ts +1 -0
- package/src/src/provider/local/ai-sdk-adapter.ts +207 -0
- package/src/src/provider/local/env.ts +26 -0
- package/src/src/provider/local/local-engine.ts +288 -0
- package/src/src/provider/local/model-catalog.ts +73 -0
- package/src/src/provider/model-registry.ts +66 -2
- package/src/src/proxy/main.ts +41 -6
- package/src/src/proxy/server-resolver.ts +151 -0
- package/src/src/react/components/ai/chat/components/inference-badge.tsx +48 -0
- package/src/src/react/components/ai/chat/components/upgrade-cta.tsx +56 -0
- package/src/src/react/components/ai/chat/index.tsx +43 -6
- package/src/src/sandbox/index.ts +32 -0
- package/src/src/sandbox/sandbox.ts +236 -0
- package/src/src/transforms/pipeline/stages/ssr-vf-modules/import-finder.ts +9 -2
- package/src/src/transforms/pipeline/stages/ssr-vf-modules/index.ts +1 -0
- package/src/src/transforms/pipeline/stages/ssr-vf-modules/transform.ts +17 -0
|
@@ -24,6 +24,7 @@ export declare const _testExports: {
|
|
|
24
24
|
resolveVeryfrontSourcePath: typeof resolveVeryfrontSourcePath;
|
|
25
25
|
resolveAndTransformVeryfrontImport: typeof resolveAndTransformVeryfrontImport;
|
|
26
26
|
FRAMEWORK_ROOT: string;
|
|
27
|
+
EMBEDDED_SRC_DIR: string;
|
|
27
28
|
EXTENSIONS: string[];
|
|
28
29
|
};
|
|
29
30
|
export declare const ssrVfModulesPlugin: TransformPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/pipeline/stages/ssr-vf-modules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMtD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,kCAAkC,EAEnC,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,kCAAkC,EAClC,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,yBAAyB,EACzB,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAexB,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/pipeline/stages/ssr-vf-modules/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMtD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,kCAAkC,EAEnC,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,kCAAkC,EAClC,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,UAAU,EACV,yBAAyB,EACzB,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAexB,eAAO,MAAM,YAAY;;;;;;;;;;CAUxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,eA+EhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/pipeline/stages/ssr-vf-modules/transform.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAYrE,OAAO,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/pipeline/stages/ssr-vf-modules/transform.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAYrE,OAAO,EAOL,KAAK,gBAAgB,EAGtB,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,EAAE,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CA2BjB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,gBAAgB,EACrB,oBAAoB,UAAQ,EAC5B,KAAK,SAAI,GACR,OAAO,CAAC,MAAM,CAAC,CAoPjB;AAED;;;GAGG;AACH,wBAAsB,kCAAkC,CACtD,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4CxB;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GACtC,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|
|
@@ -15,7 +15,7 @@ import { VERSION } from "../../../../utils/version.js";
|
|
|
15
15
|
import { buildReactUrl, getReactImportMap } from "../../../import-rewriter/url-builder.js";
|
|
16
16
|
import { findRelativeImports } from "./import-finder.js";
|
|
17
17
|
import { resolveRelativeFrameworkImport, resolveVeryfrontSourcePath } from "./path-resolver.js";
|
|
18
|
-
import { FRAMEWORK_ROOT, frameworkFileCache, frameworkWriteFlight, LOG_PREFIX, MAX_RELATIVE_IMPORT_DEPTH, transformingFiles, veryfrontTransformCache, } from "./constants.js";
|
|
18
|
+
import { EMBEDDED_SRC_DIR, FRAMEWORK_ROOT, frameworkFileCache, frameworkWriteFlight, LOG_PREFIX, MAX_RELATIVE_IMPORT_DEPTH, transformingFiles, veryfrontTransformCache, } from "./constants.js";
|
|
19
19
|
/**
|
|
20
20
|
* Check if a transformed code string is a cycle placeholder.
|
|
21
21
|
* Cycle placeholders are returned when transformFrameworkCode detects a cycle
|
|
@@ -159,6 +159,10 @@ export async function transformFrameworkCode(content, sourcePath, ctx, throwOnMi
|
|
|
159
159
|
// Safety: MAX_RELATIVE_IMPORT_DEPTH limits recursion, transformingFiles detects
|
|
160
160
|
// cycles, and frameworkFileCache deduplicates already-transformed files.
|
|
161
161
|
const relativeReplacements = new Map();
|
|
162
|
+
// Prefixes for framework source directories - files outside these are
|
|
163
|
+
// already-compiled JS (e.g. dnt shims) that should not be recursively transformed.
|
|
164
|
+
const frameworkSrcDir = join(FRAMEWORK_ROOT, "src") + "/";
|
|
165
|
+
const embeddedSrcDirPrefix = EMBEDDED_SRC_DIR + "/";
|
|
162
166
|
{
|
|
163
167
|
const relativeImports = findRelativeImports(transformed);
|
|
164
168
|
for (const specifier of relativeImports) {
|
|
@@ -174,6 +178,16 @@ export async function transformFrameworkCode(content, sourcePath, ctx, throwOnMi
|
|
|
174
178
|
logger.warn(`${LOG_PREFIX} Could not resolve relative import "${specifier}" in ${sourcePath}`);
|
|
175
179
|
continue;
|
|
176
180
|
}
|
|
181
|
+
// Files outside framework source directories (e.g. _dnt.shims.js,
|
|
182
|
+
// _dnt.polyfills.js) are already-compiled JS with bare npm imports
|
|
183
|
+
// that Deno resolves natively. Skip recursive transformation and
|
|
184
|
+
// just point to the file directly.
|
|
185
|
+
const isFrameworkSource = resolvedPath.startsWith(frameworkSrcDir) ||
|
|
186
|
+
resolvedPath.startsWith(embeddedSrcDirPrefix);
|
|
187
|
+
if (!isFrameworkSource) {
|
|
188
|
+
relativeReplacements.set(specifier, `file://${resolvedPath}`);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
177
191
|
// Check if this dependency was already transformed (by absolute path)
|
|
178
192
|
const existingFileUrl = frameworkFileCache.get(resolvedPath);
|
|
179
193
|
if (existingFileUrl) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "veryfront",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "The simplest way to build AI-powered apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -94,6 +94,9 @@
|
|
|
94
94
|
"./integrations": {
|
|
95
95
|
"import": "./esm/src/integrations/index.js"
|
|
96
96
|
},
|
|
97
|
+
"./sandbox": {
|
|
98
|
+
"import": "./esm/src/sandbox/index.js"
|
|
99
|
+
},
|
|
97
100
|
"./cli": {
|
|
98
101
|
"import": "./esm/cli/main.js"
|
|
99
102
|
},
|
|
@@ -105,6 +108,9 @@
|
|
|
105
108
|
"engines": {
|
|
106
109
|
"node": ">=18.0.0"
|
|
107
110
|
},
|
|
111
|
+
"optionalDependencies": {
|
|
112
|
+
"@huggingface/transformers": "^3.4.2"
|
|
113
|
+
},
|
|
108
114
|
"peerDependenciesMeta": {
|
|
109
115
|
"better-sqlite3": {
|
|
110
116
|
"optional": true
|
|
@@ -119,6 +125,7 @@
|
|
|
119
125
|
"@babel/parser": "7.26.3",
|
|
120
126
|
"@babel/traverse": "7.26.3",
|
|
121
127
|
"@babel/types": "7.26.3",
|
|
128
|
+
"@huggingface/transformers": "3.4.2",
|
|
122
129
|
"@mdx-js/mdx": "3.0.0",
|
|
123
130
|
"@opentelemetry/api": "1",
|
|
124
131
|
"@opentelemetry/context-async-hooks": "1",
|
|
@@ -1,168 +1,303 @@
|
|
|
1
1
|
export const ADJECTIVES = [
|
|
2
|
-
"
|
|
3
|
-
"azure",
|
|
4
|
-
"coral",
|
|
5
|
-
"crimson",
|
|
6
|
-
"cyan",
|
|
7
|
-
"golden",
|
|
8
|
-
"indigo",
|
|
9
|
-
"ivory",
|
|
10
|
-
"jade",
|
|
11
|
-
"magenta",
|
|
12
|
-
"maroon",
|
|
13
|
-
"olive",
|
|
14
|
-
"onyx",
|
|
15
|
-
"opal",
|
|
16
|
-
"pearl",
|
|
17
|
-
"ruby",
|
|
18
|
-
"scarlet",
|
|
19
|
-
"silver",
|
|
20
|
-
"teal",
|
|
21
|
-
"topaz",
|
|
22
|
-
"turquoise",
|
|
23
|
-
"violet",
|
|
2
|
+
"agile",
|
|
24
3
|
"alpine",
|
|
4
|
+
"amber",
|
|
5
|
+
"ancient",
|
|
6
|
+
"aqua",
|
|
25
7
|
"arctic",
|
|
8
|
+
"arid",
|
|
9
|
+
"astral",
|
|
26
10
|
"autumn",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"floral",
|
|
31
|
-
"forest",
|
|
32
|
-
"frozen",
|
|
33
|
-
"lunar",
|
|
34
|
-
"misty",
|
|
35
|
-
"mossy",
|
|
36
|
-
"ocean",
|
|
37
|
-
"polar",
|
|
38
|
-
"rainy",
|
|
39
|
-
"snowy",
|
|
40
|
-
"solar",
|
|
41
|
-
"spring",
|
|
42
|
-
"stormy",
|
|
43
|
-
"sunny",
|
|
44
|
-
"tidal",
|
|
45
|
-
"tropic",
|
|
46
|
-
"windy",
|
|
47
|
-
"agile",
|
|
11
|
+
"azure",
|
|
12
|
+
"balmy",
|
|
13
|
+
"blazing",
|
|
48
14
|
"bold",
|
|
49
15
|
"brave",
|
|
16
|
+
"breezy",
|
|
50
17
|
"bright",
|
|
18
|
+
"brisk",
|
|
19
|
+
"bronze",
|
|
51
20
|
"calm",
|
|
21
|
+
"cedar",
|
|
52
22
|
"clever",
|
|
23
|
+
"coastal",
|
|
24
|
+
"cobalt",
|
|
25
|
+
"copper",
|
|
26
|
+
"coral",
|
|
53
27
|
"cosmic",
|
|
28
|
+
"crimson",
|
|
29
|
+
"crisp",
|
|
30
|
+
"crystal",
|
|
31
|
+
"cyan",
|
|
54
32
|
"daring",
|
|
33
|
+
"deep",
|
|
34
|
+
"dewy",
|
|
35
|
+
"dreamy",
|
|
36
|
+
"dusky",
|
|
37
|
+
"dusty",
|
|
55
38
|
"eager",
|
|
39
|
+
"earthy",
|
|
40
|
+
"ebony",
|
|
41
|
+
"emerald",
|
|
56
42
|
"epic",
|
|
43
|
+
"faint",
|
|
44
|
+
"feral",
|
|
57
45
|
"fierce",
|
|
46
|
+
"fleet",
|
|
47
|
+
"floral",
|
|
48
|
+
"fluid",
|
|
49
|
+
"forest",
|
|
50
|
+
"fresh",
|
|
51
|
+
"frozen",
|
|
52
|
+
"frosty",
|
|
53
|
+
"garnet",
|
|
58
54
|
"gentle",
|
|
55
|
+
"glacial",
|
|
56
|
+
"gleaming",
|
|
57
|
+
"glowing",
|
|
58
|
+
"golden",
|
|
59
|
+
"graceful",
|
|
59
60
|
"grand",
|
|
61
|
+
"hazy",
|
|
62
|
+
"hollow",
|
|
63
|
+
"hushed",
|
|
64
|
+
"icy",
|
|
65
|
+
"indigo",
|
|
66
|
+
"ivory",
|
|
67
|
+
"jade",
|
|
60
68
|
"keen",
|
|
61
69
|
"kind",
|
|
70
|
+
"lasting",
|
|
71
|
+
"lavender",
|
|
72
|
+
"leafy",
|
|
73
|
+
"light",
|
|
74
|
+
"lilac",
|
|
62
75
|
"lively",
|
|
76
|
+
"lone",
|
|
77
|
+
"lucid",
|
|
78
|
+
"lunar",
|
|
79
|
+
"magic",
|
|
80
|
+
"magenta",
|
|
81
|
+
"marine",
|
|
82
|
+
"maroon",
|
|
83
|
+
"mellow",
|
|
84
|
+
"mighty",
|
|
85
|
+
"misty",
|
|
86
|
+
"mossy",
|
|
63
87
|
"mystic",
|
|
64
88
|
"nimble",
|
|
65
89
|
"noble",
|
|
90
|
+
"obsidian",
|
|
91
|
+
"olive",
|
|
92
|
+
"onyx",
|
|
93
|
+
"opal",
|
|
94
|
+
"pale",
|
|
95
|
+
"pearl",
|
|
96
|
+
"placid",
|
|
97
|
+
"platinum",
|
|
98
|
+
"polar",
|
|
99
|
+
"prime",
|
|
66
100
|
"proud",
|
|
101
|
+
"pure",
|
|
67
102
|
"quiet",
|
|
103
|
+
"rainy",
|
|
68
104
|
"rapid",
|
|
105
|
+
"rare",
|
|
106
|
+
"regal",
|
|
107
|
+
"rosy",
|
|
108
|
+
"ruby",
|
|
109
|
+
"rugged",
|
|
110
|
+
"russet",
|
|
111
|
+
"rustic",
|
|
112
|
+
"saffron",
|
|
113
|
+
"sage",
|
|
114
|
+
"sandy",
|
|
115
|
+
"sapphire",
|
|
116
|
+
"scarlet",
|
|
69
117
|
"serene",
|
|
118
|
+
"shady",
|
|
119
|
+
"sharp",
|
|
70
120
|
"silent",
|
|
121
|
+
"silver",
|
|
122
|
+
"slate",
|
|
123
|
+
"sleek",
|
|
124
|
+
"smooth",
|
|
125
|
+
"snowy",
|
|
126
|
+
"soft",
|
|
127
|
+
"solar",
|
|
128
|
+
"somber",
|
|
129
|
+
"stark",
|
|
130
|
+
"starry",
|
|
71
131
|
"steady",
|
|
132
|
+
"stormy",
|
|
133
|
+
"strong",
|
|
134
|
+
"subtle",
|
|
135
|
+
"sunny",
|
|
136
|
+
"sunlit",
|
|
72
137
|
"swift",
|
|
138
|
+
"tawny",
|
|
139
|
+
"teal",
|
|
140
|
+
"tidal",
|
|
141
|
+
"topaz",
|
|
142
|
+
"tropic",
|
|
143
|
+
"turquoise",
|
|
144
|
+
"vast",
|
|
145
|
+
"velvet",
|
|
146
|
+
"verdant",
|
|
147
|
+
"violet",
|
|
73
148
|
"vivid",
|
|
149
|
+
"warm",
|
|
74
150
|
"wild",
|
|
151
|
+
"windy",
|
|
152
|
+
"wintry",
|
|
75
153
|
"wise",
|
|
76
154
|
"witty",
|
|
155
|
+
"woody",
|
|
77
156
|
"zen",
|
|
78
157
|
];
|
|
79
158
|
|
|
80
159
|
export const NOUNS = [
|
|
160
|
+
"arc",
|
|
161
|
+
"arch",
|
|
162
|
+
"aurora",
|
|
163
|
+
"basin",
|
|
81
164
|
"bay",
|
|
165
|
+
"beam",
|
|
166
|
+
"bend",
|
|
167
|
+
"blaze",
|
|
168
|
+
"bluff",
|
|
169
|
+
"bog",
|
|
170
|
+
"bolt",
|
|
171
|
+
"breeze",
|
|
82
172
|
"brook",
|
|
83
173
|
"canal",
|
|
84
|
-
"cascade",
|
|
85
|
-
"coast",
|
|
86
|
-
"creek",
|
|
87
|
-
"delta",
|
|
88
|
-
"falls",
|
|
89
|
-
"fjord",
|
|
90
|
-
"gulf",
|
|
91
|
-
"harbor",
|
|
92
|
-
"lagoon",
|
|
93
|
-
"lake",
|
|
94
|
-
"marsh",
|
|
95
|
-
"ocean",
|
|
96
|
-
"pond",
|
|
97
|
-
"rapids",
|
|
98
|
-
"reef",
|
|
99
|
-
"river",
|
|
100
|
-
"shore",
|
|
101
|
-
"spring",
|
|
102
|
-
"strait",
|
|
103
|
-
"stream",
|
|
104
|
-
"tide",
|
|
105
|
-
"wave",
|
|
106
|
-
"bluff",
|
|
107
174
|
"canyon",
|
|
175
|
+
"cape",
|
|
176
|
+
"cascade",
|
|
108
177
|
"cave",
|
|
178
|
+
"cavern",
|
|
179
|
+
"channel",
|
|
109
180
|
"cliff",
|
|
110
|
-
"crater",
|
|
111
|
-
"desert",
|
|
112
|
-
"dune",
|
|
113
|
-
"field",
|
|
114
|
-
"glade",
|
|
115
|
-
"gorge",
|
|
116
|
-
"grove",
|
|
117
|
-
"hill",
|
|
118
|
-
"isle",
|
|
119
|
-
"mesa",
|
|
120
|
-
"oasis",
|
|
121
|
-
"pass",
|
|
122
|
-
"peak",
|
|
123
|
-
"plain",
|
|
124
|
-
"plateau",
|
|
125
|
-
"ridge",
|
|
126
|
-
"rock",
|
|
127
|
-
"slope",
|
|
128
|
-
"stone",
|
|
129
|
-
"summit",
|
|
130
|
-
"trail",
|
|
131
|
-
"valley",
|
|
132
|
-
"volcano",
|
|
133
|
-
"aurora",
|
|
134
181
|
"cloud",
|
|
182
|
+
"coast",
|
|
135
183
|
"comet",
|
|
184
|
+
"copse",
|
|
185
|
+
"corona",
|
|
136
186
|
"cosmos",
|
|
187
|
+
"cove",
|
|
188
|
+
"crater",
|
|
189
|
+
"creek",
|
|
190
|
+
"crest",
|
|
191
|
+
"dale",
|
|
137
192
|
"dawn",
|
|
193
|
+
"delta",
|
|
194
|
+
"desert",
|
|
195
|
+
"drift",
|
|
196
|
+
"dune",
|
|
138
197
|
"dusk",
|
|
139
198
|
"eclipse",
|
|
199
|
+
"edge",
|
|
140
200
|
"ember",
|
|
201
|
+
"falls",
|
|
202
|
+
"fen",
|
|
203
|
+
"field",
|
|
204
|
+
"fjord",
|
|
141
205
|
"flare",
|
|
206
|
+
"flame",
|
|
207
|
+
"ford",
|
|
142
208
|
"frost",
|
|
143
209
|
"galaxy",
|
|
210
|
+
"gap",
|
|
211
|
+
"glade",
|
|
212
|
+
"glen",
|
|
144
213
|
"glow",
|
|
214
|
+
"gorge",
|
|
215
|
+
"grove",
|
|
216
|
+
"gulf",
|
|
217
|
+
"gust",
|
|
218
|
+
"harbor",
|
|
219
|
+
"haven",
|
|
145
220
|
"haze",
|
|
221
|
+
"heath",
|
|
222
|
+
"hill",
|
|
223
|
+
"hollow",
|
|
146
224
|
"horizon",
|
|
225
|
+
"inlet",
|
|
226
|
+
"isle",
|
|
227
|
+
"knoll",
|
|
228
|
+
"lagoon",
|
|
229
|
+
"lake",
|
|
230
|
+
"ledge",
|
|
231
|
+
"loch",
|
|
232
|
+
"marsh",
|
|
233
|
+
"meadow",
|
|
234
|
+
"mesa",
|
|
147
235
|
"meteor",
|
|
148
236
|
"mist",
|
|
149
237
|
"moon",
|
|
238
|
+
"moor",
|
|
239
|
+
"mount",
|
|
150
240
|
"nebula",
|
|
241
|
+
"north",
|
|
151
242
|
"nova",
|
|
243
|
+
"oasis",
|
|
244
|
+
"ocean",
|
|
152
245
|
"orbit",
|
|
246
|
+
"pass",
|
|
247
|
+
"peak",
|
|
248
|
+
"pine",
|
|
249
|
+
"plain",
|
|
250
|
+
"plateau",
|
|
251
|
+
"plume",
|
|
252
|
+
"pond",
|
|
253
|
+
"pool",
|
|
153
254
|
"prism",
|
|
154
255
|
"pulse",
|
|
155
256
|
"quasar",
|
|
257
|
+
"rain",
|
|
258
|
+
"range",
|
|
259
|
+
"rapids",
|
|
260
|
+
"ravine",
|
|
156
261
|
"ray",
|
|
262
|
+
"reef",
|
|
263
|
+
"ridge",
|
|
264
|
+
"rift",
|
|
265
|
+
"ripple",
|
|
266
|
+
"river",
|
|
267
|
+
"rock",
|
|
268
|
+
"sand",
|
|
269
|
+
"shade",
|
|
157
270
|
"shadow",
|
|
271
|
+
"shoal",
|
|
272
|
+
"shore",
|
|
158
273
|
"sky",
|
|
274
|
+
"slope",
|
|
275
|
+
"snow",
|
|
159
276
|
"spark",
|
|
277
|
+
"spring",
|
|
160
278
|
"star",
|
|
279
|
+
"stone",
|
|
161
280
|
"storm",
|
|
281
|
+
"strait",
|
|
282
|
+
"stream",
|
|
283
|
+
"summit",
|
|
162
284
|
"sun",
|
|
285
|
+
"surf",
|
|
163
286
|
"thunder",
|
|
287
|
+
"tide",
|
|
288
|
+
"torch",
|
|
289
|
+
"trail",
|
|
290
|
+
"tundra",
|
|
164
291
|
"twilight",
|
|
292
|
+
"vale",
|
|
293
|
+
"valley",
|
|
165
294
|
"vapor",
|
|
295
|
+
"volcano",
|
|
296
|
+
"vortex",
|
|
297
|
+
"wake",
|
|
298
|
+
"wave",
|
|
299
|
+
"wisp",
|
|
166
300
|
"wind",
|
|
167
301
|
"zenith",
|
|
302
|
+
"zephyr",
|
|
168
303
|
];
|
|
@@ -12,11 +12,11 @@ import { readToken } from "../../auth/token-store.js";
|
|
|
12
12
|
import { fetchRemoteProjects } from "../../sync/index.js";
|
|
13
13
|
import {
|
|
14
14
|
copyDirectory,
|
|
15
|
-
createRemoteProject,
|
|
16
15
|
generateRandomSlug,
|
|
17
16
|
getLocalProjectsFromState,
|
|
18
17
|
normalizeSlug,
|
|
19
18
|
} from "../utils.js";
|
|
19
|
+
import { reserveProjectSlug } from "../../shared/reserve-slug.js";
|
|
20
20
|
import { initCommand } from "../../commands/init/init-command.js";
|
|
21
21
|
import type { InitTemplate } from "../../commands/init/types.js";
|
|
22
22
|
|
|
@@ -45,7 +45,7 @@ export async function createProject(
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const normalizedSlug = normalizeSlug(projectName);
|
|
48
|
-
const { slug } = await
|
|
48
|
+
const { slug } = await reserveProjectSlug(normalizedSlug, token);
|
|
49
49
|
const projectPath = `${cwd()}/projects/${slug}`;
|
|
50
50
|
|
|
51
51
|
await initCommand({
|
|
@@ -95,7 +95,7 @@ export async function createProjectFromExample(
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
const normalizedSlug = normalizeSlug(projectName);
|
|
98
|
-
const { slug } = await
|
|
98
|
+
const { slug } = await reserveProjectSlug(normalizedSlug, token);
|
|
99
99
|
const projectPath = `${cwd()}/projects/${slug}`;
|
|
100
100
|
|
|
101
101
|
await copyDirectory(example.path, projectPath);
|
package/src/cli/app/shell.ts
CHANGED
|
@@ -158,7 +158,7 @@ export function createApp(config: AppConfig): App {
|
|
|
158
158
|
case "dashboard":
|
|
159
159
|
content = state.projects.items.length > 0 || state.examples.items.length > 0
|
|
160
160
|
? renderDashboard(state)
|
|
161
|
-
: renderEmptyState();
|
|
161
|
+
: renderEmptyState(state);
|
|
162
162
|
break;
|
|
163
163
|
case "new-project":
|
|
164
164
|
content = renderNewProjectView(state);
|
package/src/cli/app/utils.ts
CHANGED
|
@@ -3,13 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Helper functions for project creation and management.
|
|
5
5
|
*/
|
|
6
|
-
import * as dntShim from "../../_dnt.shims.js";
|
|
7
|
-
|
|
8
6
|
|
|
9
7
|
import { cwd } from "../../src/platform/index.js";
|
|
10
8
|
import { join } from "../../src/platform/compat/path/index.js";
|
|
11
|
-
import { getEnvironmentConfig } from "../../src/config/index.js";
|
|
12
|
-
import { capitalizeSeparatedWords } from "../../src/utils/case-utils.js";
|
|
13
9
|
import { readToken } from "../auth/token-store.js";
|
|
14
10
|
import { pullCommand } from "../commands/pull/index.js";
|
|
15
11
|
import { addLog, type AppState, type StateUpdater } from "./state.js";
|
|
@@ -46,32 +42,6 @@ export function normalizeSlug(projectName: string): string {
|
|
|
46
42
|
return projectName.replace(/[^a-z0-9-]/gi, "-").toLowerCase();
|
|
47
43
|
}
|
|
48
44
|
|
|
49
|
-
export function slugToName(slug: string): string {
|
|
50
|
-
return capitalizeSeparatedWords(slug, "-", " ");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export async function createRemoteProject(
|
|
54
|
-
token: string,
|
|
55
|
-
slug: string,
|
|
56
|
-
): Promise<{ slug: string }> {
|
|
57
|
-
const apiUrl = getEnvironmentConfig().apiUrl || "https://api.veryfront.com";
|
|
58
|
-
const response = await dntShim.fetch(`${apiUrl}/projects`, {
|
|
59
|
-
method: "POST",
|
|
60
|
-
headers: {
|
|
61
|
-
Authorization: `Bearer ${token}`,
|
|
62
|
-
"Content-Type": "application/json",
|
|
63
|
-
Accept: "application/json",
|
|
64
|
-
},
|
|
65
|
-
body: JSON.stringify({ slug, name: slugToName(slug) }),
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
if (response.ok) return (await response.json()) as { slug: string };
|
|
69
|
-
|
|
70
|
-
const error = await response.json().catch(() => ({}));
|
|
71
|
-
const msg = (error as { message?: string }).message || `HTTP ${response.status}`;
|
|
72
|
-
throw new Error(msg);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
45
|
export function getLocalProjectsFromState(
|
|
76
46
|
appState: AppState,
|
|
77
47
|
): Array<{ slug: string; path: string }> {
|
|
@@ -154,18 +154,35 @@ function renderSection(title: string, isActive = true): string {
|
|
|
154
154
|
* Render the help bar at the bottom
|
|
155
155
|
*/
|
|
156
156
|
function renderHelpBar(state: AppState): string {
|
|
157
|
+
const hasItems = state.projects.items.length > 0 || state.examples.items.length > 0 ||
|
|
158
|
+
(!!state.remote.user && state.remote.projects.length > 0);
|
|
159
|
+
|
|
157
160
|
if (!state.showHelp) {
|
|
158
161
|
const userInfo = state.remote.user ? ` ${dim("-")} ${brand(state.remote.user.email)}` : "";
|
|
162
|
+
if (!hasItems) {
|
|
163
|
+
const authHint = state.remote.user
|
|
164
|
+
? `${dim("x")} ${dim("logout")}`
|
|
165
|
+
: `${dim("a")} ${dim("login")}`;
|
|
166
|
+
return ` ${dim("n")} ${dim("new project")} ${authHint} ${dim("? more")} ${
|
|
167
|
+
dim("q quit")
|
|
168
|
+
}${userInfo}`;
|
|
169
|
+
}
|
|
159
170
|
return ` ${dim("↑↓ select enter open ? more q quit")}${userInfo}`;
|
|
160
171
|
}
|
|
161
172
|
|
|
162
173
|
const lines: string[] = [];
|
|
163
|
-
|
|
174
|
+
|
|
175
|
+
if (hasItems) {
|
|
176
|
+
lines.push(` ${dim("o")} open ${dim("s")} studio ${dim("i")} ide`);
|
|
177
|
+
}
|
|
164
178
|
|
|
165
179
|
if (!state.remote.user) {
|
|
166
180
|
lines.push(` ${dim("n")} new ${dim("a")} login`);
|
|
167
181
|
} else {
|
|
168
|
-
|
|
182
|
+
const parts = [` ${dim("n")} new`];
|
|
183
|
+
if (hasItems) parts.push(`${dim("p")} pull ${dim("u")} push`);
|
|
184
|
+
parts.push(`${dim("x")} logout`);
|
|
185
|
+
lines.push(parts.join(" "));
|
|
169
186
|
}
|
|
170
187
|
|
|
171
188
|
lines.push(` ${dim("? hide q quit")}`);
|
|
@@ -193,6 +210,12 @@ export function renderDashboardBoxed(state: AppState): string {
|
|
|
193
210
|
/**
|
|
194
211
|
* Render empty state when no projects found
|
|
195
212
|
*/
|
|
196
|
-
export function renderEmptyState(): string {
|
|
197
|
-
|
|
213
|
+
export function renderEmptyState(state: AppState): string {
|
|
214
|
+
const lines: string[] = [];
|
|
215
|
+
|
|
216
|
+
lines.push(renderBanner(state), "");
|
|
217
|
+
lines.push(` ${dim("No projects.")} ${brand("n")} ${dim("to create")}`, "");
|
|
218
|
+
lines.push(renderHelpBar(state));
|
|
219
|
+
|
|
220
|
+
return lines.join("\n");
|
|
198
221
|
}
|
|
@@ -186,8 +186,9 @@ function tryStartDenoServer(port: number): CallbackServer {
|
|
|
186
186
|
resolveCallback = resolve;
|
|
187
187
|
});
|
|
188
188
|
|
|
189
|
-
//
|
|
190
|
-
const
|
|
189
|
+
// Access native Deno.serve via `self` to bypass dnt shim transform.
|
|
190
|
+
const nativeDeno = (self as unknown as Record<string, typeof dntShim.Deno>)["Deno"]!;
|
|
191
|
+
const server = nativeDeno.serve(
|
|
191
192
|
{ port, hostname: "127.0.0.1", onListen: () => {} },
|
|
192
193
|
(request: dntShim.Request) => {
|
|
193
194
|
const url = new URL(request.url);
|