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

Commit 0d24456

Browse files
chore: resolve conflicts
2 parents c942808 + 0456c9d commit 0d24456

File tree

7 files changed

+30
-26
lines changed

7 files changed

+30
-26
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default function App() {
3030
```
3131

3232
### Features
33+
3334
- Zero Config
3435
- Typescript in Deno
3536
- High Performance Comilper
@@ -43,11 +44,13 @@ export default function App() {
4344
- SSR/SSG
4445

4546
### Installation
47+
4648
```bash
47-
deno install -A -f -n aleph https://deno.land/x/[email protected].26/cli.ts
49+
deno install -A -f -n aleph https://deno.land/x/[email protected].28/cli.ts
4850
```
4951

5052
### Usage
53+
5154
```bash
5255
# create a new app
5356
aleph init hello
@@ -67,7 +70,9 @@ aleph -h
6770
```
6871

6972
### Documentation
73+
7074
Please visit https://alephjs.org/docs to view the documentation.
7175

7276
### Contributing
77+
7378
Please read the [contributing.md](CONTRIBUTING.md).

cli/dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export default async function (appDir: string, options: Record<string, string |
2121
log.error(`invalid port '${options.port || options.p}'`)
2222
Deno.exit(1)
2323
}
24-
start(appDir, port, true, Boolean(options.r || options.reload))
24+
start(appDir, 'localhost', port, true, Boolean(options.r || options.reload))
2525
}

cli/start.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import log from '../server/log.ts'
2-
import { start } from '../server/server.ts'
32

43
export const helpMessage = `
54
Usage:
@@ -9,17 +8,20 @@ Usage:
98
if the <dir> is empty, the current directory will be used.
109
1110
Options:
11+
-hn, --hostname The address at which the server is to be started.
1212
-p, --port A port number to start the aleph.js app, default is 8080
1313
-L, --log-level Set log level [possible values: debug, info]
1414
-r, --reload Reload source code cache
1515
-h, --help Prints help message
1616
`
1717

1818
export default async function (appDir: string, options: Record<string, string | boolean>) {
19+
const { start } = await import('../server/server.ts')
20+
const host = String(options.hn || options.hostname || 'localhost')
1921
const port = parseInt(String(options.p || options.port || '8080'))
2022
if (isNaN(port) || port <= 0 || !Number.isInteger(port)) {
2123
log.error(`invalid port '${options.port || options.p}'`)
2224
Deno.exit(1)
2325
}
24-
start(appDir, port, false, Boolean(options.r || options.reload))
26+
start(appDir, host, port, false, Boolean(options.r || options.reload))
2527
}

egg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aleph",
3-
"version": "0.2.26",
3+
"version": "0.2.28",
44
"description": "The React Framework in Deno.",
55
"homepage": "https://alephjs.org",
66
"repository": "https://github.com/alephjs/aleph.js",

plugins/sass.ts

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,9 @@
11
import { Options, renderSync } from 'https://esm.sh/[email protected]'
22

3-
const defaultPlugin = {
3+
const pluginFactory = (opts: Options = {}) => ({
44
name: 'sass-loader',
55
test: /.(sass|scss)$/,
66
acceptHMR: true,
7-
transform(content: Uint8Array, path: string) {
8-
const ret = renderSync({
9-
file: path,
10-
data: (new TextDecoder).decode(content),
11-
sourceMap: true,
12-
indentedSyntax: path.endsWith('.sass')
13-
})
14-
return {
15-
code: (new TextDecoder).decode(ret.css),
16-
map: ret.map ? (new TextDecoder).decode(ret.map) : undefined,
17-
loader: 'css'
18-
}
19-
}
20-
}
21-
22-
const pluginFactory = (opts: Options) => ({
23-
...defaultPlugin,
247
transform(content: Uint8Array, path: string) {
258
const ret = renderSync({
269
indentedSyntax: path.endsWith('.sass'),
@@ -37,6 +20,8 @@ const pluginFactory = (opts: Options) => ({
3720
}
3821
})
3922

23+
const defaultPlugin = pluginFactory()
24+
4025
pluginFactory.displayName = defaultPlugin.name
4126
pluginFactory.test = defaultPlugin.test
4227
pluginFactory.acceptHMR = defaultPlugin.acceptHMR

server/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import { getContentType } from './mime.ts'
77
import { Project } from './project.ts'
88
import { createHtml, existsFileSync } from './util.ts'
99

10-
export async function start(appDir: string, port: number, isDev = false, reload = false) {
10+
export async function start(appDir: string, hostname: string, port: number, isDev = false, reload = false) {
1111
const project = new Project(appDir, isDev ? 'development' : 'production', reload)
1212
await project.ready
1313

1414
while (true) {
1515
try {
16-
const s = serve({ port })
17-
log.info(`Server ready on http://localhost:${port}`)
16+
const s = serve({ hostname, port })
17+
log.info(`Server ready on http://${hostname}:${port}`)
1818
for await (const req of s) {
1919
const url = new URL('http://localhost/' + req.url)
2020
const pathname = util.cleanPath(url.pathname)

std.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export * as bytes from 'https://deno.land/[email protected]/bytes/mod.ts'
2+
export { Untar } from 'https://deno.land/[email protected]/archive/tar.ts'
3+
export * as colors from 'https://deno.land/[email protected]/fmt/colors.ts'
4+
export { ensureDir } from 'https://deno.land/[email protected]/fs/ensure_dir.ts'
5+
export { walk } from 'https://deno.land/[email protected]/fs/walk.ts'
6+
export { Sha1 } from 'https://deno.land/[email protected]/hash/sha1.ts'
7+
export { listenAndServe, serve, ServerRequest } from 'https://deno.land/[email protected]/http/server.ts'
8+
export type { Response } from 'https://deno.land/[email protected]/http/server.ts'
9+
export { fromStreamReader } from 'https://deno.land/[email protected]/io/mod.ts'
10+
export * as path from 'https://deno.land/[email protected]/path/mod.ts'
11+
export * as ws from 'https://deno.land/[email protected]/ws/mod.ts'
12+

0 commit comments

Comments
 (0)