Skip to content

Commit

Permalink
docs: ensure that the CLI package has a README on NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Mar 22, 2019
1 parent 7af36d5 commit 00b87a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion packages/api/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions tools/sync-readmes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, '..');
Expand Down Expand Up @@ -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 }),
},
]);
}
Expand Down

0 comments on commit 00b87a0

Please sign in to comment.