Skip to content

Commit

Permalink
feat: change to ECMAScript modules, replaced AdminJS.bundle with Comp…
Browse files Browse the repository at this point in the history
…onentLoader,
  • Loading branch information
Jarosław Wasiak committed Apr 4, 2023
1 parent 8a90f11 commit bb3a542
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'*/dist/**/*',
'*.json',
'*.txt',
'*.mp4',
'yarn.lock',
'*.yaml',
'*.md',
Expand Down
2 changes: 2 additions & 0 deletions example-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import AdminJS from 'adminjs'
import AdminJSExpress from '@adminjs/express'
import { Database, Resource } from '@adminjs/typeorm'
import { createConnection } from 'typeorm'
import { componentLoader } from './admin/component-loader.js'

import createPhotoResource from './admin/resources/photo/photo.resource.js'
import createUserResource from './admin/resources/user/user.resource.js'
Expand All @@ -27,6 +28,7 @@ const run = async () => {
const app = express()
app.use('/public', express.static('public'))
const admin = new AdminJS({
componentLoader,
resources: [
createPhotoResource(),
createUserResource(),
Expand Down
3 changes: 2 additions & 1 deletion example-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": ["cypress"],
"skipLibCheck": true,
},
"include": [ "ormconfig.js", "./src/**/*", "./cypress/**/*"]
"include": [ "ormconfig.js", "./src/**/*", "./cypress/**/*", "../src/**/*"]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ShowPropertyProps } from 'adminjs'
import React, { FC } from 'react'

import File from './file.js'
import File from './file.jsx'

const List: FC<ShowPropertyProps> = (props) => (<File width={100} {...props} />)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FormGroup, Label } from '@adminjs/design-system'
import { ShowPropertyProps } from 'adminjs'
import React, { FC } from 'react'

import File from './file.js'
import File from './file.jsx'

const Show: FC<ShowPropertyProps> = (props) => {
const { property } = props
Expand Down

0 comments on commit bb3a542

Please sign in to comment.