@smapiot/pilet-template-angular 1.0.9-beta.7093 → 1.0.10-beta.7598
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/index.js +81 -4
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -301,6 +301,77 @@ var require_io = __commonJS({
|
|
|
301
301
|
}
|
|
302
302
|
});
|
|
303
303
|
|
|
304
|
+
// ../../packages/template-utils/lib/assets.js
|
|
305
|
+
var require_assets = __commonJS({
|
|
306
|
+
"../../packages/template-utils/lib/assets.js"(exports) {
|
|
307
|
+
"use strict";
|
|
308
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
309
|
+
exports.getAssetsSource = void 0;
|
|
310
|
+
var assetsDeclaration = `// Change the declarations in this file if your bundler
|
|
311
|
+
// is configured to handle them differently.
|
|
312
|
+
// Standard behavior is to treat default exports as a
|
|
313
|
+
// link to the imported asset.
|
|
314
|
+
declare module '*.jpg' {
|
|
315
|
+
const link: string;
|
|
316
|
+
export default link;
|
|
317
|
+
}
|
|
318
|
+
declare module '*.png' {
|
|
319
|
+
const link: string;
|
|
320
|
+
export default link;
|
|
321
|
+
}
|
|
322
|
+
declare module '*.svg' {
|
|
323
|
+
const link: string;
|
|
324
|
+
export default link;
|
|
325
|
+
}
|
|
326
|
+
declare module '*.jpeg' {
|
|
327
|
+
const link: string;
|
|
328
|
+
export default link;
|
|
329
|
+
}
|
|
330
|
+
declare module '*.webp' {
|
|
331
|
+
const link: string;
|
|
332
|
+
export default link;
|
|
333
|
+
}
|
|
334
|
+
declare module '*.mp4' {
|
|
335
|
+
const link: string;
|
|
336
|
+
export default link;
|
|
337
|
+
}
|
|
338
|
+
declare module '*.mp3' {
|
|
339
|
+
const link: string;
|
|
340
|
+
export default link;
|
|
341
|
+
}
|
|
342
|
+
declare module '*.ogg' {
|
|
343
|
+
const link: string;
|
|
344
|
+
export default link;
|
|
345
|
+
}
|
|
346
|
+
declare module '*.wav' {
|
|
347
|
+
const link: string;
|
|
348
|
+
export default link;
|
|
349
|
+
}
|
|
350
|
+
declare module '*.ogv' {
|
|
351
|
+
const link: string;
|
|
352
|
+
export default link;
|
|
353
|
+
}
|
|
354
|
+
declare module '*.wasm' {
|
|
355
|
+
const link: string;
|
|
356
|
+
export default link;
|
|
357
|
+
}
|
|
358
|
+
declare module '*.gif' {
|
|
359
|
+
const link: string;
|
|
360
|
+
export default link;
|
|
361
|
+
}
|
|
362
|
+
`;
|
|
363
|
+
function getAssetsSource() {
|
|
364
|
+
return {
|
|
365
|
+
languages: ["ts"],
|
|
366
|
+
name: "assets.d.ts",
|
|
367
|
+
content: assetsDeclaration,
|
|
368
|
+
target: "<src>/assets.d.ts"
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
exports.getAssetsSource = getAssetsSource;
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
|
|
304
375
|
// ../../packages/template-utils/lib/version.js
|
|
305
376
|
var require_version = __commonJS({
|
|
306
377
|
"../../packages/template-utils/lib/version.js"(exports) {
|
|
@@ -1297,6 +1368,7 @@ var require_factory = __commonJS({
|
|
|
1297
1368
|
exports.createPiralTemplateFactory = exports.createPiletTemplateFactory = void 0;
|
|
1298
1369
|
var path_1 = require("path");
|
|
1299
1370
|
var io_1 = require_io();
|
|
1371
|
+
var assets_1 = require_assets();
|
|
1300
1372
|
var parent_1 = require_parent();
|
|
1301
1373
|
var template_1 = require_template();
|
|
1302
1374
|
var utils_1 = require_utils();
|
|
@@ -1307,7 +1379,6 @@ var require_factory = __commonJS({
|
|
|
1307
1379
|
const allArgs = Object.assign(Object.assign({}, defaultArgs), args);
|
|
1308
1380
|
const { language = "ts", sourceName, src = "<root>/src", plugins = (0, utils_1.getPlugins)(projectRoot, sourceName), mocks = "<src>/mocks" } = allArgs;
|
|
1309
1381
|
const allSources = getAllSources(projectRoot, allArgs, details);
|
|
1310
|
-
const sources = allSources.filter((m) => m.languages.includes(language));
|
|
1311
1382
|
const data = (0, template_1.normalizeData)(Object.assign(Object.assign({}, allArgs), {
|
|
1312
1383
|
language,
|
|
1313
1384
|
plugins,
|
|
@@ -1319,8 +1390,12 @@ var require_factory = __commonJS({
|
|
|
1319
1390
|
src,
|
|
1320
1391
|
mocks
|
|
1321
1392
|
}));
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1393
|
+
const defaultSources = [
|
|
1394
|
+
(0, assets_1.getAssetsSource)(),
|
|
1395
|
+
(0, utils_1.getPackageJsonWithSource)(data.projectRoot, data.src, `index${data.extension}`)
|
|
1396
|
+
];
|
|
1397
|
+
const sources = [...allSources, ...defaultSources].filter((m) => m.languages.includes(language));
|
|
1398
|
+
const files = yield Promise.all(sources.map((source) => (0, template_1.getFileFromTemplate)(sourceDir, source, data)));
|
|
1324
1399
|
return (0, io_1.mergeFiles)(files);
|
|
1325
1400
|
});
|
|
1326
1401
|
}
|
|
@@ -1332,7 +1407,6 @@ var require_factory = __commonJS({
|
|
|
1332
1407
|
const allArgs = Object.assign(Object.assign({}, defaultArgs), args);
|
|
1333
1408
|
const { language = "ts", packageName = "piral", mocks = "<src>/mocks", src = "<root>/src", title = "My Piral Instance", reactVersion = 17, plugins = [] } = allArgs;
|
|
1334
1409
|
const allSources = getAllSources(projectRoot, allArgs, details);
|
|
1335
|
-
const sources = allSources.filter((m) => m.languages.includes(language) && m.frameworks.includes(packageName));
|
|
1336
1410
|
const data = (0, template_1.normalizeData)(Object.assign(Object.assign({}, allArgs), {
|
|
1337
1411
|
title,
|
|
1338
1412
|
language,
|
|
@@ -1345,6 +1419,9 @@ var require_factory = __commonJS({
|
|
|
1345
1419
|
src,
|
|
1346
1420
|
mocks
|
|
1347
1421
|
}));
|
|
1422
|
+
const defaultSources = [(0, assets_1.getAssetsSource)()];
|
|
1423
|
+
const customSources = allSources.filter((m) => m.frameworks.includes(packageName));
|
|
1424
|
+
const sources = [...customSources, ...defaultSources].filter((m) => m.languages.includes(language));
|
|
1348
1425
|
const files = yield Promise.all(sources.map((source) => (0, template_1.getFileFromTemplate)(sourceDir, source, data)));
|
|
1349
1426
|
return (0, io_1.mergeFiles)(files);
|
|
1350
1427
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smapiot/pilet-template-angular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10-beta.7598",
|
|
4
4
|
"description": "Official scaffolding template for pilets: 'angular'.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"piral-cli",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@smapiot/template-utils": "1.0.
|
|
57
|
+
"@smapiot/template-utils": "1.0.10-beta.7598"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "dad31c169e343bafea669221f16a758a928badc6"
|
|
60
60
|
}
|