-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: rewrite package to esmodules (#16) BREAKING CHANGE: The package won't support CJS anymore. * chore: use componentLoader instead of AdminJS.bundle BREAKING CHANGE: Configuration changed due to AdminJS.bundle being removed, use componentLoader instead
- Loading branch information
Showing
25 changed files
with
5,061 additions
and
6,079 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,3 +122,4 @@ dist | |
/lib | ||
/types | ||
example/.adminjs | ||
.nova |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"moduleFileExtensions": ["js", "json", "ts", "tsx"], | ||
"rootDir": "./test", | ||
"testEnvironment": "node", | ||
"testRegex": ".test.ts$", | ||
"extensionsToTreatAsEsm": [".ts"], | ||
"transformIgnorePatterns": ["node_modules"], | ||
"transform": { | ||
"^.+\\.(t|j)sx?$": [ | ||
"ts-jest", | ||
{ | ||
"useESM": true, | ||
"tsconfig": "./tsconfig.test.json", | ||
"isolatedModules": true | ||
} | ||
] | ||
}, | ||
"moduleNameMapper": { | ||
"^(\\.{1,2}/.*)\\.js$": "$1" | ||
}, | ||
"testTimeout": 10000, | ||
"preset": "ts-jest/presets/default-esm", | ||
"verbose": true, | ||
"silent": true, | ||
"forceExit": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
{ | ||
"name": "@adminjs/logger", | ||
"version": "4.0.1", | ||
"main": "lib/index.js", | ||
"types": "types/index.d.ts", | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": "./lib/index.js", | ||
"types": "./types/index.d.ts" | ||
} | ||
}, | ||
"private": false, | ||
"repository": "[email protected]:SoftwareBrothers/adminjs-logger.git", | ||
"license": "MIT", | ||
|
@@ -11,8 +16,8 @@ | |
"clean": "rimraf lib types", | ||
"build": "tsc", | ||
"dev": "tsc --watch", | ||
"test": "jest", | ||
"lint": "eslint -c '.eslintrc.js' './src/**/*'", | ||
"test": "NODE_OPTIONS=--experimental-vm-modules dotenv -e .env -- jest --config ./jest.json --runInBand --detectOpenHandles", | ||
"lint": "eslint -c '.eslintrc.cjs' './src/**/*'", | ||
"check:all": "yarn lint && yarn build && yarn test" | ||
}, | ||
"husky": { | ||
|
@@ -21,35 +26,34 @@ | |
} | ||
}, | ||
"peerDependencies": { | ||
"@adminjs/design-system": "^3.0.4", | ||
"adminjs": "^6.4.1" | ||
"adminjs": "^7.0.0" | ||
}, | ||
"devDependencies": { | ||
"@adminjs/design-system": "^3.0.4", | ||
"@commitlint/cli": "^8.3.5", | ||
"@commitlint/config-conventional": "^8.3.4", | ||
"@semantic-release/git": "^9.0.0", | ||
"@types/jest": "^26.0.14", | ||
"@types/lodash": "^4.14.186", | ||
"@typescript-eslint/eslint-plugin": "^5.16.0", | ||
"@typescript-eslint/parser": "^5.16.0", | ||
"adminjs": "^6.4.1", | ||
"eslint": "^8.11.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-plugin-react": "^7.29.4", | ||
"@commitlint/cli": "^17.4.4", | ||
"@commitlint/config-conventional": "^17.4.4", | ||
"@semantic-release/git": "^10.0.1", | ||
"@types/jest": "^29.5.0", | ||
"@types/lodash": "^4.14.191", | ||
"@typescript-eslint/eslint-plugin": "^5.56.0", | ||
"@typescript-eslint/parser": "^5.56.0", | ||
"adminjs": "^7.0.0", | ||
"dotenv-cli": "^7.1.0", | ||
"eslint": "^8.36.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "^7.32.2", | ||
"husky": "^4.3.0", | ||
"jest": "^26.5.3", | ||
"prettier": "^2.0.5", | ||
"rimraf": "^3.0.2", | ||
"semantic-release": "^17.0.7", | ||
"semantic-release-slack-bot": "^1.6.2", | ||
"ts-jest": "^26.4.1", | ||
"jest": "^29.5.0", | ||
"prettier": "^2.8.6", | ||
"rimraf": "^4.4.0", | ||
"semantic-release": "^20.1.3", | ||
"semantic-release-slack-bot": "^4.0.0", | ||
"ts-jest": "^29.0.5", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.4" | ||
"typescript": "^4.9.5" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.20" | ||
"lodash": "^4.17.21" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import path from 'path'; | ||
import * as url from 'url'; | ||
|
||
import type { ComponentLoader } from 'adminjs'; | ||
|
||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); | ||
|
||
export const bundleComponent = ( | ||
loader: ComponentLoader, | ||
componentName: string | ||
) => { | ||
const componentPath = path.join(__dirname, `../components/${componentName}`); | ||
return loader.add(componentName, componentPath); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.