Skip to content

Commit

Permalink
chore(nxext): fix create playground
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikPieper committed Apr 16, 2024
1 parent 19c8708 commit 9dd545d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/scripts/create-playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ const baseName = basename(tmpProjPath());

logger.info('Creating nx workspace...');
execSync(
`pnpx create-nx-workspace --preset=empty --name=${baseName} --skipGit=true --packageManager=pnpm --nxCloud=false`,
`npx --yes create-nx-workspace@latest ${baseName} --preset empty --nxCloud skip --no-interactive`,
{
cwd: localTmpDir,
stdio: 'inherit',
env: process.env,
}
);
logger.info('Nx workspace created!');
Expand All @@ -44,7 +46,7 @@ publishableLibNames.forEach((pubLibName) => {
const p = JSON.parse(readFileSync(tmpProjPath('package.json')).toString());
p.devDependencies[
require(`${workspaceRoot}/${packageJson}`).name
] = `file:${workspaceRoot}/${outputPath}`;
] = `file:${workspaceRoot}/${outputPath}`;
writeFileSync(tmpProjPath('package.json'), JSON.stringify(p, null, 2));
} catch (e) {
logger.info(`Problem with ${pubLibName}`);
Expand All @@ -54,9 +56,9 @@ logger.info(`All packages processed.`);

logger.info('Update versions...');
const tsConfigBase = readJsonFile(`${workspaceRoot}/tsconfig.base.json`);
const distPaths = Object.entries(tsConfigBase.compilerOptions.paths).reduce<
Record<string, string>
>((acc, cur) => {
const distPaths = Object.entries<string>(
tsConfigBase.compilerOptions.paths
).reduce<Record<string, string>>((acc, cur) => {
acc[cur[0]] = `file:${workspaceRoot}/dist/${cur[1][0].split('/src')[0]}`;

return acc;
Expand Down

0 comments on commit 9dd545d

Please sign in to comment.