File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed
Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 66 "type" : " "
77 },
88 "license" : " Apache-2.0" ,
9+ "type" : " module" ,
910 "scripts" : {
1011 "build" : " npm run build:admin" ,
1112 "build:admin" : " vite build" ,
Original file line number Diff line number Diff line change 1- const fs = require ( 'fs' ) ;
2- const path = require ( 'path' ) ;
3- const parser = require ( './typescript-parser.js' ) ;
1+ import fs from 'fs' ;
2+ import path from 'path' ;
3+ import { fileURLToPath } from 'node:url' ;
4+ import parser from './typescript-parser.js' ;
45
5- const rootDir = path . dirname ( path . dirname ( __filename ) ) ;
6+ const filename = fileURLToPath ( import . meta. url ) ;
7+ const rootDir = path . dirname ( path . dirname ( filename ) ) ;
68
79const declarations = parser . parse ( path . join ( rootDir , 'node_modules/turms-client-js/dist/turms-client.d.ts' ) ) ;
810const data = `${ JSON . stringify ( declarations , null , 2 ) } ` ;
Original file line number Diff line number Diff line change 1- const { readFileSync} = require ( 'fs' ) ;
1+ import { readFileSync } from 'fs' ;
2+ import typescript from 'typescript' ;
3+
24const {
35 createSourceFile,
46 isArrayBindingPattern,
@@ -16,7 +18,7 @@ const {
1618 ScriptKind,
1719 ScriptTarget,
1820 SyntaxKind
19- } = require ( ' typescript' ) ;
21+ } = typescript ;
2022
2123const Visibility = {
2224 Private : 'private' ,
@@ -250,7 +252,7 @@ function parseClass(node) {
250252 return declaration ;
251253}
252254
253- module . exports = {
255+ export default {
254256 parse ( filePath ) {
255257 const source = createSourceFile (
256258 filePath ,
You can’t perform that action at this time.
0 commit comments