Skip to content
Prev Previous commit
Next Next commit
Migrate commons and errors
  • Loading branch information
daffl committed Dec 22, 2023
commit 2822ef5b2b9a185cc7371f8b426bc348be493394
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/adapter-commons/test/fixture.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AdapterBase, AdapterParams, PaginationOptions } from '../src/index'
import { Id, NullableId, Paginated } from '@feathersjs/feathers'
import { BadRequest, MethodNotAllowed } from '@feathersjs/errors/lib'
import { BadRequest, MethodNotAllowed } from '@feathersjs/errors'

export type Data = {
id: Id
Expand Down
26 changes: 19 additions & 7 deletions packages/commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,28 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"main": "lib/",
"types": "lib/",
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"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",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts",
"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 @@ -59,5 +63,13 @@
"ts-node": "^10.9.2",
"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/commons/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/errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "Common error types for Feathers apps",
"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 @@ -25,16 +25,18 @@
"url": "https://github.com/feathersjs/feathers/issues"
},
"engines": {
"node": ">= 12"
"node": ">= 18"
},
"directories": {
"lib": "lib"
},
"scripts": {
"prepublish": "npm run compile",
"pack": "npm pack --pack-destination ../generators/test/build",
"compile": "shx rm -rf lib/ && tsc && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts"
"compile": "npm run compile:cjs && npm run compile:esm && npm run pack",
"test": "mocha --config ../../.mocharc.json --recursive test/**.test.ts test/**/*.test.ts",
"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"
},
"publishConfig": {
"access": "public"
Expand All @@ -45,6 +47,8 @@
"README.md",
"src/**",
"lib/**",
"types/**",
"esm/**",
"*.d.ts",
"*.js"
],
Expand All @@ -57,5 +61,13 @@
"ts-node": "^10.9.2",
"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/errors/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"
}
}
}
2 changes: 1 addition & 1 deletion packages/knex/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PaginationOptions } from '@feathersjs/adapter-commons'
import { MethodNotAllowed } from '@feathersjs/errors/lib'
import { MethodNotAllowed } from '@feathersjs/errors'
import { Paginated, ServiceMethods, Id, NullableId, Params } from '@feathersjs/feathers'
import { KnexAdapter } from './adapter'
import { KnexAdapterParams } from './declarations'
Expand Down
2 changes: 1 addition & 1 deletion packages/mongodb/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PaginationOptions } from '@feathersjs/adapter-commons'
import { MethodNotAllowed } from '@feathersjs/errors/lib'
import { MethodNotAllowed } from '@feathersjs/errors'
import { Paginated, Params } from '@feathersjs/feathers'
import { AdapterId, MongoDbAdapter, MongoDBAdapterParams, NullableAdapterId } from './adapter'

Expand Down
2 changes: 1 addition & 1 deletion packages/transport-commons/src/http.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MethodNotAllowed } from '@feathersjs/errors/lib'
import { MethodNotAllowed } from '@feathersjs/errors'
import { HookContext, NullableId, Params } from '@feathersjs/feathers'
import encodeUrl from 'encodeurl'

Expand Down