README
@uxf/cms
Rozdělení balíčku
- @uxf/cms/ui - UI komponenty
- @uxf/cms/form - Formulářové prvky
- @uxf/cms/pages - NextJS stránky
- @uxf/cms/lab - Komponenty které ještě nejsou odladěné na stabilní verzi
Použití balíčku
Konfigurace balíčku se prvádí v souboru _app.tsx
.
// _app.tsx
import { config, container } from "@uxf/cms/config";
cmsConfig.set("api-url", "== api url ==");
container
.register("router", Router<any>)
.register("service.error", ErrorService)
.register("service.notification", FlashMessagesService)
.register("useLoggedUser", UseLoggedUser)
.register("api.getLoggedUser", GetLoggedUser)
.register("api.getUserConfig", GetUserConfig);
Api
- cookie je předávána automaticky z kontextu
import {...} from "@uxf/cms/api";
getLoggedUser
getEntityMetaSchemas
getFormSchema
getFormValues
login
autocompleteRows
saveFormValues
userConfigSave
userConfigGetAll
userConfigGet
FlashMessages
// pages/_app.tsx
import { FlashMessagesContainerInstance } from "@uxf/cms/lib/FlashMessages";
function App(props: any) {
const { Component, pageProps } = props;
return (
<>
<Component {...pageProps} />
<FlashMessagesContainerInstance />
</>
);
}
export default App;
// pages/index.tsx
import { FlashMessagesService } from "@uxf/cms/services/FlashMessagesService";
function IndexPage(props) {
return <Button onClick={() => FlashMessagesService.success("Hotovo.")}>Klikni</Button>;
}
export default IndexPage;
Jak vyvíjet?
git clone git@gitlab.com:uxf-npm/cms.git
cd ./cms
npm install
Spuštění examplu:
npm run dev
Vydání balíčku:
Balíček se vydá po mergi do master
branche.
K publikování nových verzí do npm je opužit balíček semantic-release .
Jak má vypadat commit message?
https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines
Commit message | Release type |
---|---|
fix(pencil): stop graphite breaking when too much pressure applied |
Patch Release |
feat(pencil): add 'graphiteWidth' option |
|
perf(pencil): remove graphiteWidth option BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reasons. |