Skip to content

Commit

Permalink
Merge pull request #45 from heyAyushh/enable-cjs-distribution
Browse files Browse the repository at this point in the history
added cjs distribution command and tsconfig
  • Loading branch information
mikemaccana authored Aug 29, 2024
2 parents 3023373 + 2fcc6b6 commit f538c51
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 24 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,32 @@
"name": "@solana-developers/helpers",
"version": "2.5.2",
"description": "Solana helper functions",
"main": "dist/index.js",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/esm/index.d.ts",
"type": "module",
"private": false,
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"./node": {
"import": "./dist/esm/node.js",
"require": "./dist/cjs/node.js"
}
},
"files": [
"dist"
],
"sideEffects": false,
"scripts": {
"build": "tsc",
"build": "npm run build:esm && npm run build:cjs",
"build:esm": "tsc",
"build:cjs": "tsc -p tsconfig.cjs.json",
"clean": "rm -rf dist",
"test": "esrun src/index.test.ts"
"test": "esrun src/index.test.ts",
"typecheck": "tsc --noEmit"
},
"keywords": [
"solana",
Expand All @@ -24,7 +43,8 @@
"Nick Frostbutter",
"John Liu",
"Steven Luscher",
"Christian Krueger"
"Christian Krueger",
"Ayush Chauhan"
],
"license": "MIT",
"dependencies": {
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"outDir": "./dist/cjs"
}
}
21 changes: 13 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
// See https://aka.ms/tsconfig
{
"compilerOptions": {
"outDir": "dist",
"target": "es2022",
"moduleResolution": "Bundler",
"module": "ES2022",
"target": "ES2018",
"lib": ["ES2018", "DOM"],
"moduleResolution": "node",
"outDir": "./dist/esm",
"rootDir": "./src",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
"skipLibCheck": true,
"module": "ESNext",
"isolatedModules": true
},
"include": ["src"],
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
}

0 comments on commit f538c51

Please sign in to comment.