create-flow-os 0.0.1-dev.1771614697
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/config.json +54 -0
- package/flow.config.client.ts +3 -0
- package/gen.ts +163 -0
- package/index.ts +175 -0
- package/package.json +29 -0
- package/profiles/client/.dockerignore +12 -0
- package/profiles/client/.oxfmtrc.json +7 -0
- package/profiles/client/.oxlintrc.json +13 -0
- package/profiles/client/.vscode/settings.json +12 -0
- package/profiles/client/Dockerfile +26 -0
- package/profiles/client/bun.lock +334 -0
- package/profiles/client/client/root.css +9 -0
- package/profiles/client/client/root.tsx +17 -0
- package/profiles/client/client/routes/about.tsx +22 -0
- package/profiles/client/client/routes/index.tsx +48 -0
- package/profiles/client/flow.config.ts +3 -0
- package/profiles/client/index.html +5 -0
- package/profiles/client/package.json +32 -0
- package/profiles/client/packages/client/config.ts +68 -0
- package/profiles/client/packages/client/dom.ts +5 -0
- package/profiles/client/packages/client/features/attrs.ts +32 -0
- package/profiles/client/packages/client/features/class-flow.ts +116 -0
- package/profiles/client/packages/client/features/index.ts +8 -0
- package/profiles/client/packages/client/features/pseudo-injector.ts +40 -0
- package/profiles/client/packages/client/features/style-flow.ts +106 -0
- package/profiles/client/packages/client/features/style.ts +27 -0
- package/profiles/client/packages/client/features/utils.ts +4 -0
- package/profiles/client/packages/client/features/viewport.ts +20 -0
- package/profiles/client/packages/client/index.ts +4 -0
- package/profiles/client/packages/client/jsx-dev-runtime.ts +1 -0
- package/profiles/client/packages/client/jsx-runtime.ts +1 -0
- package/profiles/client/packages/client/jsx-types.d.ts +64 -0
- package/profiles/client/packages/client/jsx.ts +99 -0
- package/profiles/client/packages/client/package.json +42 -0
- package/profiles/client/packages/client/vite.ts +42 -0
- package/profiles/client/tsconfig.json +30 -0
- package/utils.ts +74 -0
package/utils.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { mkdir, readdir } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
export function transformPackageJson(
|
|
5
|
+
pkg: Record<string, unknown>,
|
|
6
|
+
projectName: string,
|
|
7
|
+
extraPackages: Record<string, string> = {},
|
|
8
|
+
useWorkspace = false
|
|
9
|
+
): Record<string, unknown> {
|
|
10
|
+
const out = { ...pkg };
|
|
11
|
+
out.name = projectName;
|
|
12
|
+
out.private = true;
|
|
13
|
+
delete out.workspaces;
|
|
14
|
+
const deps = (out.dependencies as Record<string, string>) || {};
|
|
15
|
+
const next: Record<string, string> = {};
|
|
16
|
+
for (const [k, v] of Object.entries(deps)) {
|
|
17
|
+
const isFlow = k.startsWith("@flow-os/") || k === "@flow-os";
|
|
18
|
+
if (v === "workspace:*") next[k] = useWorkspace && isFlow ? "workspace:*" : "^0.0.1";
|
|
19
|
+
else next[k] = v;
|
|
20
|
+
}
|
|
21
|
+
for (const [k, v] of Object.entries(extraPackages)) {
|
|
22
|
+
if (!(k in next)) next[k] = v;
|
|
23
|
+
}
|
|
24
|
+
out.dependencies = next;
|
|
25
|
+
const devDeps = out.devDependencies as Record<string, string> | undefined;
|
|
26
|
+
if (devDeps) {
|
|
27
|
+
const nextDev: Record<string, string> = {};
|
|
28
|
+
for (const [k, v] of Object.entries(devDeps)) {
|
|
29
|
+
if (k === "vite-plugin-oxlint" || k === "oxlint" || k === "oxfmt") continue;
|
|
30
|
+
nextDev[k] = v;
|
|
31
|
+
}
|
|
32
|
+
out.devDependencies = nextDev;
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function copyWithExclude(srcDir: string, destDir: string, exclude: string[]): Promise<void> {
|
|
38
|
+
const set = new Set(exclude.map((e) => e.toLowerCase()));
|
|
39
|
+
async function w(dir: string, rel: string): Promise<void> {
|
|
40
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
41
|
+
for (const ent of entries) {
|
|
42
|
+
const name = ent.name;
|
|
43
|
+
if (set.has(name.toLowerCase())) continue;
|
|
44
|
+
const relPath = rel ? join(rel, name) : name;
|
|
45
|
+
const srcPath = join(dir, name);
|
|
46
|
+
const destPath = join(destDir, relPath);
|
|
47
|
+
if (ent.isDirectory()) {
|
|
48
|
+
await mkdir(destPath, { recursive: true });
|
|
49
|
+
await w(srcPath, relPath);
|
|
50
|
+
} else {
|
|
51
|
+
await mkdir(join(destDir, rel), { recursive: true });
|
|
52
|
+
await Bun.write(destPath, Bun.file(srcPath));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
await mkdir(destDir, { recursive: true });
|
|
57
|
+
await w(srcDir, "");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export async function findPackageDir(repoRoot: string, packageName: string): Promise<string | null> {
|
|
61
|
+
const packagesDir = join(repoRoot, "packages");
|
|
62
|
+
try {
|
|
63
|
+
const entries = await readdir(packagesDir, { withFileTypes: true });
|
|
64
|
+
for (const ent of entries) {
|
|
65
|
+
if (!ent.isDirectory()) continue;
|
|
66
|
+
const pkgPath = join(packagesDir, ent.name, "package.json");
|
|
67
|
+
try {
|
|
68
|
+
const pkg = (await Bun.file(pkgPath).json()) as { name?: string };
|
|
69
|
+
if (pkg.name === packageName) return join(packagesDir, ent.name);
|
|
70
|
+
} catch {}
|
|
71
|
+
}
|
|
72
|
+
} catch {}
|
|
73
|
+
return null;
|
|
74
|
+
}
|