Skip to content
Permalink
Browse files

docs: ensure that the CLI package has a README on NPM

  • Loading branch information
MarshallOfSound committed Mar 21, 2019
1 parent 7af36d5 commit 00b87a0e79e2286305a2925d2a2bd8f33e980b3e
Showing with 13 additions and 3 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 packages/api/core/README.md
  3. +11 −2 tools/sync-readmes.ts
@@ -15,6 +15,7 @@ packages/utils/types/index.d.ts
packages/maker/**/README.md
packages/publisher/**/README.md
packages/plugin/**/README.md
packages/api/cli/README.md
!packages/**/base/README.md
!/README.md
packages/*/*/index.ts
@@ -12,7 +12,7 @@ import { api } from '@electron-forge/core'
api.package(__dirname);
```

The named export `api` has it's methods documented over at [ForgeAPI](classes/forgeapi.html).
The named export `api` has it's methods documented over at [ForgeAPI](https://js.electronforge.io/api/core/classes/forgeapi).
All the methods are async and expose the core forge methods, please note that all
user-side configuration is still done through your forge config file or the "config.forge"
section of your package.json. This API simply let's you call the methods in
@@ -11,6 +11,9 @@ const workspaceMappings: { [space: string]: { [packageName: string]: string | un
},
publisher: {},
plugin: {},
api: {
core: 'does-not-exist-plz-no-readme',
},
};

const BASE_DIR = path.resolve(__dirname, '..');
@@ -61,14 +64,20 @@ function sync(): Listr {
([workspace, workspaceDir, packageKey, packageName]) => ({
title: `Fetching README for ${path.basename(workspaceDir)}/${packageKey}`,
task: async () => {
const r = await fetch(`${DOCS_BASE}/${workspace}s/${packageKey}.md`);
let rp: ReturnType<typeof fetch>;
if (workspace !== 'api') {
rp = fetch(`${DOCS_BASE}/${workspace}s/${packageKey}.md`);
} else {
rp = fetch(`${DOCS_BASE}/${packageKey}.md`);
}
const r = await rp;
if (r.status !== 200) return;

const md = sanitize(await r.text());
await fs.writeFile(path.resolve(workspaceDir, packageName, 'README.md'), md);
},
}),
), { concurrent: 5 }),
), { concurrent: 3 }),
},
]);
}

0 comments on commit 00b87a0

Please sign in to comment.
You can’t perform that action at this time.