odoro 1.0.4 → 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-5KU4PW5P.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-LVNBZOGV.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);
@@ -148,8 +148,8 @@ var VERSIONS_FAMILLE = {
148
148
  "@odoro-cli/icons": "1.0.2",
149
149
  "@odoro-cli/libs": "1.0.2",
150
150
  "@odoro-cli/server": "1.0.2",
151
- "create-odoro": "1.0.4",
152
- "odoro": "1.0.4"
151
+ "create-odoro": "1.0.5",
152
+ "odoro": "1.0.5"
153
153
  };
154
154
 
155
155
  // src/scaffold/scaffold.ts
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.4",
5
+ version: "1.0.5",
6
6
  type: "module",
7
7
  license: "UNLICENSED",
8
8
  author: "BouBouw",
@@ -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.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "author": "BouBouw",
@@ -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';