@iconoma/studio 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/api/actions.d.ts +7 -0
- package/dist/api/actions.d.ts.map +1 -0
- package/dist/api/actions.js +351 -0
- package/dist/api/db.d.ts +11 -0
- package/dist/api/db.d.ts.map +1 -0
- package/dist/api/db.js +20 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +201 -0
- package/dist/api/queue.d.ts +6 -0
- package/dist/api/queue.d.ts.map +1 -0
- package/dist/api/queue.js +4 -0
- package/dist/api/svgo-plugin-map-colors.d.ts +11 -0
- package/dist/api/svgo-plugin-map-colors.d.ts.map +1 -0
- package/dist/api/svgo-plugin-map-colors.js +199 -0
- package/dist/api/target-clients/interface.d.ts +6 -0
- package/dist/api/target-clients/interface.d.ts.map +1 -0
- package/dist/api/target-clients/interface.js +1 -0
- package/dist/api/target-clients/react-native.d.ts +7 -0
- package/dist/api/target-clients/react-native.d.ts.map +1 -0
- package/dist/api/target-clients/react-native.js +22 -0
- package/dist/api/target-clients/react.d.ts +9 -0
- package/dist/api/target-clients/react.d.ts.map +1 -0
- package/dist/api/target-clients/react.js +285 -0
- package/dist/api/types.d.ts +57 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +1 -0
- package/dist/api/utils.d.ts +28 -0
- package/dist/api/utils.d.ts.map +1 -0
- package/dist/api/utils.js +126 -0
- package/dist/client/assets/base-80a1f760-DXByDNOn.js +1 -0
- package/dist/client/assets/consoleHook-59e792cb-Cc-Wa9Dv.js +2 -0
- package/dist/client/assets/index-2gul9srt.js +810 -0
- package/dist/client/assets/index-599aeaf7-CuvDGLig.js +16 -0
- package/dist/client/assets/index-B8EuJHGY.css +1 -0
- package/dist/client/assets/node-C6_XYplI.js +4 -0
- package/dist/client/assets/runtime-BL9Nzh_-.js +1 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/icon.png +0 -0
- package/dist/client/index.html +21 -0
- package/dist/server/assets/base-80a1f760-qtF4btYl.js +31 -0
- package/dist/server/assets/consoleHook-59e792cb-DzCtq2z9.js +230 -0
- package/dist/server/assets/index-599aeaf7-CrZ9wybV.js +7378 -0
- package/dist/server/assets/node-Cq9Cey_i.js +1412 -0
- package/dist/server/assets/runtime-Cj4RK1K3.js +8158 -0
- package/dist/server/entry-server.js +38533 -0
- package/dist/server/favicon.ico +0 -0
- package/dist/server/icon.png +0 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +86 -0
- package/package.json +88 -0
|
Binary file
|
|
Binary file
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "dotenv/config";
|
|
2
|
+
type CreateServerOptions = {
|
|
3
|
+
port?: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function createServer({ port }?: CreateServerOptions): Promise<{
|
|
6
|
+
url: string;
|
|
7
|
+
close: () => Promise<void>;
|
|
8
|
+
}>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAkBvB,KAAK,mBAAmB,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C,wBAAsB,YAAY,CAAC,EAAE,IAAI,EAAE,GAAE,mBAAwB;;;GA6EpE"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import "dotenv/config";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import express from "express";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import getPort from "get-port";
|
|
6
|
+
import http from "node:http";
|
|
7
|
+
import apiRoutes from "./api/index.js";
|
|
8
|
+
import path, { dirname } from "node:path";
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = dirname(__filename);
|
|
11
|
+
const isProduction = __filename.endsWith(".js");
|
|
12
|
+
const templateHtml = isProduction
|
|
13
|
+
? await fs.readFile(path.join(__dirname, "client", "index.html"), "utf-8")
|
|
14
|
+
: "";
|
|
15
|
+
export async function createServer({ port } = {}) {
|
|
16
|
+
if (!port) {
|
|
17
|
+
port = await getPort({ port: [4545, 4546, 4547, 4548, 4549, 5173] });
|
|
18
|
+
}
|
|
19
|
+
const app = express();
|
|
20
|
+
app.use("/api", apiRoutes);
|
|
21
|
+
let vite;
|
|
22
|
+
if (!isProduction) {
|
|
23
|
+
const { createServer } = await import("vite");
|
|
24
|
+
vite = await createServer({
|
|
25
|
+
server: { middlewareMode: true },
|
|
26
|
+
appType: "custom",
|
|
27
|
+
base: "/",
|
|
28
|
+
});
|
|
29
|
+
app.use(vite.middlewares);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
const compression = (await import("compression")).default;
|
|
33
|
+
const sirv = (await import("sirv")).default;
|
|
34
|
+
app.use(compression());
|
|
35
|
+
app.use("/", sirv(path.join(__dirname, "client"), { extensions: [] }));
|
|
36
|
+
}
|
|
37
|
+
app.use("*all", async (req, res) => {
|
|
38
|
+
try {
|
|
39
|
+
const url = req.originalUrl;
|
|
40
|
+
let template;
|
|
41
|
+
let render;
|
|
42
|
+
if (!isProduction) {
|
|
43
|
+
if (!vite)
|
|
44
|
+
return res.status(500).end("Internal Server Error");
|
|
45
|
+
template = await fs.readFile("./index.html", "utf-8");
|
|
46
|
+
template = await vite.transformIndexHtml(url, template);
|
|
47
|
+
render = (await vite.ssrLoadModule("/src/entry-server.jsx")).render;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
template = templateHtml;
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
render = (await import("./server/entry-server.js")).render;
|
|
53
|
+
}
|
|
54
|
+
const rendered = await render(url);
|
|
55
|
+
const html = template
|
|
56
|
+
.replace(`<!--app-head-->`, rendered.head ?? "")
|
|
57
|
+
.replace(`<!--app-html-->`, rendered.html ?? "");
|
|
58
|
+
res.status(200).set({ "Content-Type": "text/html" }).send(html);
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
vite?.ssrFixStacktrace(e);
|
|
62
|
+
console.log(e.stack);
|
|
63
|
+
res.status(500).end(e.stack);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const url = `http://localhost:${port}`;
|
|
67
|
+
const httpServer = http.createServer(app);
|
|
68
|
+
await new Promise((resolve, reject) => {
|
|
69
|
+
httpServer.once("error", reject);
|
|
70
|
+
httpServer.listen(port, "localhost", () => resolve());
|
|
71
|
+
});
|
|
72
|
+
async function close() {
|
|
73
|
+
if (vite) {
|
|
74
|
+
try {
|
|
75
|
+
await vite.close();
|
|
76
|
+
}
|
|
77
|
+
catch { }
|
|
78
|
+
vite = undefined;
|
|
79
|
+
}
|
|
80
|
+
await new Promise((resolve) => httpServer.close(() => resolve()));
|
|
81
|
+
}
|
|
82
|
+
return { url, close };
|
|
83
|
+
}
|
|
84
|
+
if (!isProduction) {
|
|
85
|
+
createServer().then(({ url }) => console.log(`Server started at ${url}`));
|
|
86
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@iconoma/studio",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/server.js",
|
|
6
|
+
"private": false,
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/theryston/iconoma.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/theryston/iconoma",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"oclif",
|
|
17
|
+
"iconoma",
|
|
18
|
+
"icon management",
|
|
19
|
+
"icons",
|
|
20
|
+
"studio",
|
|
21
|
+
"CLI",
|
|
22
|
+
"SVG",
|
|
23
|
+
"react",
|
|
24
|
+
"icon pipeline",
|
|
25
|
+
"icon optimizer",
|
|
26
|
+
"icon library",
|
|
27
|
+
"SVGO",
|
|
28
|
+
"design system",
|
|
29
|
+
"icon build",
|
|
30
|
+
"icon generator",
|
|
31
|
+
"react icons"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"author": "Theryston Santos @Theryston",
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@hookform/resolvers": "^5.2.2",
|
|
40
|
+
"@svgr/core": "^8.1.0",
|
|
41
|
+
"@svgr/plugin-jsx": "^8.1.0",
|
|
42
|
+
"@svgr/plugin-prettier": "^8.1.0",
|
|
43
|
+
"@svgr/plugin-svgo": "^8.1.0",
|
|
44
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
45
|
+
"@tanstack/react-query": "^5.90.12",
|
|
46
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
47
|
+
"axios": "^1.13.2",
|
|
48
|
+
"canvas-confetti": "^1.9.4",
|
|
49
|
+
"compression": "^1.8.1",
|
|
50
|
+
"dotenv": "^17.2.3",
|
|
51
|
+
"express": "^5.2.1",
|
|
52
|
+
"fastq": "^1.19.1",
|
|
53
|
+
"get-port": "^7.1.0",
|
|
54
|
+
"lucide-react": "^0.475.0",
|
|
55
|
+
"react": "^19.2.0",
|
|
56
|
+
"react-dom": "^19.2.0",
|
|
57
|
+
"react-dropzone": "^14.3.8",
|
|
58
|
+
"react-hook-form": "^7.68.0",
|
|
59
|
+
"react-router": "^7.11.0",
|
|
60
|
+
"sirv": "^3.0.2",
|
|
61
|
+
"svgo": "^4.0.0",
|
|
62
|
+
"zod": "^3.25.76",
|
|
63
|
+
"@iconoma/ui": "0.0.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@types/canvas-confetti": "^1.9.0",
|
|
67
|
+
"@types/compression": "^1.8.1",
|
|
68
|
+
"@types/express": "^5.0.6",
|
|
69
|
+
"@types/react": "^19.2.5",
|
|
70
|
+
"@types/react-dom": "^19.2.3",
|
|
71
|
+
"nodemon": "^3.1.11",
|
|
72
|
+
"ts-add-js-extension": "^1.6.6",
|
|
73
|
+
"tsx": "^4.21.0",
|
|
74
|
+
"vite": "npm:rolldown-vite@7.2.5",
|
|
75
|
+
"@iconoma/eslint-config": "^0.0.0",
|
|
76
|
+
"@iconoma/typescript-config": "0.0.0"
|
|
77
|
+
},
|
|
78
|
+
"exports": {
|
|
79
|
+
".": "./dist/server.js"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"dev": "nodemon --watch server.ts --watch ./api --ext ts,js,tsx --exec pnpm run dev:server",
|
|
83
|
+
"dev:server": "tsx server.ts",
|
|
84
|
+
"build": "pnpm build:client && pnpm build:server && tsc -p tsconfig.server.json && ts-add-js-extension --dir=dist",
|
|
85
|
+
"build:client": "vite build --outDir dist/client",
|
|
86
|
+
"build:server": "vite build --ssr src/entry-server.tsx --outDir dist/server"
|
|
87
|
+
}
|
|
88
|
+
}
|