Skip to content

Commit 6aa4ff6

Browse files
Lms24lobsterkatie
andauthored
apply suggestions from code review
* comment/spelling corrections * console output Co-authored-by: Katie Byers <[email protected]>
1 parent 34b038a commit 6aa4ff6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/postbuild.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
This script prepares the central `build` directory for NPM package creation.
3-
It first copies all non-code files into the `build` directory, including `package.json` which
4-
is edited to adjust entry point paths. These corrections are performed so that they align with
3+
It first copies all non-code files into the `build` directory, including `package.json`, which
4+
is edited to adjust entry point paths. These corrections are performed so that the paths align with
55
the directory structure inside `build`.
66
*/
77

@@ -13,7 +13,7 @@ const BUILD_DIR = 'build';
1313
const ASSETS = ['README.md', 'LICENSE', 'package.json', '.npmignore'];
1414
const ENTRY_POINTS = ['main', 'module', 'types'];
1515

16-
// check if build dirs exists
16+
// check if build dir exists
1717
if (!fs.existsSync(BUILD_DIR)) {
1818
console.error(`Directory ${BUILD_DIR} DOES NOT exist`);
1919
console.error("This script should only be executed after you've run `yarn build`.");
@@ -33,7 +33,7 @@ ASSETS.forEach(asset => {
3333
const packageJsonPath = path.join(process.cwd(), BUILD_DIR, 'package.json');
3434
const pkg: { [key: string]: string } = require(packageJsonPath);
3535

36-
// modify entry points to point to correct paths (i.e. delete the build directory)
36+
// modify entry points to point to correct paths (i.e. strip out the build directory)
3737
ENTRY_POINTS.filter(entryPoint => !!pkg[entryPoint]).forEach(entryPoint => {
3838
pkg[entryPoint] = pkg[entryPoint].replace(`${BUILD_DIR}/`, '');
3939
});
@@ -45,4 +45,4 @@ delete pkg.volta;
4545
// write modified package.json to file
4646
fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2));
4747

48-
console.log('Successfully finished postbuild commands');
48+
console.log(`\nSuccessfully finished postbuild commands for ${pkg.name}`);

0 commit comments

Comments
 (0)