Skip to content

Commit 0edd826

Browse files
committed
fixes
1 parent 91f38bf commit 0edd826

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

scripts/create-nx-sandbox-projects.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as fs from 'fs';
2-
import * as path from 'path';
1+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2+
import { dirname, join } from 'node:path';
33

44
import * as templates from '../code/lib/cli-storybook/src/sandbox-templates';
55

@@ -31,7 +31,7 @@ const projectJson = (name: string, framework: string, tags: string[]) => ({
3131
});
3232
Object.entries(allTemplates).forEach(([key, value]) => {
3333
const p = key.replaceAll('/', '-');
34-
const full = path.join(process.cwd(), '../code/sandbox', p, 'project.json');
34+
const full = join(process.cwd(), '../code/sandbox', p, 'project.json');
3535

3636
console.log(full);
3737
const framework = value.expected.framework.replace('@storybook/', '');
@@ -44,7 +44,7 @@ Object.entries(allTemplates).forEach(([key, value]) => {
4444
];
4545
ensureDirectoryExistence(full);
4646
console.log(full);
47-
fs.writeFileSync(
47+
writeFileSync(
4848
full,
4949
'// auto-generated from scripts/create-nx-sandbox-projects.ts\n' +
5050
JSON.stringify(projectJson(key, framework, tags), null, 2),
@@ -55,10 +55,10 @@ Object.entries(allTemplates).forEach(([key, value]) => {
5555
});
5656

5757
function ensureDirectoryExistence(filePath: string): void {
58-
const dirname = path.dirname(filePath);
59-
if (fs.existsSync(dirname)) {
58+
const dir = dirname(filePath);
59+
if (existsSync(dir)) {
6060
return;
6161
}
62-
ensureDirectoryExistence(dirname);
63-
fs.mkdirSync(dirname);
62+
ensureDirectoryExistence(dir);
63+
mkdirSync(dir);
6464
}

scripts/release/__tests__/version.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ describe('Version', () => {
280280
{ spaces: 2 }
281281
);
282282
expect(execaCommand).toHaveBeenCalledWith('yarn install --mode=update-lockfile', {
283-
cwd: path.join(CODE_DIR_PATH),
283+
cwd: join(CODE_DIR_PATH),
284284
cleanup: true,
285285
stdio: undefined,
286286
});

0 commit comments

Comments
 (0)