-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs-site): prepush hook for docs changes
Signed-off-by: AgentEnder <craigorycoppola@gmail.com>
- Loading branch information
1 parent
6e077f3
commit cfc92c1
Showing
10 changed files
with
89 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn documentation:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# @nx-dotnet/core:test | ||
|
||
## NxDotnet Test Generator | ||
|
||
Generate a .NET test project for an existing application or library | ||
|
||
## Options | ||
|
||
### <span className="required">name</span> | ||
|
||
- (string): The existing project to generate tests for | ||
|
||
### <span className="required">testTemplate</span> | ||
|
||
- (string): Which template should be used for creating the tests project? | ||
|
||
### language | ||
|
||
- (string): Which language should the project use? | ||
|
||
### suffix | ||
|
||
- (string): What suffix should be used for the tests project name? | ||
|
||
### skipOutputPathManipulation | ||
|
||
- (boolean): Skip XML changes for default build path | ||
|
||
### standalone | ||
|
||
- (boolean): Should the project use project.json? If false, the project config is inside workspace.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const { execSync } = require('child_process'); | ||
const { join } = require('path'); | ||
|
||
const cwd = join(__dirname, '../../../'); | ||
|
||
export function getChangedFiles(base = 'master', directory = '.'): string[] { | ||
const ancestor = execSync(`git merge-base HEAD ${base} `).toString().trim(); | ||
let cmd = `git diff --name-only ${ancestor} -- ${directory}`; | ||
console.log(`📁 Finding changed files with "${cmd}"`); | ||
const changed: string[] = execSync(cmd, { | ||
cwd, | ||
stdio: ['pipe', 'pipe', 'ignore'], | ||
}) | ||
.toString() | ||
.split('\n') | ||
.slice(0, -1); | ||
cmd = `git ls-files -z -o --exclude-standard -- ${directory}`; | ||
console.log(`📂 Finding new files with "${cmd}"`); | ||
const output = execSync(cmd, { cwd }).toString(); | ||
const newFiles: string[] = output.trim().length ? output.split(' ') : []; | ||
return changed.concat(newFiles); | ||
} | ||
|
||
console.log(`📖 Checking for documentation changes`); | ||
execSync('nx workspace-generator generate-docs'); | ||
const changes = getChangedFiles('master', 'docs'); | ||
if (changes.length) { | ||
console.log(`❌ Found changes in docs files`); | ||
changes.forEach((file) => { | ||
console.log(` - ${file}`); | ||
}); | ||
console.log('➡ Please commit these changes.'); | ||
process.exit(1); | ||
} |