-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[RFC] refactor(docs): move apidocs to /docs
#1207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2f1bab8 to
6dd574f
Compare
fb40a51 to
18d281a
Compare
| if (!utils.isOptionSet(apidocsOpts, '--out', '-o')) { | ||
| args.push('-o', 'api-docs'); | ||
| let out = 'api-docs'; | ||
| if (process.env.LERNA_ROOT_PATH) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this dependent on #1189 landing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1189 is landed. I rebased the PR to master.
| if (!utils.isOptionSet(apidocsOpts, '--out', '-o')) { | ||
| args.push('-o', 'api-docs'); | ||
| let out = 'api-docs'; | ||
| if (process.env.LERNA_ROOT_PATH) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remind me: which code/script is setting LERNA_ROOT_PATH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1189
| "build:apidocs": "lb-apidocs", | ||
| "clean": "lb-clean loopback-openapi-spec-builder*.tgz dist package api-docs", | ||
| "prepublishOnly": "npm run build && npm run build:apidocs", | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please remove these empty lines? They will be eventually removed by npm anyways.
|
I am not able to fully consider ramifications of this change and whether it may break anything. If we agree this is the direction we want to take, then the code changes look mostly good to me - see my comments above. |
18d281a to
2c7a030
Compare
de24cf2 to
6f83714
Compare
97e662c to
eaf5a3e
Compare
/docs
| "build:apidocs": "lb-apidocs", | ||
| "clean": "lb-clean *example-hello-world*.tgz dist package api-docs", | ||
| "prepublishOnly": "npm run build && npm run build:apidocs", | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: no new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| "build:apidocs": "lb-apidocs", | ||
| "clean": "lb-clean loopback-openapi-v3-types*.tgz dist package api-docs", | ||
| "prepublishOnly": "npm run build && npm run build:apidocs", | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: no new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
3bdfdc8 to
4e6c355
Compare
4e6c355 to
9e415ca
Compare
package.json
Outdated
| "pretest": "npm run clean && npm run build", | ||
| "test": "node packages/build/bin/run-nyc npm run mocha --scripts-prepend-node-path", | ||
| "mocha": "node packages/build/bin/run-mocha \"packages/*/DIST/test/**/*.js\" \"examples/*/DIST/test/**/*.js\" \"packages/cli/test/*.js\"", | ||
| "mocha": "node packages/build/bin/run-mocha \"packages/*/DIST/test/**/*.js\" \"examples/*/DIST/test/**/*.js\" \"packages/cli/test/*.js\" \"packages/build/test/integration/*.js\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind making this more future-proof by using \"packages/build/test/*/*.js\"? I.e. allow any test category, not only integration. Unless I am missing something and the wildcard won't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to exclude packages/build/test/fixtures. We can move fixtures to be inside integration.
9e415ca to
0190dd3
Compare
Now the apidocs will be generated for the whole monorepo
0190dd3 to
1ae68fa
Compare
This PR changes how api docs are generated and published.
docs/api-docs/<pkg>@loopback/docsapi-docsfrom each published packages to reduce bundle sizes (node_modules after production build is too large #1134)We'll adjust apidocs.loopback.io site to use
@loopback/docsfor LoopBack 4 api docs.Checklist
npm testpasses on your machinepackages/cliwere updatedpackages/example-*were updated