diff --git a/build/dist.ts b/build/dist.ts index 73bcc932..7f9cfbcd 100644 --- a/build/dist.ts +++ b/build/dist.ts @@ -17,86 +17,86 @@ async function documents(): Promise { await fs.promises.link(`${ROOT}/${file}`, `${DIST}/${file}`); } -const substitude = - (content: string) => - content.replace( - /(import|export)(.*)from "(.\/|..\/)(.*)"/g, - str => { - const to: number = str.lastIndexOf(`"`); - return [ - str.substring(0, to), - `.mjs"`, - str.substring(to + 1) - ].join(""); - } - ); +// const substitude = +// (content: string) => +// content.replace( +// /(import|export)(.*)from "(.\/|..\/)(.*)"/g, +// str => { +// const to: number = str.lastIndexOf(`"`); +// return [ +// str.substring(0, to), +// `.mjs"`, +// str.substring(to + 1) +// ].join(""); +// } +// ); -async function module(): Promise { - const declaration = async (location: string)=> { - const content = substitude( - await fs.promises.readFile(location, "utf8") - ); - await fs.promises.unlink(location); - await fs.promises.writeFile( - `${location.substring(0, location.length - 5)}.d.mts`, - content, - "utf8" - ); - }; - const javascript = async (location: string, file: string) => { - const content = substitude( - await fs.promises.readFile(location, "utf8") - ) - .replace( - `//# sourceMappingURL=${file}.map`, - `//# sourceMappingURL=${file.substring(0, file.length - 3)}.mjs.map` - ); - await fs.promises.unlink(location); - await fs.promises.writeFile( - `${location.substring(0, location.length - 3)}.mjs`, - content, - "utf8" - ); - }; - const mapper = async (location: string) => { - const content: string = await fs.promises.readFile(location, "utf8"); - const parsed: {file: string } = JSON.parse(content); - parsed.file = parsed.file.substring(0, parsed.file.length - 3) + ".mjs"; +// async function module(): Promise { +// const declaration = async (location: string)=> { +// const content = substitude( +// await fs.promises.readFile(location, "utf8") +// ); +// await fs.promises.unlink(location); +// await fs.promises.writeFile( +// `${location.substring(0, location.length - 5)}.d.mts`, +// content, +// "utf8" +// ); +// }; +// const javascript = async (location: string, file: string) => { +// const content = substitude( +// await fs.promises.readFile(location, "utf8") +// ) +// .replace( +// `//# sourceMappingURL=${file}.map`, +// `//# sourceMappingURL=${file.substring(0, file.length - 3)}.mjs.map` +// ); +// await fs.promises.unlink(location); +// await fs.promises.writeFile( +// `${location.substring(0, location.length - 3)}.mjs`, +// content, +// "utf8" +// ); +// }; +// const mapper = async (location: string) => { +// const content: string = await fs.promises.readFile(location, "utf8"); +// const parsed: {file: string } = JSON.parse(content); +// parsed.file = parsed.file.substring(0, parsed.file.length - 3) + ".mjs"; - await fs.promises.unlink(location); - await fs.promises.writeFile( - `${location.substring(0, location.length - 7)}.mjs.map`, - JSON.stringify(parsed), - "utf8" - ); - }; +// await fs.promises.unlink(location); +// await fs.promises.writeFile( +// `${location.substring(0, location.length - 7)}.mjs.map`, +// JSON.stringify(parsed), +// "utf8" +// ); +// }; - const iterate = async (path: string): Promise => { - const directory: string[] = await fs.promises.readdir(path); - for (const file of directory) { - const location: string = `${path}/${file}`; - const stats: fs.Stats = await fs.promises.stat(location); +// const iterate = async (path: string): Promise => { +// const directory: string[] = await fs.promises.readdir(path); +// for (const file of directory) { +// const location: string = `${path}/${file}`; +// const stats: fs.Stats = await fs.promises.stat(location); - if (stats.isDirectory()) await iterate(location); - else if (location.substr(-3) === ".js") - await javascript(location, file); - else if (location.substr(-5) === ".d.ts") - await declaration(location); - else if (location.substr(-7) === ".js.map") - await mapper(location); - } - }; +// if (stats.isDirectory()) await iterate(location); +// else if (location.substr(-3) === ".js") +// await javascript(location, file); +// else if (location.substr(-5) === ".d.ts") +// await declaration(location); +// else if (location.substr(-7) === ".js.map") +// await mapper(location); +// } +// }; - cp.execSync(`npx tsc -p tsconfig.module.json`, { stdio: "inherit" }); - await iterate(DIST); -} +// cp.execSync(`npx tsc -p tsconfig.module.json`, { stdio: "inherit" }); +// await iterate(DIST); +// } async function main(): Promise { cp.execSync(`npx rimraf ${DIST}`, { stdio: "inherit" }); await fs.promises.mkdir(DIST); await documents(); - await module(); + // await module(); cp.execSync(`npx tsc -p tsconfig.json`, { stdio: "inherit" }); } main(); diff --git a/package.json b/package.json index 10b1db20..61f79596 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,9 @@ "email": "samchon.github@gmail.com", "url": "https://github.com/samchon" }, - "version": "2.5.11", - "main": "./index.js", - "module": "./index.mjs", - "esnext": "./index.mjs", + "version": "2.5.12", "typings": "./index.d.ts", + "main": "./index.js", "scripts": { "api": "typedoc src --exclude \"**/+(test|benchmark)/**\" --excludeNotDocumented --plugin typedoc-plugin-external-module-name --plugin typedoc-plugin-exclude-references --out ../tstl@gh-pages/api", "migration": "ts-node build/migration", diff --git a/tsconfig.module.json b/tsconfig.module.json deleted file mode 100644 index 088e4316..00000000 --- a/tsconfig.module.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "target": "ES2015", - "module": "ES2020", - "downlevelIteration": false - } -} \ No newline at end of file