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

Typedoc compliance #56

Closed
wants to merge 6 commits into from
Closed
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
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"chalk": "^4.1.2",
"dependency-graph": "^0.11.0",
"execa": "^5.1.1",
"lodash": "^4.17.21",
"superstruct": "^1.0.3",
"yargs": "^17.7.2"
},
Expand All @@ -68,6 +69,7 @@
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.66",
"@types/jest": "^28.1.6",
"@types/lodash": "^4.14.202",
"@types/node": "^16",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
Expand Down
202 changes: 159 additions & 43 deletions src/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import stripAnsi from 'strip-ansi';
import { main } from './main';
import { FakeOutputLogger } from '../tests/fake-output-logger';
import type { PrimaryExecaFunction } from '../tests/helpers';
import { fakeDateOnly, withinSandbox } from '../tests/helpers';
import {
fakeDateOnly,
fakePackageManifest,
withinSandbox,
} from '../tests/helpers';
import { setupToolWithMockRepositories } from '../tests/setup-tool-with-mock-repositories';

jest.mock('execa');
Expand Down Expand Up @@ -70,19 +74,7 @@ describe('main', () => {
);
await writeFile(
path.join(repository.directoryPath, 'package.json'),
JSON.stringify({
packageManager: 'yarn',
engines: { node: 'test' },
devDependencies: {
eslint: '1.1.0',
jest: '1.0.0',
'jest-it-up': '1.0.0',
},
scripts: {
test: 'test script',
'test:watch': 'test watch script',
},
}),
JSON.stringify(fakePackageManifest),
);
await writeFile(
path.join(repository.directoryPath, 'README.md'),
Expand All @@ -96,6 +88,22 @@ describe('main', () => {
path.join(repository.directoryPath, 'jest.config.js'),
'content for jest.config.js',
);
await writeFile(
path.join(repository.directoryPath, 'tsconfig.json'),
'content for tsconfig.json',
);
await writeFile(
path.join(repository.directoryPath, 'tsconfig.build.json'),
'content for tsconfig.build.json',
);
await writeFile(
path.join(repository.directoryPath, 'tsup.config.ts'),
'content for tsup.config.ts',
);
await writeFile(
path.join(repository.directoryPath, 'typedoc.json'),
'content for typedoc.json',
);
}
const outputLogger = new FakeOutputLogger();

Expand All @@ -122,6 +130,16 @@ repo-1
- Do the lint-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the jest-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the test-related \`scripts\` in \`package.json\` conform? ✅
- Do the typescript-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the typescript-related \`scripts\` in \`package.json\` conform? ✅
- Do the \`exports\` in \`package.json\` conform? ✅
- Do the \`main\` in \`package.json\` conform? ✅
- Do the \`module\` in \`package.json\` conform? ✅
- Do the \`types\` in \`package.json\` conform? ✅
- Do the \`files\` in \`package.json\` conform? ✅
- Does the \`lavamoat.allowscripts\` field in \`package.json\` conform? ✅
- Do the typedoc-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the typedoc-related \`scripts\` in \`package.json\` conform? ✅
- Is \`README.md\` present? ✅
- Does the README conform by recommending the correct Yarn version to install? ✅
- Does the README conform by recommending node install from nodejs.org? ✅
Expand All @@ -130,8 +148,12 @@ repo-1
- Does the \`src/\` directory exist? ✅
- Is \`.nvmrc\` present, and does it conform? ✅
- Is \`jest.config.js\` present, and does it conform? ✅
- Is \`tsconfig.json\` present, and does it conform? ✅
- Is \`tsconfig.build.json\` present, and does it conform? ✅
- Is \`tsup.config.ts\` present, and does it conform? ✅
- Is \`typedoc.json\` present, and does it conform? ✅

Results: 15 passed, 0 failed, 15 total
Results: 29 passed, 0 failed, 29 total
Elapsed time: 0 ms


Expand All @@ -145,6 +167,16 @@ repo-2
- Do the lint-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the jest-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the test-related \`scripts\` in \`package.json\` conform? ✅
- Do the typescript-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the typescript-related \`scripts\` in \`package.json\` conform? ✅
- Do the \`exports\` in \`package.json\` conform? ✅
- Do the \`main\` in \`package.json\` conform? ✅
- Do the \`module\` in \`package.json\` conform? ✅
- Do the \`types\` in \`package.json\` conform? ✅
- Do the \`files\` in \`package.json\` conform? ✅
- Does the \`lavamoat.allowscripts\` field in \`package.json\` conform? ✅
- Do the typedoc-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the typedoc-related \`scripts\` in \`package.json\` conform? ✅
- Is \`README.md\` present? ✅
- Does the README conform by recommending the correct Yarn version to install? ✅
- Does the README conform by recommending node install from nodejs.org? ✅
Expand All @@ -153,8 +185,12 @@ repo-2
- Does the \`src/\` directory exist? ✅
- Is \`.nvmrc\` present, and does it conform? ✅
- Is \`jest.config.js\` present, and does it conform? ✅
- Is \`tsconfig.json\` present, and does it conform? ✅
- Is \`tsconfig.build.json\` present, and does it conform? ✅
- Is \`tsup.config.ts\` present, and does it conform? ✅
- Is \`typedoc.json\` present, and does it conform? ✅

Results: 15 passed, 0 failed, 15 total
Results: 29 passed, 0 failed, 29 total
Elapsed time: 0 ms

`,
Expand Down Expand Up @@ -215,8 +251,16 @@ repo-1
- \`.nvmrc\` does not exist in this project.
- Is \`jest.config.js\` present, and does it conform? ❌
- \`jest.config.js\` does not exist in this project.

Results: 0 passed, 7 failed, 7 total
- Is \`tsconfig.json\` present, and does it conform? ❌
- \`tsconfig.json\` does not exist in this project.
- Is \`tsconfig.build.json\` present, and does it conform? ❌
- \`tsconfig.build.json\` does not exist in this project.
- Is \`tsup.config.ts\` present, and does it conform? ❌
- \`tsup.config.ts\` does not exist in this project.
- Is \`typedoc.json\` present, and does it conform? ❌
- \`typedoc.json\` does not exist in this project.

Results: 0 passed, 11 failed, 11 total
Elapsed time: 0 ms


Expand All @@ -239,8 +283,16 @@ repo-2
- \`.nvmrc\` does not exist in this project.
- Is \`jest.config.js\` present, and does it conform? ❌
- \`jest.config.js\` does not exist in this project.

Results: 0 passed, 7 failed, 7 total
- Is \`tsconfig.json\` present, and does it conform? ❌
- \`tsconfig.json\` does not exist in this project.
- Is \`tsconfig.build.json\` present, and does it conform? ❌
- \`tsconfig.build.json\` does not exist in this project.
- Is \`tsup.config.ts\` present, and does it conform? ❌
- \`tsup.config.ts\` does not exist in this project.
- Is \`typedoc.json\` present, and does it conform? ❌
- \`typedoc.json\` does not exist in this project.

Results: 0 passed, 11 failed, 11 total
Elapsed time: 0 ms

`,
Expand Down Expand Up @@ -307,8 +359,16 @@ repo-2
- \`.nvmrc\` does not exist in this project.
- Is \`jest.config.js\` present, and does it conform? ❌
- \`jest.config.js\` does not exist in this project.

Results: 1 passed, 6 failed, 7 total
- Is \`tsconfig.json\` present, and does it conform? ❌
- \`tsconfig.json\` does not exist in this project.
- Is \`tsconfig.build.json\` present, and does it conform? ❌
- \`tsconfig.build.json\` does not exist in this project.
- Is \`tsup.config.ts\` present, and does it conform? ❌
- \`tsup.config.ts\` does not exist in this project.
- Is \`typedoc.json\` present, and does it conform? ❌
- \`typedoc.json\` does not exist in this project.

Results: 1 passed, 10 failed, 11 total
Elapsed time: 0 ms

`.trimStart(),
Expand Down Expand Up @@ -361,19 +421,7 @@ Elapsed time: 0 ms
);
await writeFile(
path.join(repository.directoryPath, 'package.json'),
JSON.stringify({
packageManager: 'yarn',
engines: { node: 'test' },
devDependencies: {
eslint: '1.1.0',
jest: '1.0.0',
'jest-it-up': '1.0.0',
},
scripts: {
test: 'test script',
'test:watch': 'test watch script',
},
}),
JSON.stringify(fakePackageManifest),
);
await writeFile(
path.join(repository.directoryPath, 'README.md'),
Expand All @@ -387,6 +435,22 @@ Elapsed time: 0 ms
path.join(repository.directoryPath, 'jest.config.js'),
'content for jest.config.js',
);
await writeFile(
path.join(repository.directoryPath, 'tsconfig.json'),
'content for tsconfig.json',
);
await writeFile(
path.join(repository.directoryPath, 'tsconfig.build.json'),
'content for tsconfig.build.json',
);
await writeFile(
path.join(repository.directoryPath, 'tsup.config.ts'),
'content for tsup.config.ts',
);
await writeFile(
path.join(repository.directoryPath, 'typedoc.json'),
'content for typedoc.json',
);
}
const outputLogger = new FakeOutputLogger();

