@ixon-cdk/core 1.2.0-next.6 → 1.2.0-next.7
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/api/auth.service.js +2 -1
- package/config/config.service.js +17 -4
- package/package.json +1 -1
- package/template/template.service.js +24 -8
package/api/auth.service.js
CHANGED
|
@@ -5,10 +5,11 @@ const httpRequest = require('../http-request');
|
|
|
5
5
|
module.exports = class AuthService extends ApiBaseService {
|
|
6
6
|
logIn(credentials) {
|
|
7
7
|
const c = credentials;
|
|
8
|
+
const expiresIn = 2592000; // 30 days
|
|
8
9
|
return httpRequest({
|
|
9
10
|
method: 'POST',
|
|
10
11
|
url: `${this._getApiBaseUrl()}/access-tokens`,
|
|
11
|
-
data: { expiresIn
|
|
12
|
+
data: { expiresIn },
|
|
12
13
|
headers: {
|
|
13
14
|
...this._getApiDefaultHeaders(),
|
|
14
15
|
'User-Agent': 'ComponentDevKit',
|
package/config/config.service.js
CHANGED
|
@@ -8,7 +8,7 @@ module.exports = class ConfigService {
|
|
|
8
8
|
|
|
9
9
|
constructor(configFile) {
|
|
10
10
|
// When the CDK is part of a larger project workspace it may be desirable to have a more explicit config-file name. Therefore, unless
|
|
11
|
-
// a specific config file path was defined in the
|
|
11
|
+
// a specific config file path was defined in the constructor, we'll first try to find `cdk.config.json`, before falling back to the
|
|
12
12
|
// default file name `config.json`.
|
|
13
13
|
if (configFile !== undefined) {
|
|
14
14
|
this._path = path.join(getRootDir(), configFile);
|
|
@@ -23,8 +23,21 @@ module.exports = class ConfigService {
|
|
|
23
23
|
let config;
|
|
24
24
|
|
|
25
25
|
if (!fs.existsSync(this._path)) {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
this._path = path.join(getRootDir(), 'cdk.config.json');
|
|
27
|
+
fs.writeFileSync(
|
|
28
|
+
this._path,
|
|
29
|
+
`${JSON.stringify(
|
|
30
|
+
{
|
|
31
|
+
$schema: './node_modules/@ixon-cdk/core/config/schema.json',
|
|
32
|
+
prefix: 'pct',
|
|
33
|
+
components: {},
|
|
34
|
+
},
|
|
35
|
+
null,
|
|
36
|
+
2,
|
|
37
|
+
)}\n`,
|
|
38
|
+
{ encoding: 'utf-8' },
|
|
39
|
+
);
|
|
40
|
+
logFileCrudMessage('CREATE', 'cdk.config.json');
|
|
28
41
|
}
|
|
29
42
|
|
|
30
43
|
try {
|
|
@@ -88,6 +101,6 @@ module.exports = class ConfigService {
|
|
|
88
101
|
encoding: 'utf8',
|
|
89
102
|
flag: 'w',
|
|
90
103
|
});
|
|
91
|
-
logFileCrudMessage('UPDATE',
|
|
104
|
+
logFileCrudMessage('UPDATE', path.basename(this._path));
|
|
92
105
|
}
|
|
93
106
|
};
|
package/package.json
CHANGED
|
@@ -205,6 +205,16 @@ module.exports = class TemplateService {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
// install dependencies
|
|
208
|
+
if (!!schema.dependencies) {
|
|
209
|
+
Object.keys(schema.dependencies).forEach(name =>
|
|
210
|
+
ensureModule(name, schema.dependencies[name], false),
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
if (!!schema.devDependencies) {
|
|
214
|
+
Object.keys(schema.devDependencies).forEach(name =>
|
|
215
|
+
ensureModule(name, schema.devDependencies[name]),
|
|
216
|
+
);
|
|
217
|
+
}
|
|
208
218
|
if (variantIdx !== null) {
|
|
209
219
|
const deps = schema.variants[variantIdx].dependencies;
|
|
210
220
|
const devDeps = schema.variants[variantIdx].devDependencies;
|
|
@@ -332,15 +342,21 @@ module.exports = class TemplateService {
|
|
|
332
342
|
_discover() {
|
|
333
343
|
const dir = path.dirname(require.resolve('@ixon-cdk/templates'));
|
|
334
344
|
const files = fs.readdirSync(dir);
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
if (
|
|
339
|
-
|
|
340
|
-
|
|
345
|
+
const tail = ['iframe-wrapper'];
|
|
346
|
+
files
|
|
347
|
+
.sort((a, b) => {
|
|
348
|
+
if (tail.includes(a)) return 1;
|
|
349
|
+
return tail.includes(b) ? -1 : 0;
|
|
350
|
+
})
|
|
351
|
+
.forEach(file => {
|
|
352
|
+
if (fs.lstatSync(path.join(dir, file)).isDirectory()) {
|
|
353
|
+
const schemaFile = path.join(dir, file, 'schema.json');
|
|
354
|
+
if (fs.existsSync(schemaFile)) {
|
|
355
|
+
const schema = JSON.parse(fs.readFileSync(schemaFile));
|
|
356
|
+
this._schemas = { ...this._schemas, [file]: schema };
|
|
357
|
+
}
|
|
341
358
|
}
|
|
342
|
-
}
|
|
343
|
-
});
|
|
359
|
+
});
|
|
344
360
|
}
|
|
345
361
|
|
|
346
362
|
/**
|