@remvst/asset-catalog 1.0.2 → 1.0.3
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.
|
@@ -30,7 +30,8 @@ function generatedTemplateInterface(tree, name, indent = '') {
|
|
|
30
30
|
generated += indent + ` ${(0, utils_1.lowerCamelize)(subname)}: ${generatedSub}`;
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
|
|
33
|
+
const withoutExt = (0, path_1.basename)(subname, (0, path_1.extname)(subname));
|
|
34
|
+
generated += indent + ` ${(0, utils_1.lowerCamelize)(withoutExt)}: T,\n`;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
generated += indent + '}\n';
|
|
@@ -47,7 +48,8 @@ async function generatedCreateCatalogFunction(assetDir, tree) {
|
|
|
47
48
|
else {
|
|
48
49
|
const dimensions = (0, image_size_1.default)(item);
|
|
49
50
|
const stats = await fs_1.promises.stat(item);
|
|
50
|
-
|
|
51
|
+
const withoutExt = (0, path_1.basename)(subname, (0, path_1.extname)(subname));
|
|
52
|
+
generated += indent + ` ${(0, utils_1.lowerCamelize)(withoutExt)}: createItem({
|
|
51
53
|
path: ${importName(assetDir, item)},
|
|
52
54
|
width: ${dimensions.width},
|
|
53
55
|
height: ${dimensions.height},
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { promises as fs } from 'fs';
|
|
4
4
|
import sizeOf from 'image-size';
|
|
5
5
|
import { sanitize, allFiles, lowerCamelize } from './utils';
|
|
6
|
-
import { resolve, relative, dirname, extname } from 'path';
|
|
6
|
+
import { resolve, relative, dirname, extname, basename } from 'path';
|
|
7
7
|
import yargs from 'yargs/yargs';
|
|
8
8
|
import { hideBin } from 'yargs/helpers';
|
|
9
9
|
import { Tree, generateTree } from './tree';
|
|
@@ -29,7 +29,8 @@ function generatedTemplateInterface(tree: Tree, name: string, indent: string = '
|
|
|
29
29
|
const generatedSub = generatedTemplateInterface(item, subname, indent + ' ');
|
|
30
30
|
generated += indent + ` ${lowerCamelize(subname)}: ${generatedSub}`;
|
|
31
31
|
} else {
|
|
32
|
-
|
|
32
|
+
const withoutExt = basename(subname, extname(subname));
|
|
33
|
+
generated += indent + ` ${lowerCamelize(withoutExt)}: T,\n`;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
generated += indent + '}\n';
|
|
@@ -46,7 +47,8 @@ async function generatedCreateCatalogFunction(assetDir: string, tree: Tree): Pro
|
|
|
46
47
|
} else {
|
|
47
48
|
const dimensions = sizeOf(item);
|
|
48
49
|
const stats = await fs.stat(item);
|
|
49
|
-
|
|
50
|
+
const withoutExt = basename(subname, extname(subname));
|
|
51
|
+
generated += indent + ` ${lowerCamelize(withoutExt)}: createItem({
|
|
50
52
|
path: ${importName(assetDir, item)},
|
|
51
53
|
width: ${dimensions.width},
|
|
52
54
|
height: ${dimensions.height},
|