Skip to content

Commit

Permalink
schema and typebox es module
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Dec 22, 2023
1 parent 347be8b commit 3d8c813
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 18 deletions.
26 changes: 19 additions & 7 deletions packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "A common data schema definition format",
"version": "5.0.12",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"keywords": [
"feathers",
"feathers-plugin"
Expand All @@ -29,23 +29,27 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"files": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"src/**",
"lib/**",
"types/**",
"esm/**",
"*.d.ts",
"*.js"
],
"scripts": {
"prepublish": "npm run compile",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"mocha": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts",
"test": "npm run compile && npm run mocha"
"test": "npm run compile && npm run mocha",
"compile:esm": "shx rm -rf esm/ && tsc --outDir esm/ --module esnext && shx echo '{ \"type\": \"module\" }' > esm/package.json",
"compile:cjs": "npx shx rm -rf types/ lib/ && tsc && shx echo '{ \"type\": \"commonjs\" }' > lib/package.json"
},
"directories": {
"lib": "lib"
Expand Down Expand Up @@ -76,5 +80,13 @@
"peerDependencies": {
"typescript": ">=5.3"
},
"gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5"
}
"gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5",
"module": "./esm/index.js",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./types/index.d.ts"
}
}
}
5 changes: 3 additions & 2 deletions packages/schema/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "lib"
"declarationDir": "./types",
"outDir": "lib"
}
}
}
26 changes: 19 additions & 7 deletions packages/typebox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "TypeBox integration for @feathersjs/schema",
"version": "5.0.12",
"homepage": "https://feathersjs.com",
"main": "lib/",
"types": "lib/",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"keywords": [
"feathers",
"feathers-plugin"
Expand All @@ -29,23 +29,27 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"files": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"src/**",
"lib/**",
"types/**",
"esm/**",
"*.d.ts",
"*.js"
],
"scripts": {
"prepublish": "npm run compile",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"mocha": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts",
"test": "npm run compile && npm run mocha"
"test": "npm run compile && npm run mocha",
"compile:esm": "shx rm -rf esm/ && tsc --outDir esm/ --module esnext && shx echo '{ \"type\": \"module\" }' > esm/package.json",
"compile:cjs": "npx shx rm -rf types/ lib/ && tsc && shx echo '{ \"type\": \"commonjs\" }' > lib/package.json"
},
"directories": {
"lib": "lib"
Expand All @@ -64,5 +68,13 @@
"shx": "^0.3.4",
"typescript": "^5.3.3"
},
"gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5"
}
"gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5",
"module": "./esm/index.js",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./lib/index.js",
"types": "./types/index.d.ts"
}
}
}
5 changes: 3 additions & 2 deletions packages/typebox/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"src/**/*.ts"
],
"compilerOptions": {
"outDir": "lib"
"declarationDir": "./types",
"outDir": "lib"
}
}
}

0 comments on commit 3d8c813

Please sign in to comment.