Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 42d39c2

Browse files
author
Je
committed
refactor: remove fetch command
1 parent 9f410fe commit 42d39c2

File tree

6 files changed

+31
-26
lines changed

6 files changed

+31
-26
lines changed

cli.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { listenAndServe, path, ServerRequest, walk } from './std.ts'
55
import util, { existsDirSync, existsFileSync } from './util.ts'
66
import { version } from './version.ts'
77

8-
const commands = ['init', 'fetch', 'dev', 'start', 'build', 'upgrade']
8+
const commands = ['init', 'dev', 'start', 'build', 'upgrade']
99
const helpMessage = `Aleph.js v${version}
1010
The React Framework in deno.
1111
@@ -167,11 +167,15 @@ async function main() {
167167
}
168168

169169
import(`./cli/${command}.ts`).then(({ default: cmd }) => {
170-
const appDir = path.resolve(args[0] || '.')
171-
if (command !== 'init' && !existsDirSync(appDir)) {
172-
log.fatal('No such directory:', appDir)
170+
if (command === 'upgrade') {
171+
cmd()
172+
} else {
173+
const appDir = path.resolve(args[0] || '.')
174+
if (command !== 'init' && !existsDirSync(appDir)) {
175+
log.fatal('No such directory:', appDir)
176+
}
177+
cmd(appDir, argOptions)
173178
}
174-
cmd(appDir, argOptions)
175179
})
176180
}
177181

cli/build.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Usage:
99
if the <dir> is empty, the current directory will be used.
1010
1111
Options:
12-
-h, --help Prints help message
12+
-r, --reload Reload remote deps
13+
-h, --help Prints help message
1314
`
1415

1516
export default async function (appDir: string, options: Record<string, string | boolean>) {

cli/dev.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ Usage:
99
if the <dir> is empty, the current directory will be used.
1010
1111
Options:
12-
-p, --port A port number to start the aleph app, default is 8080
13-
-l, --log Sets log level ['debug', 'info', 'warn', 'error', 'fatal']
14-
-h, --help Prints help message
12+
-p, --port A port number to start the aleph app, default is 8080
13+
-r, --reload Reload remote deps
14+
-l, --log Sets log level ['debug', 'info', 'warn', 'error', 'fatal']
15+
-h, --help Prints help message
1516
`
1617

1718
export default function (appDir: string, options: { port?: string, p?: string }) {

cli/fetch.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

cli/start.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ Usage:
99
if the <dir> is empty, the current directory will be used.
1010
1111
Options:
12-
-p, --port A port number to start the aleph app, default is 8080
13-
-h, --help Prints help message
12+
-p, --port A port number to start the aleph app, default is 8080
13+
-r, --reload Reload remote deps
14+
-h, --help Prints help message
1415
`
1516

1617
export default function (appDir: string, options: Record<string, string | boolean>) {

cli/upgrade.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export const helpMessage = `Upgrade the aleph command.
2+
3+
Usage:
4+
aleph upgrade
5+
6+
Options:
7+
-h, --help Prints help message
8+
`
9+
10+
export default async function () {
11+
// todo: upgrade
12+
Deno.exit(0)
13+
}

0 commit comments

Comments
 (0)