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

Commit 65b9457

Browse files
author
Je
committed
refactor: improve init command
1 parent de7c3bb commit 65b9457

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

cli/init.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@ import log from '../log.ts'
33
import { colors, ensureDir, ensureFile, fromStreamReader, path, Untar } from '../std.ts'
44
import util from '../util.ts'
55

6+
const gitignore = [
7+
'.DS_Store',
8+
'Thumbs.db',
9+
'.aleph/',
10+
'dist/',
11+
]
12+
const vscExtensions = {
13+
'recommendations': [
14+
'denoland.vscode-deno'
15+
]
16+
}
17+
const vscSettings = {
18+
'files.eol': '\n',
19+
'files.trimTrailingWhitespace': true,
20+
'files.exclude': {
21+
'**/.git': true,
22+
'**/.DS_Store': true,
23+
'**/Thumbs.db': true,
24+
'**/.aleph': true
25+
},
26+
'deno.enable': true,
27+
'deno.unstable': true,
28+
'deno.import_map': './import_map.json',
29+
'deno.import_intellisense_autodiscovery': true,
30+
'deno.import_intellisense_origins': {
31+
'https://deno.land': true,
32+
'https://esm.sh': true
33+
}
34+
}
35+
636
export const helpMessage = `
737
Usage:
838
aleph init <dir> [...options]
@@ -38,6 +68,11 @@ export default async function (appDir: string, options: Record<string, string |
3868
}
3969
}
4070

71+
await ensureDir(path.join(appDir, '.vscode'))
72+
await Deno.writeTextFile(path.join(appDir, '.vscode', 'extensions.json'), JSON.stringify(vscExtensions, undefined, 4))
73+
await Deno.writeTextFile(path.join(appDir, '.vscode', 'settings.json'), JSON.stringify(vscSettings, undefined, 4))
74+
await Deno.writeTextFile(path.join(appDir, '.gitignore'), gitignore.join('\n'))
75+
4176
log.info('Done')
4277
log.info('---')
4378
log.info(colors.dim('Aleph App is ready to Go.'))

0 commit comments

Comments
 (0)