@lilaquadrat/cli 0.10.1 → 0.10.4
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 +0 -0
- package/lib/functions/template.js +24 -49
- package/lib/functions/template.js.map +1 -1
- package/lib/src/config.d.ts +4 -2
- package/lib/src/config.js +27 -28
- package/lib/src/config.js.map +1 -1
- package/lib/src/config.prompt.d.ts +0 -0
- package/lib/src/config.prompt.js +4 -6
- package/lib/src/config.prompt.js.map +1 -1
- package/lib/src/create.prompt.d.ts +0 -0
- package/lib/src/create.prompt.js +8 -13
- package/lib/src/create.prompt.js.map +1 -1
- package/lib/src/definitions.d.ts +0 -0
- package/lib/src/definitions.js +1 -3
- package/lib/src/definitions.js.map +1 -1
- package/lib/src/helpers/readFolder.d.ts +21 -0
- package/lib/src/helpers/readFolder.js +53 -0
- package/lib/src/helpers/readFolder.js.map +1 -0
- package/lib/src/index.d.ts +0 -0
- package/lib/src/index.js +106 -65
- package/lib/src/index.js.map +1 -1
- package/lib/src/login.d.ts +1 -1
- package/lib/src/login.js +97 -81
- package/lib/src/login.js.map +1 -1
- package/lib/src/logout.d.ts +0 -0
- package/lib/src/logout.js +5 -10
- package/lib/src/logout.js.map +1 -1
- package/lib/src/mode.prompt.d.ts +0 -0
- package/lib/src/mode.prompt.js +15 -3
- package/lib/src/mode.prompt.js.map +1 -1
- package/lib/src/publish.d.ts +0 -0
- package/lib/src/publish.js +22 -135
- package/lib/src/publish.js.map +1 -1
- package/lib/src/status.d.ts +0 -0
- package/lib/src/status.js +13 -18
- package/lib/src/status.js.map +1 -1
- package/lib/src/storage.d.ts +5 -0
- package/lib/src/storage.js +26 -0
- package/lib/src/storage.js.map +1 -0
- package/lib/src/store.d.ts +0 -0
- package/lib/src/store.js +6 -11
- package/lib/src/store.js.map +1 -1
- package/lib/src/user.d.ts +0 -0
- package/lib/src/user.js +12 -19
- package/lib/src/user.js.map +1 -1
- package/package.json +20 -14
- package/source/apps/app.ts.hbs +0 -0
- package/source/apps/de.ts.hbs +0 -0
- package/source/apps/home.screen.vue.hbs +10 -17
- package/source/apps/main-state.interface.ts.hbs +1 -1
- package/source/apps/main.store.ts.hbs +0 -0
- package/source/apps/routes.ts.hbs +2 -2
- package/source/apps/single.screen.vue.hbs +2 -2
- package/source/apps/translations.ts.hbs +0 -0
- package/source/design/.storybook/.babelrc +0 -0
- package/source/design/.storybook/preview-body.html +0 -0
- package/source/design/index.html +0 -0
- package/source/design/index.server.html +0 -0
- package/source/design/models.ts +0 -0
- package/source/design/modules.ts +0 -0
- package/source/design/server/app-server.ts +0 -0
- package/source/design/server/server-entry.ts +0 -0
- package/source/design/source/fonts/OpenSans-Regular.woff +0 -0
- package/source/design/source/fonts/OpenSans-SemiBold.woff +0 -0
- package/source/design/source/fonts/OpenSansSemiCondensed-ExtraBold.woff +0 -0
- package/source/design/source/less/base.less +0 -0
- package/source/design/source/less/fonts.less +0 -0
- package/source/design/source/less/shared.less +0 -0
- package/source/design/source/less/variables.less +0 -0
- package/source/design/translations/de.ts +0 -0
- package/source/designFiles/app.ts.hbs +0 -0
- package/source/designFiles/main.js.hbs +0 -0
- package/source/designFiles/preview.js.hbs +0 -0
- package/source/moduleEditor/modules.html.hbs +0 -0
- package/source/moduleEditor/modules.ts.hbs +0 -0
- package/source/modules/modules.vue.hbs +0 -0
- package/source/partials/partials.vue.hbs +0 -0
- package/source/store/state.d.ts.hbs +0 -0
- package/source/store/store.ts.hbs +0 -0
- package/lib/package.json +0 -68
package/lib/src/mode.prompt.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
const data = [
|
|
4
2
|
{
|
|
5
3
|
type: 'list',
|
|
@@ -31,6 +29,20 @@ const data = [
|
|
|
31
29
|
validate: (input) => !!input,
|
|
32
30
|
when: (answers) => answers.mode === 'custom',
|
|
33
31
|
},
|
|
32
|
+
{
|
|
33
|
+
type: 'input',
|
|
34
|
+
name: 'customEndpointPublic',
|
|
35
|
+
message: 'custom public endpoint',
|
|
36
|
+
validate: (input) => !!input,
|
|
37
|
+
when: (answers) => answers.mode === 'custom',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: 'input',
|
|
41
|
+
name: 'customEndpointSecure',
|
|
42
|
+
message: 'custom secure endpoint',
|
|
43
|
+
validate: (input) => !!input,
|
|
44
|
+
when: (answers) => answers.mode === 'custom',
|
|
45
|
+
},
|
|
34
46
|
{
|
|
35
47
|
type: 'confirm',
|
|
36
48
|
name: 'dev',
|
|
@@ -38,5 +50,5 @@ const data = [
|
|
|
38
50
|
default: false,
|
|
39
51
|
},
|
|
40
52
|
];
|
|
41
|
-
|
|
53
|
+
export default data;
|
|
42
54
|
//# sourceMappingURL=mode.prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mode.prompt.js","sourceRoot":"","sources":["../../src/mode.prompt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mode.prompt.js","sourceRoot":"","sources":["../../src/mode.prompt.ts"],"names":[],"mappings":"AAEA,MAAM,IAAI,GAAgC;IACxC;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,MAAM;QACf,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,0CAA0C;gBAChD,KAAK,EAAE,MAAM;aACd;YACD;gBACE,IAAI,EAAE,qCAAqC;gBAC3C,KAAK,EAAE,MAAM;aACd;YACD,QAAQ;SACT;KACF;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,uBAAuB;QAChC,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK;QACpC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ;KAC7C;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,qBAAqB;QAC9B,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK;QACpC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ;KAC7C;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,wBAAwB;QACjC,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK;QACpC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ;KAC7C;IACD;QACE,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,sBAAsB;QAC5B,OAAO,EAAE,wBAAwB;QACjC,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK;QACpC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ;KAC7C;IACD;QACE,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE,KAAK;KACf;CACF,CAAC;AACF,eAAe,IAAI,CAAC"}
|
package/lib/src/publish.d.ts
CHANGED
|
File without changes
|
package/lib/src/publish.js
CHANGED
|
@@ -1,151 +1,38 @@
|
|
|
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
1
|
/* eslint-disable no-console */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
13
|
-
const https_1 = __importDefault(require("https"));
|
|
14
|
-
const login_1 = require("./login");
|
|
15
|
-
const store_1 = __importDefault(require("./store"));
|
|
16
|
-
const calculateVersion = (settings) => {
|
|
17
|
-
if (settings.isVite)
|
|
18
|
-
return 3;
|
|
19
|
-
return 1;
|
|
20
|
-
};
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { token } from './login.js';
|
|
4
|
+
import Store from './store.js';
|
|
5
|
+
import readFolder from './helpers/readFolder.js';
|
|
6
|
+
import StorageSDK from '@lilaquadrat/storage-sdk';
|
|
21
7
|
async function publishFunction(type, company, project) {
|
|
22
8
|
let base = true;
|
|
23
|
-
console.log(
|
|
9
|
+
console.log(chalk.bgBlack.white(`<--- start PUBLISH - ${type}`));
|
|
24
10
|
console.log(' ');
|
|
25
11
|
if (company?.length && project?.length) {
|
|
26
12
|
base = false;
|
|
27
13
|
}
|
|
28
14
|
if (base) {
|
|
29
|
-
console.log(
|
|
15
|
+
console.log(chalk.bgBlack.white('publish to base'));
|
|
30
16
|
}
|
|
31
17
|
else {
|
|
32
|
-
console.log(
|
|
18
|
+
console.log(chalk.bgBlack.white(`publish to project ${company} / ${project}`));
|
|
33
19
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
bundleName: isVite ? 'server-entry.js' : 'server.bundle.json',
|
|
44
|
-
index: isVite ? `${process.cwd()}/index.server.html` : `${baseUrl}/index.server.html`,
|
|
45
|
-
indexName: 'index.server.html',
|
|
46
|
-
indexMail: isVite ? `${process.cwd()}/index.mail.html` : undefined,
|
|
47
|
-
indexMailName: 'index.mail.html',
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
const promise = new Promise((resolve, reject) => {
|
|
51
|
-
/**
|
|
52
|
-
* check if the publishEndpoint is set
|
|
53
|
-
*/
|
|
54
|
-
if (!store.get().endpoints.media)
|
|
55
|
-
return reject(new Error('publishEndpoint not set, use "cli config"'));
|
|
56
|
-
if (store.get().dev) {
|
|
57
|
-
console.warn(chalk_1.default.bgRed.white(`
|
|
58
|
-
**************************************************
|
|
59
|
-
WARNING
|
|
60
|
-
DEV mode is active
|
|
61
|
-
untrusted SSL certificates wont be rejected
|
|
62
|
-
**************************************************
|
|
63
|
-
`));
|
|
64
|
-
}
|
|
65
|
-
const fileStream = fs_1.default.createWriteStream(`${process.cwd()}/publish.zip`);
|
|
66
|
-
const archive = (0, archiver_1.default)('zip');
|
|
67
|
-
fileStream.on('end', () => {
|
|
68
|
-
console.log('tar finished');
|
|
69
|
-
});
|
|
70
|
-
fileStream.on('close', () => {
|
|
71
|
-
console.log(chalk_1.default.bgGray.white(`${(0, filesize_1.filesize)(archive.pointer())} total`));
|
|
72
|
-
console.log(chalk_1.default.bgGreen.black('file created'));
|
|
73
|
-
return resolve();
|
|
74
|
-
});
|
|
75
|
-
archive.on('warning', (err) => {
|
|
76
|
-
console.error(err);
|
|
77
|
-
});
|
|
78
|
-
archive.on('error', (err) => reject(err));
|
|
79
|
-
archive.pipe(fileStream);
|
|
80
|
-
if (type === 'app')
|
|
81
|
-
archive.directory(filePaths.app, false);
|
|
82
|
-
if (type === 'server') {
|
|
83
|
-
if (!fs_1.default.existsSync(filePaths.server.bundle)) {
|
|
84
|
-
return reject(new Error(`server bundle not found. used path: ${filePaths.server.bundle}`));
|
|
85
|
-
}
|
|
86
|
-
if (!fs_1.default.existsSync(filePaths.server.index)) {
|
|
87
|
-
return reject(new Error(`index server not found. used path: ${filePaths.server.index}`));
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* mails are only supported start version 3
|
|
91
|
-
*/
|
|
92
|
-
if (isVite) {
|
|
93
|
-
if (!fs_1.default.existsSync(filePaths.server.indexMail)) {
|
|
94
|
-
return reject(new Error(`index mail not found. used path: ${filePaths.server.indexMail}`));
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (isVite) {
|
|
98
|
-
archive.append(fs_1.default.createReadStream(`${process.cwd()}/dist/server/.vite/ssr-manifest.json`), { name: 'ssr-manifest.json' });
|
|
99
|
-
}
|
|
100
|
-
archive.append(fs_1.default.createReadStream(filePaths.server.bundle), { name: filePaths.server.bundleName });
|
|
101
|
-
archive.append(fs_1.default.createReadStream(filePaths.server.index), { name: filePaths.server.indexName });
|
|
102
|
-
if (isVite) {
|
|
103
|
-
archive.append(fs_1.default.createReadStream(filePaths.server.indexMail), { name: filePaths.server.indexMailName });
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return archive.finalize();
|
|
107
|
-
});
|
|
108
|
-
try {
|
|
109
|
-
await promise;
|
|
20
|
+
const store = new Store(`${process.cwd()}/.lila`);
|
|
21
|
+
const storageSdk = new StorageSDK({
|
|
22
|
+
api: store.get().endpoints.media,
|
|
23
|
+
secure: store.get().endpoints.secure,
|
|
24
|
+
public: store.get().endpoints.public,
|
|
25
|
+
}, store.get().uploadConcurrency || 5, store.get().dev ? 'debug' : 'info', token());
|
|
26
|
+
if (type === 'app') {
|
|
27
|
+
const files = readFolder('./dist/app/', { prefix: 'editor' });
|
|
28
|
+
await storageSdk.uploadMultiple(files, { company, project, overwrite: true, app: 'media' });
|
|
110
29
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return;
|
|
30
|
+
if (type === 'server') {
|
|
31
|
+
const files = readFolder('./dist/server', { exclude: { extensions: ['.css'] } });
|
|
32
|
+
await storageSdk.uploadMultiple(files, { company, project, overwrite: true, app: 'html' });
|
|
115
33
|
}
|
|
116
|
-
const form = new form_data_1.default();
|
|
117
|
-
form.append('file', fs_1.default.createReadStream(`${process.cwd()}/publish.zip`));
|
|
118
|
-
form.append('version', calculateVersion(store.get()));
|
|
119
|
-
console.log(chalk_1.default.bgGreen.black('publish started'));
|
|
120
|
-
const urlArray = [store.get().endpoints.media, 'editor'];
|
|
121
|
-
if (base) {
|
|
122
|
-
urlArray.push('lilaquadrat');
|
|
123
|
-
urlArray.push('base');
|
|
124
|
-
urlArray.push('base');
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
urlArray.push(company);
|
|
128
|
-
urlArray.push(project);
|
|
129
|
-
}
|
|
130
|
-
urlArray.push(type);
|
|
131
|
-
const useUrl = urlArray.join('/');
|
|
132
|
-
await axios_1.default.create({ headers: { ...form.getHeaders(), ...{ Authorization: `Bearer ${(0, login_1.token)()}`, 'studio-app': 'cli' } } })
|
|
133
|
-
.post(useUrl, form, {
|
|
134
|
-
httpsAgent: new https_1.default.Agent({
|
|
135
|
-
rejectUnauthorized: false,
|
|
136
|
-
}),
|
|
137
|
-
})
|
|
138
|
-
.then(() => console.log(chalk_1.default.bgGreen.black('publish succesful')))
|
|
139
|
-
.catch((e) => {
|
|
140
|
-
console.log(' ');
|
|
141
|
-
console.log(`used url ${useUrl}`);
|
|
142
|
-
console.log(' ');
|
|
143
|
-
console.error(chalk_1.default.bgRed.white(e.message));
|
|
144
|
-
console.log(' ');
|
|
145
|
-
});
|
|
146
|
-
fs_1.default.unlinkSync(`${process.cwd()}/publish.zip`);
|
|
147
34
|
console.log(' ');
|
|
148
|
-
console.log(
|
|
35
|
+
console.log(chalk.bgBlack.white('PUBLISH end --->'));
|
|
149
36
|
}
|
|
150
|
-
|
|
37
|
+
export default publishFunction;
|
|
151
38
|
//# sourceMappingURL=publish.js.map
|
package/lib/src/publish.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/publish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/publish.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAIlD,KAAK,UAAU,eAAe,CAAC,IAAsB,EAAE,OAAgB,EAAE,OAAgB;IAEvF,IAAI,IAAI,GAAG,IAAI,CAAC;IAEhB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAElB,IAAI,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QAEvC,IAAI,GAAG,KAAK,CAAC;IAEf,CAAC;IAED,IAAI,IAAI,EAAE,CAAC;QAET,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAEtD,CAAC;SAAM,CAAC;QAEN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,sBAAsB,OAAO,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC;IAEjF,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAElD,MAAM,UAAU,GAAG,IAAI,UAAU,CAC/B;QACE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK;QAChC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM;QACpC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM;KACrC,EACD,KAAK,CAAC,GAAG,EAAE,CAAC,iBAAiB,IAAI,CAAC,EAClC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAClC,KAAK,EAAE,CACR,CAAC;IAEF,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QAEnB,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC,CAAC;QAC5D,MAAM,UAAU,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IAE9F,CAAC;IAED,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QAEtB,MAAM,KAAK,GAAG,UAAU,CAAC,eAAe,EAAE,EAAC,OAAO,EAAE,EAAC,UAAU,EAAE,CAAC,MAAM,CAAC,EAAC,EAAC,CAAC,CAAC;QAC7E,MAAM,UAAU,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;IAE7F,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAEvD,CAAC;AACD,eAAe,eAAe,CAAC"}
|
package/lib/src/status.d.ts
CHANGED
|
File without changes
|
package/lib/src/status.js
CHANGED
|
@@ -1,33 +1,28 @@
|
|
|
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
1
|
/* eslint-disable max-len */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const localStore = new
|
|
2
|
+
import Store from './store.js';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
export default async () => {
|
|
6
|
+
const localStore = new Store(`${process.cwd()}/.lila`);
|
|
12
7
|
const localData = localStore.get();
|
|
13
|
-
const store = new
|
|
8
|
+
const store = new Store(`${os.homedir()}/.lilaquadrat`);
|
|
14
9
|
const storeData = store.get();
|
|
15
10
|
if (localData.mode)
|
|
16
|
-
console.log(`Mode set to ${
|
|
11
|
+
console.log(`Mode set to ${chalk.green.bold(localData.mode)}`);
|
|
17
12
|
if (!localData.mode)
|
|
18
|
-
console.log(
|
|
13
|
+
console.log(chalk.red.bold('Mode NOT set.'), chalk.grey('yarn cli mode'));
|
|
19
14
|
if (storeData.token?.access_token)
|
|
20
|
-
console.log(`Logged in
|
|
15
|
+
console.log(`Logged in`);
|
|
21
16
|
if (!storeData.token?.access_token)
|
|
22
|
-
console.log(
|
|
17
|
+
console.log(chalk.green.red.bold('NOT logged in.'), chalk.grey('yarn cli login'));
|
|
23
18
|
if (localData.publish?.company)
|
|
24
|
-
console.log(`Publish set to company ${
|
|
19
|
+
console.log(`Publish set to company ${chalk.green.bold(localData.publish?.company)} and project ${chalk.green.bold(localData.publish?.project)}.`);
|
|
25
20
|
if (!localData.publish?.company)
|
|
26
|
-
console.log(
|
|
21
|
+
console.log(chalk.green.red.bold('Publish NOT set.'), chalk.grey('yarn cli config'));
|
|
27
22
|
if (localData.isVite)
|
|
28
23
|
console.log('VITE is detected');
|
|
29
24
|
console.log(`
|
|
30
|
-
${localData.dev ?
|
|
25
|
+
${localData.dev ? chalk.green.red.bold('dev mode is ACTIVE') : chalk.grey.bold('dev mode is inactive')}
|
|
31
26
|
`);
|
|
32
27
|
};
|
|
33
28
|
//# sourceMappingURL=status.js.map
|
package/lib/src/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/status.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAe,KAAK,IAAI,EAAE;IAExB,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC;IAEnC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;IAE9B,IAAI,SAAS,CAAC,IAAI;QAAE,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnF,IAAI,CAAC,SAAS,CAAC,IAAI;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IAE/F,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY;QAAE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC5D,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,YAAY;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEtH,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,gBAAgB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACnL,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACtH,IAAI,SAAS,CAAC,MAAM;QAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAEtD,OAAO,CAAC,GAAG,CAAC;EACZ,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC;CACrG,CAAC,CAAC;AAIH,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { token } from './login.js';
|
|
3
|
+
import Store from './store.js';
|
|
4
|
+
import readFolder from './helpers/readFolder.js';
|
|
5
|
+
import StorageSDK from '@lilaquadrat/storage-sdk';
|
|
6
|
+
async function storageFunction(path, options) {
|
|
7
|
+
console.log(chalk.bgBlack.white(`<--- start STORAGE - ${options.app}`));
|
|
8
|
+
console.log(' ');
|
|
9
|
+
const store = new Store(`${process.cwd()}/.lila`);
|
|
10
|
+
const storageSdk = new StorageSDK({
|
|
11
|
+
api: store.get().endpoints.media,
|
|
12
|
+
secure: store.get().endpoints.secure,
|
|
13
|
+
public: store.get().endpoints.public,
|
|
14
|
+
}, store.get().uploadConcurrency || 5, store.get().dev ? 'debug' : 'info', token());
|
|
15
|
+
const files = readFolder(path, options);
|
|
16
|
+
await storageSdk.uploadMultiple(files, {
|
|
17
|
+
company: store.get().publish.company,
|
|
18
|
+
project: store.get().publish.project,
|
|
19
|
+
overwrite: true,
|
|
20
|
+
app: options.app
|
|
21
|
+
});
|
|
22
|
+
console.log(' ');
|
|
23
|
+
console.log(chalk.bgBlack.white('STORAGE end --->'));
|
|
24
|
+
}
|
|
25
|
+
export default storageFunction;
|
|
26
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,KAAK,UAAU,eAAe,CAAC,IAAY,EAAE,OAAuC;IAElF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,wBAAwB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAElB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAElD,MAAM,UAAU,GAAG,IAAI,UAAU,CAC/B;QACE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK;QAChC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM;QACpC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM;KACrC,EACD,KAAK,CAAC,GAAG,EAAE,CAAC,iBAAiB,IAAI,CAAC,EAClC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAClC,KAAK,EAAE,CACR,CAAC;IAEF,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAExC,MAAM,UAAU,CAAC,cAAc,CAC7B,KAAK,EACL;QACE,OAAO,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO;QACpC,OAAO,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO;QACpC,SAAS,EAAE,IAAI;QACf,GAAG,EAAE,OAAO,CAAC,GAAG;KACjB,CACF,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAEvD,CAAC;AACD,eAAe,eAAe,CAAC"}
|
package/lib/src/store.d.ts
CHANGED
|
File without changes
|
package/lib/src/store.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
class Store {
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
export default class Store {
|
|
3
|
+
storePath;
|
|
8
4
|
constructor(storePath) {
|
|
9
5
|
this.storePath = storePath;
|
|
10
6
|
}
|
|
11
7
|
get() {
|
|
12
8
|
let data;
|
|
13
|
-
if (!
|
|
9
|
+
if (!fs.existsSync(this.storePath))
|
|
14
10
|
return {};
|
|
15
11
|
try {
|
|
16
|
-
data = JSON.parse(
|
|
12
|
+
data = JSON.parse(fs.readFileSync(this.storePath).toString());
|
|
17
13
|
}
|
|
18
14
|
catch (e) {
|
|
19
15
|
data = {};
|
|
@@ -22,8 +18,7 @@ class Store {
|
|
|
22
18
|
}
|
|
23
19
|
set(newData) {
|
|
24
20
|
const data = this.get();
|
|
25
|
-
|
|
21
|
+
fs.writeFileSync(this.storePath, JSON.stringify({ ...data, ...newData }, null, 2));
|
|
26
22
|
}
|
|
27
23
|
}
|
|
28
|
-
exports.default = Store;
|
|
29
24
|
//# sourceMappingURL=store.js.map
|
package/lib/src/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,CAAC,OAAO,OAAO,KAAK;IAExB,SAAS,CAAS;IAElB,YAAY,SAAiB;QAE3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAE7B,CAAC;IAED,GAAG;QAED,IAAI,IAA4B,CAAC;QAEjC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;YAAE,OAAO,EAAE,CAAC;QAE9C,IAAI,CAAC;YAEH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEhE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YAEX,IAAI,GAAG,EAAE,CAAC;QAEZ,CAAC;QAED,OAAO,IAAI,CAAC;IAEd,CAAC;IAED,GAAG,CAAI,OAAmB;QAExB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAO,CAAC;QAE7B,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAErF,CAAC;CAEF"}
|
package/lib/src/user.d.ts
CHANGED
|
File without changes
|
package/lib/src/user.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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");
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { getApi } from './config.js';
|
|
3
|
+
import { token } from './login.js';
|
|
10
4
|
let permissionsCache = null;
|
|
11
|
-
|
|
5
|
+
export default async () => {
|
|
12
6
|
let user;
|
|
13
|
-
const api =
|
|
7
|
+
const api = getApi();
|
|
14
8
|
try {
|
|
15
|
-
user = (await
|
|
9
|
+
user = (await axios.get(`${api}/me`, {
|
|
16
10
|
headers: {
|
|
17
11
|
'studio-app': 'lilaquadrat-cli',
|
|
18
|
-
Authorization: `Bearer ${
|
|
12
|
+
Authorization: `Bearer ${token()}`,
|
|
19
13
|
},
|
|
20
14
|
})).data;
|
|
21
15
|
}
|
|
@@ -26,23 +20,22 @@ exports.default = async () => {
|
|
|
26
20
|
};
|
|
27
21
|
const getPermissions = async (noCache) => {
|
|
28
22
|
let permissions;
|
|
29
|
-
const api =
|
|
23
|
+
const api = getApi();
|
|
30
24
|
const url = `${api}/me/permissions`;
|
|
31
25
|
if (permissionsCache && !noCache) {
|
|
32
26
|
console.log('use cache');
|
|
33
27
|
return permissionsCache;
|
|
34
28
|
}
|
|
35
|
-
const apiResponse = await
|
|
29
|
+
const apiResponse = await axios.get(url, {
|
|
36
30
|
headers: {
|
|
37
31
|
'studio-app': 'lilaquadrat-cli',
|
|
38
|
-
Authorization: `Bearer ${
|
|
32
|
+
Authorization: `Bearer ${token()}`,
|
|
39
33
|
},
|
|
40
34
|
});
|
|
41
35
|
permissions = apiResponse.data;
|
|
42
36
|
permissionsCache = permissions;
|
|
43
37
|
return permissions;
|
|
44
38
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
exports.isLoggedIn = isLoggedIn;
|
|
39
|
+
const isLoggedIn = () => !!token();
|
|
40
|
+
export { getPermissions, isLoggedIn, };
|
|
48
41
|
//# sourceMappingURL=user.js.map
|
package/lib/src/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/user.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,IAAI,gBAAgB,GAAG,IAAI,CAAC;AAE5B,eAAe,KAAK,IAAI,EAAE;IAExB,IAAI,IAAkB,CAAC;IAEvB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,IAAI,CAAC;QAEH,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,CACrB,GAAG,GAAG,KAAK,EACX;YACE,OAAO,EAAE;gBACP,YAAY,EAAE,iBAAiB;gBAC/B,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE;aACnC;SACF,CACF,CAAC,CAAC,IAAI,CAAC;IAEV,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAEf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAE7C,CAAC;IAED,OAAO,IAAI,CAAC;AAEd,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,KAAK,EAAE,OAAiB,EAA4B,EAAE;IAE3E,IAAI,WAA4B,CAAC;IAEjC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,MAAM,GAAG,GAAG,GAAG,GAAG,iBAAiB,CAAC;IAEpC,IAAI,gBAAgB,IAAI,CAAC,OAAO,EAAE,CAAC;QAEjC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,OAAO,gBAAgB,CAAC;IAE1B,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,GAAG,CACjC,GAAG,EACH;QACE,OAAO,EAAE;YACP,YAAY,EAAE,iBAAiB;YAC/B,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE;SACnC;KACF,CACF,CAAC;IAGF,WAAW,GAAG,WAAW,CAAC,IAAuB,CAAC;IAElD,gBAAgB,GAAG,WAAW,CAAC;IAG/B,OAAO,WAAW,CAAC;AAErB,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;AAEnC,OAAO,EACL,cAAc,EACd,UAAU,GACX,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lilaquadrat/cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "CLI for studio app and studio renderer",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"homepage": "https://lilaquadrat.de",
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
"release": "standard-version"
|
|
18
19
|
},
|
|
19
20
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
21
|
+
"node": ">=22",
|
|
21
22
|
"yarn": ">=1.22"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
@@ -25,21 +26,20 @@
|
|
|
25
26
|
"@types/fs-extra": "^11.0.1",
|
|
26
27
|
"@types/inquirer": "^9.0.3",
|
|
27
28
|
"@types/node": "^18.16.0",
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
29
|
-
"@typescript-eslint/parser": "^
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^8.49.0",
|
|
30
|
+
"@typescript-eslint/parser": "^8.49.0",
|
|
30
31
|
"cz-conventional-changelog": "^3.3.0",
|
|
31
|
-
"eslint": "^
|
|
32
|
-
"eslint-
|
|
33
|
-
"eslint-
|
|
34
|
-
"eslint-import-resolver-typescript": "^3.5.5",
|
|
35
|
-
"eslint-plugin-import": "^2.27.5",
|
|
36
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
32
|
+
"eslint": "^9.39.2",
|
|
33
|
+
"eslint-plugin-import": "^2.32.0",
|
|
34
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
37
35
|
"standard-version": "^9.5.0"
|
|
38
36
|
},
|
|
39
37
|
"dependencies": {
|
|
40
|
-
"@lilaquadrat/interfaces": "^1.
|
|
38
|
+
"@lilaquadrat/interfaces": "^1.37.0",
|
|
39
|
+
"@lilaquadrat/storage-sdk": "^0.1.12",
|
|
40
|
+
"@lilaquadrat/studio": "^10.0.0-beta.41",
|
|
41
41
|
"archiver": "^5.3.1",
|
|
42
|
-
"axios": "^1.
|
|
42
|
+
"axios": "^1.13.2",
|
|
43
43
|
"chalk": "^4.1.2",
|
|
44
44
|
"clear": "^0.1.0",
|
|
45
45
|
"commander": "^10.0.1",
|
|
@@ -48,8 +48,9 @@
|
|
|
48
48
|
"fs-extra": "^11.1.1",
|
|
49
49
|
"handlebars": "^4.7.7",
|
|
50
50
|
"inquirer": "^8.2.5",
|
|
51
|
+
"mime-types": "^3.0.1",
|
|
51
52
|
"open": "^8.4.2",
|
|
52
|
-
"typescript": "^5.
|
|
53
|
+
"typescript": "^5.9.3"
|
|
53
54
|
},
|
|
54
55
|
"files": [
|
|
55
56
|
"lib/**/*",
|
|
@@ -58,7 +59,12 @@
|
|
|
58
59
|
"bin": {
|
|
59
60
|
"lila": "lib/src/index.js"
|
|
60
61
|
},
|
|
61
|
-
"exports":
|
|
62
|
+
"exports": {
|
|
63
|
+
".": {
|
|
64
|
+
"types": "./lib/src/index.d.ts",
|
|
65
|
+
"import": "./lib/src/index.js"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
62
68
|
"types": "lib/src/index.d.ts",
|
|
63
69
|
"config": {
|
|
64
70
|
"commitizen": {
|
package/source/apps/app.ts.hbs
CHANGED
|
File without changes
|
package/source/apps/de.ts.hbs
CHANGED
|
File without changes
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
<template v-if="!content.sites.last">{{curly open}} content.count {{curly}}</template>
|
|
10
10
|
<template v-if="content.sites.last">{{curly open}} content.sites.range[0] {{curly}} - {{curly open}}
|
|
11
11
|
content.sites.range[1] {{curly}} ({{curly open}} content.count {{curly}})</template>
|
|
12
|
-
/ {{curly open}} content.all {{curly}} {{curly open}} 'total'
|
|
12
|
+
/ {{curly open}} content.all {{curly}} {{curly open}} $translate('total') {{curly}}
|
|
13
13
|
</h3>
|
|
14
14
|
</section>
|
|
15
15
|
|
|
16
16
|
<quickmenu-partial v-if="$scope(['{{name}}:create'])">
|
|
17
|
-
<router-link :title="'app-{{name}}-add'
|
|
17
|
+
<router-link :title="$translate('app-{{name}}-add')" :aria-label="$translate('app-{{name}}-add')"
|
|
18
18
|
class="main icon" :to="{ name: 'app-{{name}}-project-add' }"><icons-partial type="add"
|
|
19
19
|
size="large" /></router-link>
|
|
20
20
|
</quickmenu-partial>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<script lang="ts">
|
|
77
77
|
import { ExtComponent, Component, Watch } from '@libs/lila-component';
|
|
78
78
|
import StudioSDK, { SDKResponse } from '@libs/StudioSDK';
|
|
79
|
-
import { DataObject } from '@lilaquadrat/
|
|
79
|
+
import { DataObject } from '@lilaquadrat/interfaces';
|
|
80
80
|
import cleanObject from '@mixins/cleanObject';
|
|
81
81
|
import hardCopy from '@mixins/hardCopy';
|
|
82
82
|
import MainStoreState from '@store/mainStoreState.interface';
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
import { Store } from 'vuex';
|
|
85
85
|
|
|
86
86
|
@Component
|
|
87
|
-
export default class App
|
|
87
|
+
export default class App{{nameUppercase}}HomeScreen extends ExtComponent {
|
|
88
88
|
|
|
89
89
|
componentName = 'app-{{name}}-project-home';
|
|
90
90
|
|
|
@@ -128,26 +128,25 @@
|
|
|
128
128
|
|
|
129
129
|
get type() {
|
|
130
130
|
|
|
131
|
-
return this.$store.state.App{
|
|
131
|
+
return this.$store.state.App{{ nameUppercase }}.search?.type;
|
|
132
132
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
get sort() {
|
|
136
136
|
|
|
137
|
-
return this.$store.state.App{
|
|
137
|
+
return this.$store.state.App{{ nameUppercase }}.search?.sort;
|
|
138
138
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
get order() {
|
|
142
142
|
|
|
143
|
-
return this.$store.state.App{
|
|
143
|
+
return this.$store.state.App{{ nameUppercase }}.search?.order;
|
|
144
144
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
get content(): DataObject
|
|
148
|
-
} [] > {
|
|
147
|
+
get content(): DataObject<{{ nameUppercase }}[]> {
|
|
149
148
|
|
|
150
|
-
return this.$store.state.App{
|
|
149
|
+
return this.$store.state.App{{ nameUppercase }}.data || undefined;
|
|
151
150
|
|
|
152
151
|
}
|
|
153
152
|
|
|
@@ -242,13 +241,7 @@
|
|
|
242
241
|
<style lang="less">
|
|
243
242
|
@import (reference) '/source/editor/less/_base/shared.less';
|
|
244
243
|
|
|
245
|
-
.app- {
|
|
246
|
-
{
|
|
247
|
-
name
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
-home-screen {
|
|
244
|
+
.app-{{name}}-home-screen {
|
|
252
245
|
|
|
253
246
|
table.contentTable,
|
|
254
247
|
table.contentHead {
|
|
File without changes
|