ecopages 0.1.89 → 0.1.90
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/bin/cli.js +67 -43
- package/core/integrations/ghtml/index.d.ts +1 -0
- package/core/integrations/ghtml/index.js +1 -0
- package/index.js +1 -1
- package/package.json +18 -14
package/bin/cli.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
+
|
|
2
3
|
import { Command } from 'commander';
|
|
3
4
|
import { existsSync, readFileSync } from 'node:fs';
|
|
4
5
|
import { spawn } from 'node:child_process';
|
|
6
|
+
import tiged from 'tiged';
|
|
5
7
|
import { Logger } from '@ecopages/logger';
|
|
6
8
|
|
|
7
9
|
const logger = new Logger('[ecopages:cli]');
|
|
@@ -11,6 +13,37 @@ const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url),
|
|
|
11
13
|
|
|
12
14
|
program.name('ecopages').description('Ecopages CLI utilities').version(pkg.version);
|
|
13
15
|
|
|
16
|
+
program
|
|
17
|
+
.command('init <dir>')
|
|
18
|
+
.description('Initialize a new project from a template')
|
|
19
|
+
.option('--template <name>', 'Template name from ecopages/examples/', 'starter-jsx')
|
|
20
|
+
.option('--repo <repo>', 'GitHub repo (user/repo)', 'ecopages/ecopages')
|
|
21
|
+
.action(async (dir, opts) => {
|
|
22
|
+
const { template, repo } = opts;
|
|
23
|
+
const targetDir = dir;
|
|
24
|
+
|
|
25
|
+
if (existsSync(targetDir)) {
|
|
26
|
+
logger.error(`Target directory already exists: ${targetDir}`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
logger.info(`Creating target directory '${targetDir}'...`);
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const emitter = tiged(`${repo}/examples/${template}`, {
|
|
34
|
+
disableCache: true,
|
|
35
|
+
force: true,
|
|
36
|
+
verbose: false,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
await emitter.clone(targetDir);
|
|
40
|
+
logger.info('Project initialized! Run `bun install && bun dev` to start.');
|
|
41
|
+
} catch (err) {
|
|
42
|
+
logger.error(`Failed to fetch template: ${err.message}`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
14
47
|
/**
|
|
15
48
|
* Build environment variables from CLI options
|
|
16
49
|
*/
|
|
@@ -75,32 +108,29 @@ const serverOptions = (cmd) =>
|
|
|
75
108
|
.option('-b, --base-url <url>', 'Override ECOPAGES_BASE_URL')
|
|
76
109
|
.option('-d, --debug', 'Enable debug logging (ECOPAGES_LOGGER_DEBUG=true)');
|
|
77
110
|
|
|
78
|
-
|
|
79
|
-
.command('dev')
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.action((entry, opts) => {
|
|
102
|
-
runBunCommand(['--dev'], { ...opts, hot: true }, entry);
|
|
103
|
-
});
|
|
111
|
+
serverOptions(
|
|
112
|
+
program.command('dev').description('Start the development server').argument('[entry]', 'Entry file', 'app.ts'),
|
|
113
|
+
).action((entry, opts) => {
|
|
114
|
+
runBunCommand(['--dev'], opts, entry);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
serverOptions(
|
|
118
|
+
program
|
|
119
|
+
.command('dev:watch')
|
|
120
|
+
.description('Start the development server with watch mode (restarts on file changes)')
|
|
121
|
+
.argument('[entry]', 'Entry file', 'app.ts'),
|
|
122
|
+
).action((entry, opts) => {
|
|
123
|
+
runBunCommand(['--dev'], { ...opts, watch: true }, entry);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
serverOptions(
|
|
127
|
+
program
|
|
128
|
+
.command('dev:hot')
|
|
129
|
+
.description('Start the development server with hot reload (HMR without restart)')
|
|
130
|
+
.argument('[entry]', 'Entry file', 'app.ts'),
|
|
131
|
+
).action((entry, opts) => {
|
|
132
|
+
runBunCommand(['--dev'], { ...opts, hot: true }, entry);
|
|
133
|
+
});
|
|
104
134
|
|
|
105
135
|
program
|
|
106
136
|
.command('build')
|
|
@@ -110,22 +140,16 @@ program
|
|
|
110
140
|
runBunCommand(['--build'], {}, entry);
|
|
111
141
|
});
|
|
112
142
|
|
|
113
|
-
|
|
114
|
-
.command('start')
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
.description('Preview the production build')
|
|
125
|
-
.argument('[entry]', 'Entry file', 'app.ts')
|
|
126
|
-
.tap(serverOptions)
|
|
127
|
-
.action((entry, opts) => {
|
|
128
|
-
runBunCommand(['--preview'], opts, entry);
|
|
129
|
-
});
|
|
143
|
+
serverOptions(
|
|
144
|
+
program.command('start').description('Start the production server').argument('[entry]', 'Entry file', 'app.ts'),
|
|
145
|
+
).action((entry, opts) => {
|
|
146
|
+
runBunCommand([], opts, entry);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
serverOptions(
|
|
150
|
+
program.command('preview').description('Preview the production build').argument('[entry]', 'Entry file', 'app.ts'),
|
|
151
|
+
).action((entry, opts) => {
|
|
152
|
+
runBunCommand(['--preview'], opts, entry);
|
|
153
|
+
});
|
|
130
154
|
|
|
131
155
|
program.parse();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ecopages/core/integrations/ghtml";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ecopages/core/integrations/ghtml";
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "0.1.
|
|
1
|
+
export const version = "0.1.90";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ecopages",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.90",
|
|
4
4
|
"description": "Universal entry point for Ecopages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -191,6 +191,10 @@
|
|
|
191
191
|
"import": "./core/errors/index.js",
|
|
192
192
|
"types": "./core/errors/index.d.ts"
|
|
193
193
|
},
|
|
194
|
+
"./core/integrations/ghtml": {
|
|
195
|
+
"import": "./core/integrations/ghtml/index.js",
|
|
196
|
+
"types": "./core/integrations/ghtml/index.d.ts"
|
|
197
|
+
},
|
|
194
198
|
"./bun-inline-css-plugin": {
|
|
195
199
|
"import": "./bun-inline-css-plugin/index.js",
|
|
196
200
|
"types": "./bun-inline-css-plugin/index.d.ts"
|
|
@@ -262,19 +266,19 @@
|
|
|
262
266
|
},
|
|
263
267
|
"dependencies": {
|
|
264
268
|
"commander": "^12.1.0",
|
|
265
|
-
"@ecopages/bun-postcss-loader": "npm:@jsr/ecopages__bun-postcss-loader@0.1.
|
|
266
|
-
"@ecopages/bun-mdx-kitajs-loader": "npm:@jsr/ecopages__bun-mdx-kitajs-loader@0.1.
|
|
267
|
-
"@ecopages/browser-router": "npm:@jsr/ecopages__browser-router@0.1.
|
|
268
|
-
"@ecopages/mdx": "npm:@jsr/ecopages__mdx@0.1.
|
|
269
|
-
"@ecopages/kitajs": "npm:@jsr/ecopages__kitajs@0.1.
|
|
270
|
-
"@ecopages/lit": "npm:@jsr/ecopages__lit@0.1.
|
|
271
|
-
"@ecopages/react": "npm:@jsr/ecopages__react@0.1.
|
|
272
|
-
"@ecopages/core": "npm:@jsr/ecopages__core@0.1.
|
|
273
|
-
"@ecopages/bun-inline-css-plugin": "npm:@jsr/ecopages__bun-inline-css-plugin@0.1.
|
|
274
|
-
"@ecopages/postcss-processor": "npm:@jsr/ecopages__postcss-processor@0.1.
|
|
275
|
-
"@ecopages/image-processor": "npm:@jsr/ecopages__image-processor@0.1.
|
|
276
|
-
"@ecopages/file-system": "npm:@jsr/ecopages__file-system@0.1.
|
|
277
|
-
"@ecopages/react-router": "npm:@jsr/ecopages__react-router@0.1.
|
|
269
|
+
"@ecopages/bun-postcss-loader": "npm:@jsr/ecopages__bun-postcss-loader@0.1.90",
|
|
270
|
+
"@ecopages/bun-mdx-kitajs-loader": "npm:@jsr/ecopages__bun-mdx-kitajs-loader@0.1.90",
|
|
271
|
+
"@ecopages/browser-router": "npm:@jsr/ecopages__browser-router@0.1.90",
|
|
272
|
+
"@ecopages/mdx": "npm:@jsr/ecopages__mdx@0.1.90",
|
|
273
|
+
"@ecopages/kitajs": "npm:@jsr/ecopages__kitajs@0.1.90",
|
|
274
|
+
"@ecopages/lit": "npm:@jsr/ecopages__lit@0.1.90",
|
|
275
|
+
"@ecopages/react": "npm:@jsr/ecopages__react@0.1.90",
|
|
276
|
+
"@ecopages/core": "npm:@jsr/ecopages__core@0.1.90",
|
|
277
|
+
"@ecopages/bun-inline-css-plugin": "npm:@jsr/ecopages__bun-inline-css-plugin@0.1.90",
|
|
278
|
+
"@ecopages/postcss-processor": "npm:@jsr/ecopages__postcss-processor@0.1.90",
|
|
279
|
+
"@ecopages/image-processor": "npm:@jsr/ecopages__image-processor@0.1.90",
|
|
280
|
+
"@ecopages/file-system": "npm:@jsr/ecopages__file-system@0.1.90",
|
|
281
|
+
"@ecopages/react-router": "npm:@jsr/ecopages__react-router@0.1.90"
|
|
278
282
|
},
|
|
279
283
|
"peerDependencies": {
|
|
280
284
|
"bun-types": "latest",
|