From b7ae7cc27bde669753279b58fafff2c6691b4882 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Sun, 11 Aug 2024 10:48:23 +0800 Subject: [PATCH] update --- .gitignore | 1 + README.md | 12 +++++++++++- package.json | 2 ++ src/index.ts | 3 ++- tsconfig.json | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 32942de..1a738a9 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,4 @@ dist .pnp.* package-lock.json +pnpm-lock.yaml diff --git a/README.md b/README.md index 9b9e3ba..3ec41d1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # nmake -一个用Nodejs作为框架编译C/C++的代码库,未来可能会支持更多语言 \ No newline at end of file +一个用Nodejs作为框架编译C/C++的代码库,未来可能会支持更多语言 + +## 运行源码 +```bash +npm i pnpm -g +pnpm install +pnpm run dev +# or +tsc -w +node ./build/index.js +``` \ No newline at end of file diff --git a/package.json b/package.json index 37cf777..f9d19ae 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ "author": "Zengtudor", "license": "MIT", "devDependencies": { + "@types/minimist": "^1.2.5", + "@types/node": "^22.2.0", "typescript": "^5.5.4" }, "dependencies": { diff --git a/src/index.ts b/src/index.ts index ad21821..ee7541a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,2 @@ -console.log("hello world") \ No newline at end of file +const argv = require('minimist')(process.argv.slice(2)); + diff --git a/tsconfig.json b/tsconfig.json index dda9dc7..0e62d6c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -76,7 +76,7 @@ /* Interop Constraints */ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */