mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-20 12:37:01 +02:00
fix: add repository metadata to all packages (#3613)
* fix: add repository metadata to all packages * empty commit for cla bot * move validate-package-json.test.ts + add glob devDependency Co-authored-by: slorber <lorber.sebastien@gmail.com>
This commit is contained in:
parent
80360b4e0f
commit
6930e91508
31 changed files with 169 additions and 3 deletions
32
__tests__/validate-package-json.test.ts
Normal file
32
__tests__/validate-package-json.test.ts
Normal file
|
@ -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$/, ''),
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue