Skip to content
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

fix: add repository metadata to all packages #3613

Merged
merged 3 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions __tests__/validate-package-json.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import util from 'util';
import globCb from 'glob';
import fsCb from 'fs';

const glob = util.promisify(globCb);
const readFile = util.promisify(fsCb.readFile);

describe('packages', () => {
test('should contain repository and directory for every package', async () => {
const allPackageJson = await glob('packages/*/package.json');
expect(allPackageJson.length).toBeGreaterThan(0);

/* eslint-disable no-await-in-loop,no-restricted-syntax */
for (const packageJson of allPackageJson) {
const content = JSON.parse(await readFile(packageJson, 'utf8'));
if (content.private !== true) {
expect(content.repository).toEqual({
type: 'git',
url: 'https://github.com/facebook/docusaurus.git',
directory: packageJson.replace(/\/package\.json$/, ''),
});
}
}
});
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^4.0.4",
"glob": "^7.1.6",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I was sure I'd add this already. Spent hours thinking it wanted me to move the dependency into dependencies and trying to fix that.. ugh

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) maybe you didn't use the -W option to add dev dependencies in monorepo root ;)

"husky": "^4.2.3",
"jest": "^25.2.7",
"lerna": "^3.19.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-1.x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
],
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git"
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-1.x"
},
"scripts": {
"start": "cd ../../website-1.x && yarn start"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-init-1.x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"open source",
"docusaurus"
],
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-init-1.x"
},
"bin": {
"docusaurus-init": "initialize.js"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus-init/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Create Docusaurus app easily",
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git"
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-init"
},
"bugs": {
"url": "https://github.com/facebook/docusaurus/issues"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-mdx-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"scripts": {
"build": "tsc"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-mdx-loader"
},
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.9.4",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"build": "tsc",
"watch": "tsc --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-migrate"
},
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-module-type-aliases/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-module-type-aliases"
},
"devDependencies": {
"@types/react": "*",
"@types/react-helmet": "*",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-client-redirects/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"build": "tsc",
"watch": "tsc --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-client-redirects"
},
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-content-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"build": "tsc",
"watch": "tsc --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-content-blog"
},
"publishConfig": {
"access": "public"
},
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-content-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-content-docs"
},
"license": "MIT",
"devDependencies": {
"@docusaurus/module-type-aliases": "2.0.0-alpha.66",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-content-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-content-pages"
},
"license": "MIT",
"devDependencies": {
"@types/hapi__joi": "^17.1.2"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-debug"
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-google-analytics"
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-google-gtag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-google-gtag"
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-ideal-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-ideal-image"
},
"license": "MIT",
"devDependencies": {
"fs-extra": "^9.0.0"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-pwa"
},
"license": "MIT",
"dependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-plugin-sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-plugin-sitemap"
},
"license": "MIT",
"devDependencies": {
"@types/hapi__joi": "^17.1.2"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-preset-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-preset-bootstrap"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
"@docusaurus/plugin-content-blog": "2.0.0-alpha.66",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-preset-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-preset-classic"
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-remark-plugin-npm2yarn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-remark-plugin-npm2yarn"
},
"license": "MIT",
"dependencies": {
"npm-to-yarn": "^1.0.1"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-theme-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-theme-bootstrap"
},
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
"@docusaurus/plugin-content-blog": "2.0.0-alpha.66",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-theme-classic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-theme-classic"
},
"license": "MIT",
"scripts": {
"build": "tsc --noEmit && yarn babel && yarn prettier",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-theme-live-codeblock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-theme-live-codeblock"
},
"license": "MIT",
"dependencies": {
"@docusaurus/core": "2.0.0-alpha.66",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-theme-search-algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-theme-search-algolia"
},
"license": "MIT",
"dependencies": {
"@docsearch/react": "^1.0.0-alpha.27",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-types"
},
"license": "MIT",
"dependencies": {
"@types/webpack": "^4.41.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-utils-validation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-utils-validation"
},
"license": "MIT",
"devDependencies": {
"@types/hapi__joi": "^17.1.2"
Expand Down
5 changes: 5 additions & 0 deletions packages/docusaurus-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus-utils"
},
"license": "MIT",
"dependencies": {
"escape-string-regexp": "^2.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
],
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git"
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/docusaurus"
},
"bin": {
"docusaurus": "bin/docusaurus.js"
Expand Down
5 changes: 5 additions & 0 deletions packages/lqip-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/lqip-loader"
},
"license": "MIT",
"dependencies": {
"loader-utils": "^1.2.3",
Expand Down
5 changes: 5 additions & 0 deletions packages/stylelint-copyright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"description": "stylelint plugin to check css files for a copyright header",
"main": "index.js",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/facebook/docusaurus.git",
"directory": "packages/stylelint-copyright"
},
"dependencies": {
"stylelint": "^13.2.1"
}
Expand Down