Skip to content

Commit 82dd296

Browse files
committed
Revert to .mjs
1 parent 428328e commit 82dd296

File tree

3 files changed

+31
-31
lines changed

3 files changed

+31
-31
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This combo-patcher uses [zx](https://github.com/google/zx), so make sure that's
2020
run:
2121

2222
```
23-
$ zx --install https://raw.githubusercontent.com/zerodevx/sveltekit-starter/main/index.js <app-name> [flags]
23+
$ zx --install https://raw.githubusercontent.com/zerodevx/sveltekit-starter/main/index.mjs <app-name> [flags]
2424
```
2525

2626
This generates the starter based on the last known SvelteKit decisions, then saves the output to

index.js renamed to index.mjs

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -107,31 +107,32 @@ export async function addIconify({ name }) {
107107
)
108108
}
109109

110-
void (async function () {
111-
const opts = {
112-
name: argv._[0],
113-
template: argv.t || 'skeleton'
114-
}
115-
if (!opts.name) {
116-
echo`Error: please specify the app name`
117-
process.exit(1)
118-
}
119-
if ((await fs.pathExists(opts.name)) && !argv.o) {
120-
echo`Error: path ${path.sep}${opts.name} already exists, specify -o flag to overwrite`
121-
process.exit(1)
122-
}
110+
const opts = {
111+
name: argv._[0],
112+
template: argv.t || 'skeleton'
113+
}
114+
if (!opts.name) {
115+
echo`Error: please specify the app name`
116+
process.exit(1)
117+
}
118+
if ((await fs.pathExists(opts.name)) && !argv.o) {
119+
echo`Error: path ${path.sep}${opts.name} already exists, specify -o flag to overwrite`
120+
process.exit(1)
121+
}
122+
123+
await addBaseTemplate(opts).then(() => echo`- created ${opts.template} template`)
124+
await addTailwindcss(opts).then(() => echo`- added tailwindcss`)
125+
await addPrettier(opts).then(() => echo`- patched prettier config`)
126+
await addEslint(opts).then(() => echo`- patched eslint config`)
127+
await addAdapterStatic(opts).then(() => echo`- added adapter-static`)
128+
await addFontsource(opts).then(() => echo`- added fontsource`)
129+
await addIconify(opts).then(() => echo`- added iconify`)
123130

124-
await addBaseTemplate(opts).then(() => echo`- created ${opts.template} template`)
125-
await addTailwindcss(opts).then(() => echo`- added tailwindcss`)
126-
await addPrettier(opts).then(() => echo`- patched prettier config`)
127-
await addEslint(opts).then(() => echo`- patched eslint config`)
128-
await addAdapterStatic(opts).then(() => echo`- added adapter-static`)
129-
await addFontsource(opts).then(() => echo`- added fontsource`)
130-
await addIconify(opts).then(() => echo`- added iconify`)
131+
echo`
132+
All done! Complete the setup with:
131133
132-
echo`\nAll done! Complete the setup with:\n`
133-
echo`$ cd ${opts.name}`
134-
echo`$ npx npm-check-updates -u`
135-
echo`$ npm i`
136-
echo`$ npm run format`
137-
})()
134+
$ cd ${opts.name}
135+
$ npx npm-check-updates -u
136+
$ npm i
137+
$ npm run format
138+
`

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
22
"name": "@zerodevx/sveltekit-starter",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "Opinionated starter template for SvelteKit",
55
"author": "Jason Lee <[email protected]>",
66
"scripts": {
7-
"start": "zx index.js temp -o",
7+
"start": "zx index.mjs temp -o",
88
"format": "prettier --ignore-path .gitignore --write ."
99
},
1010
"devDependencies": {
1111
"create-svelte": "^3.1.0",
1212
"prettier": "^2.8.4"
1313
},
14-
"type": "module",
15-
"main": "index.js",
14+
"main": "index.mjs",
1615
"license": "ISC",
1716
"repository": "github:zerodevx/sveltekit-starter"
1817
}

0 commit comments

Comments
 (0)