asuna-admin
TypeScript icon, indicating that this package has built-in type declarations

0.13.5 • Public • Published

Asuna-Admin

travis-ci codecov Maintainability

FOSSA Status

Daniel Wei

Why Asuna-Admin

emm....

Roadmap

  • 0.12.0 upgrade nextjs to 9.0;
  • 0.11.0 upgrade nextjs to 8.0; 引入外部自定义页面组件;
  • 0.9.0 版本开始整个项目已经完成了组件化改造,提供了 clone/subtree 之外的开发方式;

Not Really Quick Start

  • 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());

Readme

Keywords

none

Package Sidebar

Install

npm i asuna-admin

Weekly Downloads

8

Version

0.13.5

License

MIT

Unpacked Size

354 kB

Total Files

166

Last publish

Collaborators

  • danielwii