ecopages 0.2.0-rc.10 → 0.2.0-rc.11

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The official CLI for the Ecopages framework.
4
4
 
5
- It provides scaffolding and development commands to streamline your workflow. It prefers Bun when available, falls back to Node otherwise, and applies runtime-specific launch behavior for each engine.
5
+ It provides scaffolding and development commands to streamline your workflow. It runs your app on Bun when you launch it through Bun, on Node otherwise, and applies runtime-specific launch behavior for each engine.
6
6
 
7
7
  ## Quick Start
8
8
 
@@ -62,7 +62,7 @@ Server and build commands accept the following options. They automatically map t
62
62
 
63
63
  ### Runtime Detection
64
64
 
65
- The CLI prefers Bun when the package manager already indicates Bun, when the `Bun` global is available, or when you force it with `--runtime bun`. Otherwise it falls back to Node.
65
+ The CLI runs your app on Bun when you launch the command through Bun (`bun dev`, `bun run dev`, `bunx ecopages …`) or pass `--runtime bun`. Any other launcher (`pnpm`, `npm`, `npx`, `node`) runs it on Node.
66
66
 
67
67
  You can explicitly force the engine using the `--runtime` flag:
68
68
 
@@ -58,6 +58,16 @@ export function buildLaunchEnv(options) {
58
58
  };
59
59
  }
60
60
 
61
+ /**
62
+ * Picks the runtime for the app process.
63
+ *
64
+ * @remarks
65
+ * Bun runs the app when the command was launched through Bun (`bun dev`,
66
+ * `bun run dev`, `bunx ecopages`), when the CLI itself runs on Bun, or with
67
+ * `--runtime bun`. Every other launcher gets Node. The user-agent check is
68
+ * needed because Bun honours the CLI's `node` shebang, so the CLI process is
69
+ * Node even when Bun launched it.
70
+ */
61
71
  export function detectRuntime(options = {}) {
62
72
  if (options.runtime === 'bun' || options.runtime === 'node') {
63
73
  return options.runtime;
@@ -65,11 +75,7 @@ export function detectRuntime(options = {}) {
65
75
 
66
76
  const userAgent = process.env.npm_config_user_agent || '';
67
77
 
68
- if (userAgent.startsWith('bun/')) {
69
- return 'bun';
70
- }
71
-
72
- if (typeof Bun !== 'undefined') {
78
+ if (userAgent.startsWith('bun/') || typeof Bun !== 'undefined') {
73
79
  return 'bun';
74
80
  }
75
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecopages",
3
- "version": "0.2.0-rc.10",
3
+ "version": "0.2.0-rc.11",
4
4
  "description": "CLI utilities for Ecopages",
5
5
  "type": "module",
6
6
  "engines": {
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@clack/prompts": "^1.7.0",
39
- "@ecopages/core": "0.2.0-rc.10",
39
+ "@ecopages/core": "0.2.0-rc.11",
40
40
  "@ecopages/logger": "^0.2.3",
41
41
  "giget": "^2.0.0",
42
42
  "tsx": "^4.22.3"