@lilaquadrat/cli 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/functions/template.d.ts +9 -0
- package/lib/functions/template.js +62 -0
- package/lib/functions/template.js.map +1 -0
- package/lib/package.json +56 -0
- package/lib/src/config.d.ts +9 -0
- package/lib/src/config.js +54 -0
- package/lib/src/config.js.map +1 -0
- package/lib/src/config.prompt copy.d.ts +3 -0
- package/lib/src/config.prompt copy.js +64 -0
- package/lib/src/config.prompt copy.js.map +1 -0
- package/lib/src/config.prompt.d.ts +3 -0
- package/lib/src/config.prompt.js +29 -0
- package/lib/src/config.prompt.js.map +1 -0
- package/lib/src/create.prompt.d.ts +26 -0
- package/lib/src/create.prompt.js +48 -0
- package/lib/src/create.prompt.js.map +1 -0
- package/lib/src/definitions.d.ts +58 -0
- package/lib/src/definitions.js +99 -0
- package/lib/src/definitions.js.map +1 -0
- package/lib/src/index.d.ts +2 -0
- package/lib/src/index.js +112 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/login.d.ts +12 -0
- package/lib/src/login.js +202 -0
- package/lib/src/login.js.map +1 -0
- package/lib/src/logout.d.ts +2 -0
- package/lib/src/logout.js +13 -0
- package/lib/src/logout.js.map +1 -0
- package/lib/src/mode.prompt.d.ts +3 -0
- package/lib/src/mode.prompt.js +42 -0
- package/lib/src/mode.prompt.js.map +1 -0
- package/lib/src/publish.d.ts +2 -0
- package/lib/src/publish.js +91 -0
- package/lib/src/publish.js.map +1 -0
- package/lib/src/status.d.ts +2 -0
- package/lib/src/status.js +31 -0
- package/lib/src/status.js.map +1 -0
- package/lib/src/store.d.ts +6 -0
- package/lib/src/store.js +29 -0
- package/lib/src/store.js.map +1 -0
- package/lib/src/user.d.ts +11 -0
- package/lib/src/user.js +43 -0
- package/lib/src/user.js.map +1 -0
- package/package.json +56 -0
- package/source/apps/app.ts.hbs +10 -0
- package/source/apps/home.screen.vue.hbs +16 -0
- package/source/apps/routes.ts.hbs +15 -0
- package/source/moduleEditor/modules.html.hbs +27 -0
- package/source/moduleEditor/modules.ts.hbs +18 -0
- package/source/modules/modules.vue.hbs +21 -0
- package/source/partials/partials.vue.hbs +22 -0
- package/source/store/state.d.ts.hbs +6 -0
- package/source/store/store.ts.hbs +27 -0
package/lib/src/user.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isLoggedIn = exports.getPermissions = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const config_1 = require("./config");
|
|
9
|
+
const login_1 = require("./login");
|
|
10
|
+
exports.default = async () => {
|
|
11
|
+
let user;
|
|
12
|
+
const api = (0, config_1.getApi)();
|
|
13
|
+
try {
|
|
14
|
+
user = (await axios_1.default.get(`${api}/me`, {
|
|
15
|
+
headers: {
|
|
16
|
+
'studio-app': 'lilaquadrat-cli',
|
|
17
|
+
Authorization: `Bearer ${(0, login_1.token)()}`,
|
|
18
|
+
},
|
|
19
|
+
})).data;
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.error(error.status, error.message);
|
|
23
|
+
}
|
|
24
|
+
return user;
|
|
25
|
+
};
|
|
26
|
+
const getPermissions = async (company) => {
|
|
27
|
+
let permissions;
|
|
28
|
+
const api = (0, config_1.getApi)();
|
|
29
|
+
const url = company ?
|
|
30
|
+
`${api}/me/permissions/${company}` :
|
|
31
|
+
`${api}/me/permissions`;
|
|
32
|
+
permissions = (await axios_1.default.get(url, {
|
|
33
|
+
headers: {
|
|
34
|
+
'studio-app': 'lilaquadrat-cli',
|
|
35
|
+
Authorization: `Bearer ${(0, login_1.token)()}`,
|
|
36
|
+
},
|
|
37
|
+
})).data;
|
|
38
|
+
return permissions;
|
|
39
|
+
};
|
|
40
|
+
exports.getPermissions = getPermissions;
|
|
41
|
+
const isLoggedIn = () => !!(0, login_1.token)();
|
|
42
|
+
exports.isLoggedIn = isLoggedIn;
|
|
43
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/user.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qCAAkC;AAClC,mCAAgC;AAEhC,kBAAe,KAAK,IAAI,EAAE;IAExB,IAAI,IAAkB,CAAC;IAEvB,MAAM,GAAG,GAAG,IAAA,eAAM,GAAE,CAAC;IAErB,IAAI;QAEF,IAAI,GAAG,CAAC,MAAM,eAAK,CAAC,GAAG,CACrB,GAAG,GAAG,KAAK,EACX;YACE,OAAO,EAAE;gBACP,YAAY,EAAE,iBAAiB;gBAC/B,aAAa,EAAE,UAAU,IAAA,aAAK,GAAE,EAAE;aACnC;SACF,CACF,CAAC,CAAC,IAAI,CAAC;KAET;IAAC,OAAO,KAAK,EAAE;QAEd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;KAE5C;IAED,OAAO,IAAI,CAAC;AAEd,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,KAAK,EAAE,OAAgB,EAAE,EAAE;IAEhD,IAAI,WAAW,CAAC;IAEhB,MAAM,GAAG,GAAG,IAAA,eAAM,GAAE,CAAC;IAErB,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC;QACnB,GAAG,GAAG,mBAAmB,OAAO,EAAE,CAAC,CAAC;QACpC,GAAG,GAAG,iBAAiB,CAAC;IAG1B,WAAW,GAAG,CAAC,MAAM,eAAK,CAAC,GAAG,CAC5B,GAAG,EACH;QACE,OAAO,EAAE;YACP,YAAY,EAAE,iBAAiB;YAC/B,aAAa,EAAE,UAAU,IAAA,aAAK,GAAE,EAAE;SACnC;KACF,CACF,CAAC,CAAC,IAAI,CAAC;IAGR,OAAO,WAAW,CAAC;AAErB,CAAC,CAAC;AAKA,wCAAc;AAHhB,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,IAAA,aAAK,GAAE,CAAC;AAIjC,gCAAU"}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lilaquadrat/cli",
|
|
3
|
+
"version": "0.9.1",
|
|
4
|
+
"description": "CLI for studio app and studio renderer",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://lilaquadrat.de",
|
|
7
|
+
"author": {
|
|
8
|
+
"email": "m.schuebel@lila2.de",
|
|
9
|
+
"name": "Mathias Schübel",
|
|
10
|
+
"url": "https://lilaquadrat.de"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"prepublish": "tsc",
|
|
15
|
+
"cli": "node lib/src/index.js"
|
|
16
|
+
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=14",
|
|
19
|
+
"yarn": ">=1.22"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/archiver": "^5.3.1",
|
|
23
|
+
"@types/inquirer": "^8.1.3",
|
|
24
|
+
"@types/node": "^17.0.8",
|
|
25
|
+
"@typescript-eslint/eslint-plugin": "^5.9.1",
|
|
26
|
+
"@typescript-eslint/parser": "^5.9.1",
|
|
27
|
+
"eslint": "^8.6.0",
|
|
28
|
+
"eslint-config-airbnb-base": "15.0.0",
|
|
29
|
+
"eslint-config-airbnb-typescript": "^16.1.0",
|
|
30
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
|
31
|
+
"eslint-plugin-import": "^2.25.4",
|
|
32
|
+
"eslint-plugin-promise": "^6.0.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"archiver": "^5.0.0",
|
|
36
|
+
"axios": "^0.24.0",
|
|
37
|
+
"chalk": "^4.1.2",
|
|
38
|
+
"clear": "^0.1.0",
|
|
39
|
+
"commander": "^8.3.0",
|
|
40
|
+
"filesize": "^8.0.6",
|
|
41
|
+
"form-data": "^4.0.0",
|
|
42
|
+
"handlebars": "^4.7.6",
|
|
43
|
+
"inquirer": "^8.2.0",
|
|
44
|
+
"open": "^8.4.0",
|
|
45
|
+
"typescript": "^4.5.4"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"lib/**/*",
|
|
49
|
+
"source/**/*"
|
|
50
|
+
],
|
|
51
|
+
"bin": {
|
|
52
|
+
"lila": "lib/src/index.js"
|
|
53
|
+
},
|
|
54
|
+
"exports": "./lib/src/index.js",
|
|
55
|
+
"types": "lib/src/index.d.ts"
|
|
56
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article :class="navigationAnimation" class="app-{{name}}-home-screen">
|
|
3
|
+
<h1>{{name}} app home</h1>
|
|
4
|
+
</article>
|
|
5
|
+
</template>
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import { ExtComponent, Component } from '@libs/lila-component';
|
|
8
|
+
|
|
9
|
+
@Component
|
|
10
|
+
export default class App{{nameUppercase}}HomeScreen extends ExtComponent {
|
|
11
|
+
|
|
12
|
+
componentName = 'app-{{name}}-home';
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProjectGuard } from '@libs/lila-auth';
|
|
2
|
+
|
|
3
|
+
const loadScreen = (screen: string) => () => import(
|
|
4
|
+
/* webpackChunkName: "app-{{name}}" */
|
|
5
|
+
`./screens/${screen}`
|
|
6
|
+
).then((m) => m.default);
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
{
|
|
10
|
+
path: '/:company/:project/a/{{name}}',
|
|
11
|
+
name: 'app-{{name}}-home',
|
|
12
|
+
beforeEnter: ProjectGuard,
|
|
13
|
+
component: loadScreen('home.screen.vue'),
|
|
14
|
+
},
|
|
15
|
+
];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<section class="{{name}}-module-editor editor" :class="{open: type !== 'overview', changed: content.changed}">
|
|
2
|
+
|
|
3
|
+
<module-editor-header-partial @move="move($event)" :content="content" :index="index" :type="type"></module-editor-header-partial>
|
|
4
|
+
<crumbs-partial v-if="type !== 'overview'"></crumbs-partial>
|
|
5
|
+
|
|
6
|
+
<section v-if="type !== 'overview'" class="editor-module-container">
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<ul class="module-editor-navigation" v-if="!child">
|
|
10
|
+
<li><button @click="setChild('textblock')">\{{'textblock' | translate}}</button></li>
|
|
11
|
+
</ul>
|
|
12
|
+
|
|
13
|
+
<textblock-partial-editor v-if="child === 'textblock'" :content="content.textblock" />
|
|
14
|
+
|
|
15
|
+
//add editor inputs here
|
|
16
|
+
|
|
17
|
+
<editor-content-group-partial v-if="!child && editorCrumbs.length === 0" closed title="OPTIONS">
|
|
18
|
+
<select-partial v-if="typeof content.variant !== 'undefined'" placeholder="NO_VARIANTS_CHOOSEN"
|
|
19
|
+
:options="availableVariants" v-model="content.variant">\{{'variant' | translate}}</select-partial>
|
|
20
|
+
<controls-partial-editor @remove="remove()" @clone="clone()" v-model="content.id"></controls-partial-editor>
|
|
21
|
+
</editor-content-group-partial>
|
|
22
|
+
|
|
23
|
+
</section>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</section>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExtComponent, Component, Prop } from '@libs/lila-component';
|
|
2
|
+
import { EditorComponent } from '@libs/lila-editor';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
template: require('./{{name}}.module.editor.html'),
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export default class {{name}}EditorModule extends EditorComponent {
|
|
9
|
+
|
|
10
|
+
@Prop(Object) content: any;
|
|
11
|
+
model = {{name}}EditorModel;
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
{{name}}EditorModule,
|
|
18
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="{{name}}">
|
|
3
|
+
</section>
|
|
4
|
+
</template>
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { ExtComponent, Component, Prop } from '@libs/lila-component';
|
|
7
|
+
|
|
8
|
+
@Component
|
|
9
|
+
export default class {{nameCamelCase}}Partial extends ExtComponent {
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
<style lang="less" scoped>
|
|
15
|
+
@import (reference) "../source/editor/less/_base/shared.less";
|
|
16
|
+
|
|
17
|
+
.{{name}} {
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section class="{{name}}">
|
|
3
|
+
</section>
|
|
4
|
+
</template>
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import Vue from 'vue';
|
|
7
|
+
import Component from 'vue-class-component';
|
|
8
|
+
|
|
9
|
+
@Component
|
|
10
|
+
export default class {{nameCamelCase}}Partial extends Vue {
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
<style lang="less" scoped>
|
|
16
|
+
@import (reference) "../source/editor/less/_base/shared.less";
|
|
17
|
+
|
|
18
|
+
.{{name}} {
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {{nameCamelCase}} from './{{name}}.interface'
|
|
2
|
+
|
|
3
|
+
const {{name}}Store: GenericStore<{{nameCamelCase}}StoreState> = {
|
|
4
|
+
namespaced: true,
|
|
5
|
+
strict: true,
|
|
6
|
+
|
|
7
|
+
// state default
|
|
8
|
+
state: {
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
mutations: {
|
|
12
|
+
|
|
13
|
+
sampleMutation(state) {
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
actions: {
|
|
19
|
+
|
|
20
|
+
sampleAction(store, data) {
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default {{name}}Store;
|