Skip to content

Commit 7c95cb9

Browse files
refactor: convert dev.js to ES module syntax
- Replace CommonJS require() calls with ES module import statements - Add __dirname and __filename polyfills using fileURLToPath and path.dirname - Import fileURLToPath from 'url' module for ES module compatibility - Maintains all original functionality while using modern ES module syntax - Consistent with prepare.js ES module conversion
1 parent 0a6f118 commit 7c95cb9

File tree

1 file changed

+7
-3
lines changed
  • clients/typescript/scripts

1 file changed

+7
-3
lines changed

clients/typescript/scripts/dev.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616
* node scripts/dev.js pre-publish - Run pre-publish checks/tasks
1717
*/
1818

19-
const { execSync } = require('child_process');
20-
const fs = require('fs');
21-
const path = require('path');
19+
import { execSync } from 'child_process';
20+
import fs from 'fs';
21+
import path from 'path';
22+
import { fileURLToPath } from 'url';
23+
24+
const __filename = fileURLToPath(import.meta.url);
25+
const __dirname = path.dirname(__filename);
2226

2327
// Validate we're in the package root
2428
const packageJsonPath = path.join(__dirname, '..', 'package.json');

0 commit comments

Comments
 (0)