odoro 1.0.3 → 1.0.5

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.
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ export { buildProject, reportBuild } from './chunk-2PTB6WTD.js';
3
+ import './chunk-7B4AJDBR.js';
4
+ import './chunk-JMEHF3KN.js';
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { extractEntries, applyAlias, isBareSpecifier, fournisseurDe } from './chunk-2EE5QUCW.js';
2
+ import { extractEntries, applyAlias, isBareSpecifier, fournisseurDe } from './chunk-7B4AJDBR.js';
3
3
  import { info, colors, size, success, duration } from './chunk-JMEHF3KN.js';
4
4
  import { existsSync } from 'fs';
5
5
  import { readFile, rm, mkdir, writeFile, cp, stat } from 'fs/promises';
@@ -412,6 +412,12 @@ async function transformModule(file, config, env) {
412
412
  }
413
413
  return { code, dependencies: [...dependencies] };
414
414
  }
415
+ function feuilleDemandee(entetes, url) {
416
+ if (url.includes("?direct")) return true;
417
+ if (entetes["sec-fetch-dest"] === "style") return true;
418
+ const accepte = entetes["accept"];
419
+ return typeof accepte === "string" && accepte.includes("text/css");
420
+ }
415
421
  function wrapStyle(url, css) {
416
422
  return `const id = ${JSON.stringify(`odoro-style:${url}`)}
417
423
  const css = ${JSON.stringify(css)}
@@ -1111,7 +1117,7 @@ async function startDevServer(config) {
1111
1117
  const file = urlToFile(path, config.root);
1112
1118
  if (existsSync(file) && statSync(file).isFile()) {
1113
1119
  if (hasExtension(path, STYLE_EXTENSIONS)) {
1114
- await serveStyle(response, file, url2.includes("?direct"));
1120
+ await serveStyle(response, file, feuilleDemandee(incoming.headers, url2));
1115
1121
  return;
1116
1122
  }
1117
1123
  if (hasExtension(path, ASSET_EXTENSIONS)) {
@@ -29,7 +29,13 @@ async function startPreviewServer(config, port = config.server.port + 1) {
29
29
  const relativePath = normalize(decodeURIComponent(path)).split(/[\\/]/).filter(Boolean).join("/");
30
30
  const candidate = join(config.outDir, relativePath);
31
31
  const dansLeDossier = ["index.html", "index.md"].map((nom) => join(candidate, nom)).find((chemin) => existsSync(chemin) && statSync(chemin).isFile());
32
- const file = existsSync(candidate) && statSync(candidate).isFile() ? candidate : dansLeDossier ?? join(config.outDir, "index.html");
32
+ const existant = existsSync(candidate) && statSync(candidate).isFile() ? candidate : dansLeDossier;
33
+ if (existant === void 0 && extname(relativePath) !== "") {
34
+ response.writeHead(404, { "Content-Type": "text/plain; charset=utf-8" });
35
+ response.end(`Introuvable : /${relativePath}`);
36
+ return;
37
+ }
38
+ const file = existant ?? join(config.outDir, "index.html");
33
39
  if (!file.startsWith(config.outDir)) {
34
40
  response.writeHead(403, { "Content-Type": "text/plain" });
35
41
  response.end("Interdit");
package/dist/cli.js CHANGED
@@ -131,7 +131,7 @@ function rootFrom(flags, positional) {
131
131
  async function run(argv) {
132
132
  const { command, positional, flags } = parseArgs(argv);
133
133
  if (flags["version"] === true) {
134
- const manifest = await import('./package-2JOBLFXE.js');
134
+ const manifest = await import('./package-S7VW4LMB.js');
135
135
  console.log(manifest.default.version);
136
136
  return 0;
137
137
  }
@@ -142,7 +142,7 @@ async function run(argv) {
142
142
  switch (command) {
143
143
  case "create":
144
144
  case "new": {
145
- const { createCommand } = await import('./create-VUSKHXBN.js');
145
+ const { createCommand } = await import('./create-DN5UPR2T.js');
146
146
  const options = {};
147
147
  if (positional[0] !== void 0) options.name = positional[0];
148
148
  if (typeof flags["template"] === "string") options.template = flags["template"];
@@ -156,20 +156,20 @@ async function run(argv) {
156
156
  return createCommand(options);
157
157
  }
158
158
  case "dev": {
159
- const { startDevServer } = await import('./server-DXOQAPVX.js');
159
+ const { startDevServer } = await import('./server-ZGPOWXNK.js');
160
160
  const config = await loadConfig(rootFrom(flags, positional), overridesFrom(flags));
161
161
  await startDevServer(config);
162
162
  return new Promise(() => void 0);
163
163
  }
164
164
  case "build": {
165
- const { buildProject, reportBuild } = await import('./build-KI7IEVRJ.js');
165
+ const { buildProject, reportBuild } = await import('./build-4VLCDMRV.js');
166
166
  const config = await loadConfig(rootFrom(flags, positional), overridesFrom(flags));
167
167
  const output = await buildProject(config);
168
168
  reportBuild(output, process.cwd());
169
169
  return 0;
170
170
  }
171
171
  case "preview": {
172
- const { startPreviewServer } = await import('./preview-3K46Y23N.js');
172
+ const { startPreviewServer } = await import('./preview-GFGY6NS7.js');
173
173
  const config = await loadConfig(rootFrom(flags, positional), overridesFrom(flags));
174
174
  const port = numberFlag(flags, "port");
175
175
  await startPreviewServer(config, port);
@@ -142,6 +142,16 @@ function availableTemplates(root = templatesRoot()) {
142
142
  return readdirSync(root).filter((entry) => statSync(resolve(root, entry)).isDirectory()).sort();
143
143
  }
144
144
 
145
+ // src/scaffold/versions-famille.generated.ts
146
+ var VERSIONS_FAMILLE = {
147
+ "@odoro-cli/engine": "1.0.2",
148
+ "@odoro-cli/icons": "1.0.2",
149
+ "@odoro-cli/libs": "1.0.2",
150
+ "@odoro-cli/server": "1.0.2",
151
+ "create-odoro": "1.0.5",
152
+ "odoro": "1.0.5"
153
+ };
154
+
145
155
  // src/scaffold/scaffold.ts
146
156
  var DOSSIER_VARIANTES = "_variantes";
147
157
  var PAQUETS_OPTIONNELS = ["@odoro-cli/libs", "@odoro-cli/icons", "@odoro-cli/engine"];
@@ -173,6 +183,12 @@ async function copyDirectory(from, to, written, prefix = "") {
173
183
  function isOdoroPackage(name) {
174
184
  return name === "odoro" || name.startsWith("@odoro-cli/");
175
185
  }
186
+ function versionDemandee(nom, versionCli2) {
187
+ if (versionCli2 === "latest") return "latest";
188
+ if (nom === "odoro") return `^${versionCli2}`;
189
+ const relevee = VERSIONS_FAMILLE[nom];
190
+ return relevee === void 0 ? "latest" : `^${relevee}`;
191
+ }
176
192
  function alignOdoroVersions(manifest, version) {
177
193
  const aligned = { ...manifest };
178
194
  for (const field of ["dependencies", "devDependencies", "peerDependencies"]) {
@@ -180,7 +196,7 @@ function alignOdoroVersions(manifest, version) {
180
196
  if (typeof deps !== "object" || deps === null) continue;
181
197
  const next = {};
182
198
  for (const [name, range] of Object.entries(deps)) {
183
- next[name] = isOdoroPackage(name) ? version === "latest" ? "latest" : `^${version}` : range;
199
+ next[name] = isOdoroPackage(name) ? versionDemandee(name, version) : range;
184
200
  }
185
201
  aligned[field] = next;
186
202
  }
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- export { startPreviewServer } from './chunk-34ES2ICQ.js';
2
+ export { startPreviewServer } from './chunk-MQHNERM5.js';
3
3
  export { defineConfig, loadConfig } from './chunk-DL3NPC4H.js';
4
4
  import './chunk-T6RLHSCW.js';
5
- export { buildProject, reportBuild } from './chunk-FJYUQALD.js';
6
- export { ModuleGraph, depFileName, detectSelfAccepting, optimizeDeps, scanDependencies, startDevServer } from './chunk-2EE5QUCW.js';
5
+ export { buildProject, reportBuild } from './chunk-2PTB6WTD.js';
6
+ export { ModuleGraph, depFileName, detectSelfAccepting, optimizeDeps, scanDependencies, startDevServer } from './chunk-7B4AJDBR.js';
7
7
  import './chunk-JMEHF3KN.js';
@@ -2,7 +2,7 @@
2
2
  // package.json
3
3
  var package_default = {
4
4
  name: "odoro",
5
- version: "1.0.3",
5
+ version: "1.0.5",
6
6
  type: "module",
7
7
  license: "UNLICENSED",
8
8
  author: "BouBouw",
@@ -37,11 +37,12 @@ var package_default = {
37
37
  }
38
38
  },
39
39
  scripts: {
40
- build: "tsup",
40
+ build: "node scripts/versions-famille.mjs && tsup",
41
41
  dev: "tsup --watch",
42
42
  test: "vitest run",
43
- typecheck: "tsc --noEmit",
44
- prepublishOnly: "pnpm run build"
43
+ typecheck: "node scripts/versions-famille.mjs && tsc --noEmit",
44
+ prepublishOnly: "pnpm run build",
45
+ "versions:famille": "node scripts/versions-famille.mjs"
45
46
  },
46
47
  dependencies: {
47
48
  "@babel/core": "^7.29.7",
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export { startPreviewServer } from './chunk-MQHNERM5.js';
3
+ import './chunk-JMEHF3KN.js';
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export { extractEntries, injectClient, startDevServer } from './chunk-2EE5QUCW.js';
2
+ export { extractEntries, injectClient, startDevServer } from './chunk-7B4AJDBR.js';
3
3
  import './chunk-JMEHF3KN.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "odoro",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "author": "BouBouw",
@@ -59,9 +59,10 @@
59
59
  "url": "https://github.com/ODORO-CLI/OdoroKit/issues"
60
60
  },
61
61
  "scripts": {
62
- "build": "tsup",
62
+ "build": "node scripts/versions-famille.mjs && tsup",
63
63
  "dev": "tsup --watch",
64
64
  "test": "vitest run",
65
- "typecheck": "tsc --noEmit"
65
+ "typecheck": "node scripts/versions-famille.mjs && tsc --noEmit",
66
+ "versions:famille": "node scripts/versions-famille.mjs"
66
67
  }
67
68
  }
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- export { buildProject, reportBuild } from './chunk-FJYUQALD.js';
3
- import './chunk-2EE5QUCW.js';
4
- import './chunk-JMEHF3KN.js';
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export { startPreviewServer } from './chunk-34ES2ICQ.js';
3
- import './chunk-JMEHF3KN.js';