Skip to content

Commit

Permalink
repo - Updated 'link-packages' script to use 'pnpm'.
Browse files Browse the repository at this point in the history
  • Loading branch information
elycruz committed Dec 30, 2023
1 parent 0bad3bf commit bedf725
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
12 changes: 6 additions & 6 deletions node_scripts/tasks/link-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const

{log, error} = console,

{ioSpawn, npmCmd} = require('../utils'),
{ioSpawn} = require('../utils'),

repoRoot = path.join(__dirname, '../../'),

Expand All @@ -16,7 +16,7 @@ const
* @return {Promise<void>}
*/
(async () => Promise.resolve()
.then(() => !process.env.NODE_ENV || process.env.NODE_ENV === 'development' ? ioSpawn(npmCmd, ['i'], {cwd: repoRoot}) : void 0)
.then(() => !process.env.NODE_ENV || process.env.NODE_ENV === 'development' ? ioSpawn('pnpm', ['i'], {cwd: repoRoot}) : void 0)
.then(() => log('Linking packages\n'))
.then(() => [
['fjl'],
Expand All @@ -32,17 +32,17 @@ const
// log(`Linking subpackages: ${packagesToLink.join(', ')}`);
// return Promise.all(
// packagesToLink.map(subPackageName =>
// ioSpawn(npmCmd, ['link', subPackageName], {cwd})
// ioSpawn('pnpm', ['link', subPackageName], {cwd})
// ));
// }
// })
return p.then(() => {
log(`${taskGroupSeparator}Linking ${packageName} ...`);
return ioSpawn(npmCmd, ['link'], {cwd});
return ioSpawn('pnpm', ['link', '.'], {cwd});
})
.then(() => {
log(`${taskGroupSeparator}Linking ${packageName} to main project ...`);
return ioSpawn(npmCmd, ['link', packageName], {cwd: repoRoot});
return ioSpawn('pnpm', ['link', packageName], {cwd: repoRoot});
})
.catch(error);
},
Expand All @@ -51,5 +51,5 @@ const
.then(() => log(taskGroupSeparator + 'Script completed successfully.\n'))
)
.then(() => log('Building packages\n'))
.then(() => ioSpawn(npmCmd, ['run', 'build'], {cwd: repoRoot}))
.then(() => ioSpawn('pnpm', ['run', 'build'], {cwd: repoRoot}))
)();
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,10 @@
"pnpm": ">=8"
},
"mockServerPort": 10087,
"mockServerCommand": "node ./packages/fjl-validator-recaptcha/tests/mock-server.js"
"mockServerCommand": "node ./packages/fjl-validator-recaptcha/tests/mock-server.js",
"dependencies": {
"fjl": "^2.0.0-alpha.5",
"fjl-inputfilter": "^1.3.0",
"fjl-validator": "^0.8.0"
}
}
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bedf725

Please sign in to comment.