Comparing version 0.0.23 to 0.0.25
@@ -10,3 +10,3 @@ # Changelog | ||
## [v0.0.23](https://github.com/sw-yx/ssg/compare/v0.0.16...v0.0.23) - 2019-10-05 | ||
## [v0.0.25](https://github.com/sw-yx/ssg/compare/v0.0.16...v0.0.25) - 2019-10-05 | ||
@@ -13,0 +13,0 @@ ### Commits |
@@ -28,2 +28,4 @@ "use strict"; | ||
const utils_1 = require("./utils"); | ||
//@ts-ignore | ||
const enquirer_1 = require("enquirer"); | ||
const prog = sade_1.default('ssg').version(0.01); | ||
@@ -38,2 +40,29 @@ if (process.argv[2] === 'start') { | ||
prog | ||
.command('eject') | ||
.describe('Copy out fallback files') | ||
.action( | ||
// async (opts: {}) => { | ||
() => __awaiter(void 0, void 0, void 0, function* () { | ||
const prompt = new enquirer_1.MultiSelect({ | ||
name: 'files', | ||
message: 'Pick files to copy out', | ||
choices: [ | ||
{ name: 'client.js', value: 'src/client.js', hint: 'its client.js' }, | ||
{ name: 'server.js', value: 'src/server.js', hint: 'its server.js' }, | ||
{ name: 'service-worker.js', value: 'src/service-worker.js', hint: 'its service-worker.js' }, | ||
{ name: 'error.svelte', value: 'src/routes/_error.svelte', hint: 'its error.svelte' }, | ||
{ name: 'layout.svelte', value: 'src/routes/_layout.svelte', hint: 'its layout.svelte' }, | ||
{ name: 'template.html', value: 'src/template.html', hint: 'its template.html' } | ||
], | ||
result(names) { | ||
return this.map(names); // so we can actually get at the value | ||
} | ||
}); | ||
const { eject } = yield Promise.resolve().then(() => __importStar(require('./eject'))); | ||
prompt.run().then((selectedFiles) => { | ||
Object.entries(selectedFiles).forEach(eject); | ||
}) | ||
.catch(console.error); | ||
})); | ||
prog | ||
.command('dev') | ||
@@ -40,0 +69,0 @@ .describe('Start a development server') |
{ | ||
"name": "ssg", | ||
"version": "0.0.23", | ||
"version": "0.0.25", | ||
"license": "MIT", | ||
@@ -24,2 +24,3 @@ "bin": { | ||
"chokidar": "^3.0.2", | ||
"enquirer": "^2.3.2", | ||
"execa": "^2.0.4", | ||
@@ -26,0 +27,0 @@ "kleur": "^3.0.3", |
@@ -15,5 +15,15 @@ # Sapper Site Generator | ||
## Fallbacks | ||
`ssg` makes these Sapper files optional: | ||
- `src/client.js` | ||
- `src/server.js` | ||
- `src/service-workers.js` | ||
- `src/template.html` | ||
- `rollup.config.js` | ||
## What it expects | ||
1. you will have a `src/routes/data/[ssgData].json.js` file in your main Sapper project, that looks like this: | ||
1. if you need to get data, you will have a `src/routes/data/[ssgData].json.js` file in your main Sapper project, that looks like this: | ||
@@ -50,3 +60,3 @@ ```js | ||
2. You should have a `ssg.config.js` that exports a `createIndex` (run once) and `getDataSlice` (run each time) function that provides this data: | ||
2. If you need to send data, you should have a `ssg.config.js` that exports a `createIndex` (run once) and `getDataSlice` (run each time) function that provides this data: | ||
@@ -53,0 +63,0 @@ ```js |
36845
11
704
131
9
8
+ Addedenquirer@^2.3.2
+ Addedansi-colors@4.1.3(transitive)
+ Addedenquirer@2.4.1(transitive)