-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement verify integrity check (#179)
- Loading branch information
Showing
6 changed files
with
47 additions
and
15 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
7 changes: 0 additions & 7 deletions
7
change/fluentui-contrib-e0f9df68-b86b-4cc8-9fd2-a18226c70fdb.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
change/fluentui-contrib-e822b249-aa15-4cb7-979e-467b1a976aa2.json
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,42 @@ | ||
// @ts-check | ||
|
||
import { fileURLToPath } from 'node:url'; | ||
import { dirname, join } from 'node:path'; | ||
import { readFileSync } from 'node:fs'; | ||
|
||
import chalk from 'chalk'; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = dirname(__filename); | ||
|
||
main(); | ||
|
||
function main() { | ||
/** | ||
* @type {string[]} | ||
*/ | ||
const log = []; | ||
|
||
log.push(verifyPackageJson()); | ||
|
||
log.forEach((message) => { | ||
console.log(`- ✅ ${chalk.bold.green(message)}`); | ||
}); | ||
} | ||
|
||
function verifyPackageJson() { | ||
/** @type {import('nx/src/utils/package-json').PackageJson} */ | ||
const json = JSON.parse( | ||
readFileSync(join(__dirname, '../../package.json'), 'utf-8') | ||
); | ||
|
||
if (json.private !== true) { | ||
throw new Error('The package.json must have a private field set to true'); | ||
} | ||
|
||
if (json.version !== '0.0.0') { | ||
throw new Error('The package.json must have a version field set to 0.0.0'); | ||
} | ||
|
||
return 'The package.json is valid.'; | ||
} |