odoro 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +12 -0
- package/client.d.ts +84 -0
- package/dist/build-SNTGJH2J.js +4 -0
- package/dist/chunk-2YDI5NKV.js +55 -0
- package/dist/chunk-G2WW7N4C.js +1872 -0
- package/dist/chunk-G5QXVBYT.js +1139 -0
- package/dist/chunk-JMEHF3KN.js +35 -0
- package/dist/chunk-PEMYUK2D.js +64 -0
- package/dist/chunk-T42X2NJN.js +98 -0
- package/dist/chunk-T6RLHSCW.js +123 -0
- package/dist/chunk-UGRSODHU.js +154 -0
- package/dist/cli.d.ts +40 -0
- package/dist/cli.js +236 -0
- package/dist/commands-FVAHVVVN.js +793 -0
- package/dist/commands-V44Y5G4F.js +245 -0
- package/dist/create-SH2M722Y.js +288 -0
- package/dist/index.d.ts +354 -0
- package/dist/index.js +7 -0
- package/dist/package-AUINPBEX.js +62 -0
- package/dist/preview-LOAO5Y6V.js +3 -0
- package/dist/registry/index.d.ts +316 -0
- package/dist/registry/index.js +2 -0
- package/dist/server-MZ76LPAG.js +3 -0
- package/package.json +57 -0
- package/templates/react-ts/README.md +52 -0
- package/templates/react-ts/_gitignore +8 -0
- package/templates/react-ts/index.html +13 -0
- package/templates/react-ts/odoro.config.ts +10 -0
- package/templates/react-ts/package.json +23 -0
- package/templates/react-ts/public/favicon.svg +4 -0
- package/templates/react-ts/src/App.tsx +66 -0
- package/templates/react-ts/src/main.tsx +18 -0
- package/templates/react-ts/src/odoro-env.d.ts +1 -0
- package/templates/react-ts/src/routes/About.tsx +19 -0
- package/templates/react-ts/src/routes/Home.tsx +80 -0
- package/templates/react-ts/src/routes/NotFound.tsx +14 -0
- package/templates/react-ts/src/styles.css +13 -0
- package/templates/react-ts/tsconfig.json +25 -0
- package/templates/react-ts-server/Dockerfile +51 -0
- package/templates/react-ts-server/README.md +87 -0
- package/templates/react-ts-server/_dockerignore +8 -0
- package/templates/react-ts-server/_env.example +78 -0
- package/templates/react-ts-server/_gitignore +8 -0
- package/templates/react-ts-server/client/index.html +13 -0
- package/templates/react-ts-server/client/public/favicon.svg +4 -0
- package/templates/react-ts-server/client/src/App.tsx +66 -0
- package/templates/react-ts-server/client/src/main.tsx +18 -0
- package/templates/react-ts-server/client/src/odoro-env.d.ts +1 -0
- package/templates/react-ts-server/client/src/routes/About.tsx +19 -0
- package/templates/react-ts-server/client/src/routes/Home.tsx +148 -0
- package/templates/react-ts-server/client/src/routes/NotFound.tsx +14 -0
- package/templates/react-ts-server/client/src/styles.css +13 -0
- package/templates/react-ts-server/odoro.config.ts +21 -0
- package/templates/react-ts-server/package.json +33 -0
- package/templates/react-ts-server/scripts/dev.mjs +74 -0
- package/templates/react-ts-server/server/src/main.ts +131 -0
- package/templates/react-ts-server/server/src/modules/health/index.ts +144 -0
- package/templates/react-ts-server/server/tsconfig.json +23 -0
- package/templates/react-ts-server/tsconfig.json +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2026 BouBouw. Tous droits reserves.
|
|
2
|
+
|
|
3
|
+
Ce logiciel et son code source sont la propriete exclusive de BouBouw.
|
|
4
|
+
|
|
5
|
+
Aucune autorisation n'est accordee, expressement ou implicitement, de copier,
|
|
6
|
+
modifier, fusionner, publier, distribuer, sous-licencier ou vendre tout ou
|
|
7
|
+
partie de ce logiciel, ni d'en creer des oeuvres derivees, sans accord ecrit
|
|
8
|
+
prealable de BouBouw.
|
|
9
|
+
|
|
10
|
+
CE LOGICIEL EST FOURNI "EN L'ETAT", SANS GARANTIE D'AUCUNE SORTE, EXPRESSE OU
|
|
11
|
+
IMPLICITE, Y COMPRIS SANS S'Y LIMITER LES GARANTIES DE QUALITE MARCHANDE,
|
|
12
|
+
D'ADEQUATION A UN USAGE PARTICULIER ET D'ABSENCE DE CONTREFACON.
|
package/client.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types ambiants pour le code client d'un projet Odoro.
|
|
3
|
+
*
|
|
4
|
+
* A referencer une fois dans le projet :
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* /// <reference types="odoro/client" />
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/** Variables d'environnement exposees au navigateur. */
|
|
14
|
+
interface OdoroEnv {
|
|
15
|
+
/** Mode de compilation. */
|
|
16
|
+
readonly MODE: 'development' | 'production'
|
|
17
|
+
/** Vrai en developpement. */
|
|
18
|
+
readonly DEV: boolean
|
|
19
|
+
/** Vrai en production. */
|
|
20
|
+
readonly PROD: boolean
|
|
21
|
+
/** Prefixe des URL publiques. */
|
|
22
|
+
readonly BASE_URL: string
|
|
23
|
+
/** Variables du projet portant le prefixe configure. */
|
|
24
|
+
readonly [key: string]: string | boolean | undefined
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** API de rechargement a chaud exposee a chaque module. */
|
|
28
|
+
interface OdoroHot {
|
|
29
|
+
/** Donnees conservees d'une version de module a la suivante. */
|
|
30
|
+
readonly data: Record<string, unknown>
|
|
31
|
+
/** Declare que ce module sait se remplacer a chaud. */
|
|
32
|
+
accept(callback?: (module: unknown) => void): void
|
|
33
|
+
/** Enregistre un nettoyage a executer avant le remplacement. */
|
|
34
|
+
dispose(callback: (data: Record<string, unknown>) => void): void
|
|
35
|
+
/** Renonce au remplacement a chaud et recharge la page. */
|
|
36
|
+
invalidate(): void
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface ImportMeta {
|
|
40
|
+
/** Variables d'environnement du projet. */
|
|
41
|
+
readonly env: OdoroEnv
|
|
42
|
+
/** Present uniquement en developpement. */
|
|
43
|
+
hot?: OdoroHot
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare module '*.css' {
|
|
47
|
+
const content: string
|
|
48
|
+
export default content
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare module '*.svg' {
|
|
52
|
+
const source: string
|
|
53
|
+
export default source
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare module '*.png' {
|
|
57
|
+
const source: string
|
|
58
|
+
export default source
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare module '*.jpg' {
|
|
62
|
+
const source: string
|
|
63
|
+
export default source
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare module '*.jpeg' {
|
|
67
|
+
const source: string
|
|
68
|
+
export default source
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare module '*.webp' {
|
|
72
|
+
const source: string
|
|
73
|
+
export default source
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare module '*.avif' {
|
|
77
|
+
const source: string
|
|
78
|
+
export default source
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare module '*.woff2' {
|
|
82
|
+
const source: string
|
|
83
|
+
export default source
|
|
84
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { success, info, colors } from './chunk-JMEHF3KN.js';
|
|
3
|
+
import { existsSync, statSync, createReadStream } from 'fs';
|
|
4
|
+
import { createServer } from 'http';
|
|
5
|
+
import { normalize, join, extname } from 'path';
|
|
6
|
+
|
|
7
|
+
var MIME = {
|
|
8
|
+
".html": "text/html; charset=utf-8",
|
|
9
|
+
".js": "text/javascript; charset=utf-8",
|
|
10
|
+
".css": "text/css; charset=utf-8",
|
|
11
|
+
".json": "application/json; charset=utf-8",
|
|
12
|
+
".svg": "image/svg+xml",
|
|
13
|
+
".png": "image/png",
|
|
14
|
+
".jpg": "image/jpeg",
|
|
15
|
+
".webp": "image/webp",
|
|
16
|
+
".ico": "image/x-icon",
|
|
17
|
+
".woff2": "font/woff2",
|
|
18
|
+
".map": "application/json; charset=utf-8"
|
|
19
|
+
};
|
|
20
|
+
async function startPreviewServer(config, port = config.server.port + 1) {
|
|
21
|
+
if (!existsSync(config.outDir)) {
|
|
22
|
+
throw new Error(`[odoro] Rien a previsualiser : lancez "odoro build" d'abord.`);
|
|
23
|
+
}
|
|
24
|
+
const server = createServer((incoming, response) => {
|
|
25
|
+
const path = (incoming.url ?? "/").split("?")[0] ?? "/";
|
|
26
|
+
const relativePath = normalize(decodeURIComponent(path)).split(/[\\/]/).filter(Boolean).join("/");
|
|
27
|
+
const candidate = join(config.outDir, relativePath);
|
|
28
|
+
const file = existsSync(candidate) && statSync(candidate).isFile() ? candidate : join(config.outDir, "index.html");
|
|
29
|
+
if (!file.startsWith(config.outDir)) {
|
|
30
|
+
response.writeHead(403, { "Content-Type": "text/plain" });
|
|
31
|
+
response.end("Interdit");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const type = MIME[extname(file).toLowerCase()] ?? "application/octet-stream";
|
|
35
|
+
const immutable = relativePath.startsWith("assets/");
|
|
36
|
+
response.writeHead(200, {
|
|
37
|
+
"Content-Type": type,
|
|
38
|
+
"Cache-Control": immutable ? "public, max-age=31536000, immutable" : "no-cache"
|
|
39
|
+
});
|
|
40
|
+
createReadStream(file).pipe(response);
|
|
41
|
+
});
|
|
42
|
+
await new Promise((done, fail) => {
|
|
43
|
+
server.once("error", fail);
|
|
44
|
+
server.listen(port, config.server.host, done);
|
|
45
|
+
});
|
|
46
|
+
const url = `http://${config.server.host}:${port}${config.base}`;
|
|
47
|
+
success("previsualisation du build de production");
|
|
48
|
+
info(` ${colors.cyan(url)}`);
|
|
49
|
+
return {
|
|
50
|
+
url,
|
|
51
|
+
close: () => new Promise((done) => server.close(() => done()))
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export { startPreviewServer };
|