emm....
- 0.12.0 upgrade nextjs to 9.0;
- 0.11.0 upgrade nextjs to 8.0; 引入外部自定义页面组件;
- 0.9.0 版本开始整个项目已经完成了组件化改造,提供了 clone/subtree 之外的开发方式;
- server.js
const { bootstrap } = require('./asuna-default-server');
bootstrap();
- next.config.js
const R = require('ramda');
const withCss = require('@zeit/next-css');
const { withDefaultNextConfigs } = require('./asuna-with-default-next');
module.exports = R.compose(
withCss,
withDefaultNextConfigs,
)();
- .babelrc
{
"presets": ["./asuna-babel"]
}
- add service/register.ts
import { AuthService } from './auth';
import { ModelService } from './model';
import { MenuService } from './menu';
import { ApiService } from './api';
import { SecurityService } from './security';
import { definitions } from './definitions';
import { Config, IIndexRegister, ILoginRegister } from '@asuna-admin';
Config.update({});
export const register: ILoginRegister & IIndexRegister = {
definitions,
authService: new AuthService(),
modelService: new ModelService(),
menuService: new MenuService(),
apiService: new ApiService(),
securityService: new SecurityService(),
};
- add pages/index.ts
import { renderIndexPage } from '@asuna-admin';
import getConfig from 'next/config';
import { register } from '../services/register';
export default renderIndexPage({ register }, getConfig());
- add pages/login.ts
import { renderLoginPage } from '@asuna-admin';
import getConfig from 'next/config';
import { register } from '../services/register';
export default renderLoginPage({ register }, getConfig());