Expand All @@ -413,6 +477,16 @@ repo-1
- Do the lint-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the jest-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the test-related \`scripts\` in \`package.json\` conform? ✅
- Do the typescript-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the typescript-related \`scripts\` in \`package.json\` conform? ✅
- Do the \`exports\` in \`package.json\` conform? ✅
- Do the \`main\` in \`package.json\` conform? ✅
- Do the \`module\` in \`package.json\` conform? ✅
- Do the \`types\` in \`package.json\` conform? ✅
- Do the \`files\` in \`package.json\` conform? ✅
- Does the \`lavamoat.allowscripts\` field in \`package.json\` conform? ✅
- Do the typedoc-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the typedoc-related \`scripts\` in \`package.json\` conform? ✅
- Is \`README.md\` present? ✅
- Does the README conform by recommending the correct Yarn version to install? ✅
- Does the README conform by recommending node install from nodejs.org? ✅
Expand All @@ -421,8 +495,12 @@ repo-1
- Does the \`src/\` directory exist? ✅
- Is \`.nvmrc\` present, and does it conform? ✅
- Is \`jest.config.js\` present, and does it conform? ✅
- Is \`tsconfig.json\` present, and does it conform? ✅
- Is \`tsconfig.build.json\` present, and does it conform? ✅
- Is \`tsup.config.ts\` present, and does it conform? ✅
- Is \`typedoc.json\` present, and does it conform? ✅

Results: 15 passed, 0 failed, 15 total
Results: 29 passed, 0 failed, 29 total
Elapsed time: 0 ms


Expand All @@ -436,6 +514,16 @@ repo-2
- Do the lint-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the jest-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the test-related \`scripts\` in \`package.json\` conform? ✅
- Do the typescript-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the typescript-related \`scripts\` in \`package.json\` conform? ✅
- Do the \`exports\` in \`package.json\` conform? ✅
- Do the \`main\` in \`package.json\` conform? ✅
- Do the \`module\` in \`package.json\` conform? ✅
- Do the \`types\` in \`package.json\` conform? ✅
- Do the \`files\` in \`package.json\` conform? ✅
- Does the \`lavamoat.allowscripts\` field in \`package.json\` conform? ✅
- Do the typedoc-related \`devDependencies\` in \`package.json\` conform? ✅
- Do the typedoc-related \`scripts\` in \`package.json\` conform? ✅
- Is \`README.md\` present? ✅
- Does the README conform by recommending the correct Yarn version to install? ✅
- Does the README conform by recommending node install from nodejs.org? ✅
Expand All @@ -444,8 +532,12 @@ repo-2
- Does the \`src/\` directory exist? ✅
- Is \`.nvmrc\` present, and does it conform? ✅
- Is \`jest.config.js\` present, and does it conform? ✅
- Is \`tsconfig.json\` present, and does it conform? ✅
- Is \`tsconfig.build.json\` present, and does it conform? ✅
- Is \`tsup.config.ts\` present, and does it conform? ✅
- Is \`typedoc.json\` present, and does it conform? ✅

Results: 15 passed, 0 failed, 15 total
Results: 29 passed, 0 failed, 29 total
Elapsed time: 0 ms

`,
Expand Down Expand Up @@ -506,8 +598,16 @@ repo-1
- \`.nvmrc\` does not exist in this project.
- Is \`jest.config.js\` present, and does it conform? ❌
- \`jest.config.js\` does not exist in this project.

Results: 0 passed, 7 failed, 7 total
- Is \`tsconfig.json\` present, and does it conform? ❌
- \`tsconfig.json\` does not exist in this project.
- Is \`tsconfig.build.json\` present, and does it conform? ❌
- \`tsconfig.build.json\` does not exist in this project.
- Is \`tsup.config.ts\` present, and does it conform? ❌
- \`tsup.config.ts\` does not exist in this project.
- Is \`typedoc.json\` present, and does it conform? ❌
- \`typedoc.json\` does not exist in this project.

Results: 0 passed, 11 failed, 11 total
Elapsed time: 0 ms


Expand All @@ -530,8 +630,16 @@ repo-2
- \`.nvmrc\` does not exist in this project.
- Is \`jest.config.js\` present, and does it conform? ❌
- \`jest.config.js\` does not exist in this project.

Results: 0 passed, 7 failed, 7 total
- Is \`tsconfig.json\` present, and does it conform? ❌
- \`tsconfig.json\` does not exist in this project.
- Is \`tsconfig.build.json\` present, and does it conform? ❌
- \`tsconfig.build.json\` does not exist in this project.
- Is \`tsup.config.ts\` present, and does it conform? ❌
- \`tsup.config.ts\` does not exist in this project.
- Is \`typedoc.json\` present, and does it conform? ❌
- \`typedoc.json\` does not exist in this project.

Results: 0 passed, 11 failed, 11 total
Elapsed time: 0 ms

`,
Expand Down Expand Up @@ -597,8 +705,16 @@ repo-2
- \`.nvmrc\` does not exist in this project.
- Is \`jest.config.js\` present, and does it conform? ❌
- \`jest.config.js\` does not exist in this project.

Results: 1 passed, 6 failed, 7 total
- Is \`tsconfig.json\` present, and does it conform? ❌
- \`tsconfig.json\` does not exist in this project.
- Is \`tsconfig.build.json\` present, and does it conform? ❌
- \`tsconfig.build.json\` does not exist in this project.
- Is \`tsup.config.ts\` present, and does it conform? ❌
- \`tsup.config.ts\` does not exist in this project.
- Is \`typedoc.json\` present, and does it conform? ❌
- \`typedoc.json\` does not exist in this project.

Results: 1 passed, 10 failed, 11 total
Elapsed time: 0 ms

`,
Expand Down
Loading
Loading