diff --git a/package-lock.json b/package-lock.json index 28b8b69..2bd8365 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,20 @@ { "name": "@babylonlabs-io/babylon-proto-ts", - "version": "0.0.3", + "version": "0.0.3-canary.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@babylonlabs-io/babylon-proto-ts", - "version": "0.0.3", + "version": "0.0.3-canary.1", "license": "ISC", "dependencies": { "@bufbuild/protobuf": "^2.2.0" }, "devDependencies": { "@bufbuild/buf": "^1.45.0", - "shelljs": "^0.8.5" + "shelljs": "^0.8.5", + "typescript": "^5.6.3" } }, "node_modules/@bufbuild/buf": { @@ -371,6 +372,20 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index bd920a5..96554f9 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "name": "@babylonlabs-io/babylon-proto-ts", - "version": "0.0.3", - "main": "index.js", + "version": "0.0.3-canary.1", + "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { - "build": "node scripts/build-proto.js", + "build": "tsc && node scripts/build-proto.js", "prepublishOnly": "npm run build" }, "files": [ @@ -15,7 +16,8 @@ "description": "", "devDependencies": { "@bufbuild/buf": "^1.45.0", - "shelljs": "^0.8.5" + "shelljs": "^0.8.5", + "typescript": "^5.6.3" }, "dependencies": { "@bufbuild/protobuf": "^2.2.0" @@ -23,4 +25,4 @@ "publishConfig": { "access": "public" } -} +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..4f969d2 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "strict": false, // Disable strict type checking globally + "skipLibCheck": true, // Skip type checking for library files + "noImplicitAny": false, // Allow implicit 'any' types + "outDir": "./dist", // Output directory for compiled files + "rootDir": "./src", // Root directory for source files + "declaration": true, // Generate .d.ts type declaration files + "declarationMap": true, // Generate .d.ts.map files for debugging + "esModuleInterop": true, // Enable compatibility with CommonJS modules + "module": "commonjs", // CommonJS module system + "target": "es2017", // Set target to ES2017 to support Object.entries + "lib": [ + "es2017", + "dom" + ] // Include ES2017 libraries for compatibility + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules", + "dist", + "src/generated" // Exclude generated files to avoid type-checking them + ] +} \ No newline at end of file