-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: replace AdminJS.bundle with ComponentLoader (#15)
BREAKING CHANGE: The package now requires you to provide your ComponentLoader instance. --------- Co-authored-by: Jarosław Wasiak <[email protected]> Co-authored-by: Rafal Dziegielewski <[email protected]>
- Loading branch information
1 parent
2a6dd82
commit e649a04
Showing
7 changed files
with
892 additions
and
1,730 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,4 +162,4 @@ build | |
|
||
example-app/cypress/videos | ||
|
||
.nova | ||
.nova |
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,18 @@ | ||
import path from 'path' | ||
import * as url from 'url' | ||
|
||
import type { ComponentLoader } from 'adminjs' | ||
|
||
// eslint-disable-next-line no-underscore-dangle | ||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) | ||
|
||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types | ||
const bundleComponent = ( | ||
loader: ComponentLoader, | ||
componentName: string, | ||
) => { | ||
const componentPath = path.join(__dirname, `./components/${componentName}`) | ||
return loader.add(componentName, componentPath) | ||
} | ||
|
||
export default bundleComponent |
File renamed without changes.
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
Oops, something went wrong.