Skip to content

Commit

Permalink
chore: manage docs as a workspace
Browse files Browse the repository at this point in the history
- Add `./docs` as a workspace
- Reinstate `./docs/package.json` to manage docs deps
- Ignore `docs/content` markdown source folder from published tarball
- Tweaked `make docs` to use `npm run` to run docs build step
- Tweaked "bundle and gitignore" script to ignore symlinks in nm folder
- Removed outdated `package.json` comment

Relates to: npm/statusboard#362

PR-URL: #3342
Credit: @ruyadorno
Close: #3342
Reviewed-by: @wraithgar
  • Loading branch information
ruyadorno authored and wraithgar committed Jun 1, 2021
1 parent 73633e5 commit fb630b5
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 20 deletions.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ docs/nav.yml
docs/config.json
docs/dockhand.js
docs/template.html
docs/package.json
docs/node_modules
# docs source files are required by `npm help-search` do not exclude those
!docs/content/

# don't ignore .npmignore files
# these are used in some tests.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $(version_mandocs): package.json

htmldocs: dev-deps
node bin/npm-cli.js rebuild
cd docs && node dockhand.js >&2
node bin/npm-cli.js run -w docs build

clean: docs-clean gitclean

Expand Down
19 changes: 19 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "docs",
"description": "The npm cli documentation",
"version": "1.0.0",
"scripts": {
"build": "node dockhand"
},
"repository": {
"type": "git",
"url": "https://github.com/npm/cli"
},
"devDependencies": {
"@mdx-js/mdx": "^1.6.22",
"cmark-gfm": "^0.8.3",
"jsdom": "^16.4.0",
"marked-man": "^0.7.0",
"yaml": "^1.10.0"
}
}
1 change: 1 addition & 0 deletions node_modules/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 29 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"version": "7.15.1",
"name": "npm",
"description": "a package manager for JavaScript",
"workspaces": [
"docs"
],
"keywords": [
"install",
"modules",
Expand Down Expand Up @@ -180,18 +183,13 @@
"write-file-atomic"
],
"devDependencies": {
"@mdx-js/mdx": "^1.6.22",
"cmark-gfm": "^0.8.5",
"eslint": "^7.26.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"jsdom": "^16.5.2",
"licensee": "^8.1.0",
"marked-man": "^0.7.0",
"tap": "^15.0.9",
"yaml": "^1.10.2"
"licensee": "^8.2.0",
"tap": "^15.0.9"
},
"scripts": {
"dumpconf": "env | grep npm | sort | uniq",
Expand All @@ -212,10 +210,6 @@
"resetdeps": "bash scripts/resetdeps.sh",
"smoke-tests": "tap smoke-tests/index.js"
},
"//": [
"XXX temporarily only run unit tests while v7 beta is in progress",
"Remove the 'files' below once we're done porting old tests over"
],
"tap": {
"test-env": [
"LC_ALL=sk"
Expand Down
2 changes: 1 addition & 1 deletion scripts/bundle-and-gitignore-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const shouldIgnore = []

arb.loadVirtual().then(tree => {
for (const [name, node] of tree.children.entries()) {
if (node.dev) {
if (node.dev || node.isLink) {
console.error('ignore', node.name)
shouldIgnore.push(node.name)
} else if (tree.edgesOut.has(node.name)) {
Expand Down

0 comments on commit fb630b5

Please sign in to comment.