@atb-as/generate-assets 4.0.0-alpha.0 → 4.0.0-alpha.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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg width="20" height="20" viewBox="0 0 40 40" fill="#000000" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.00001 5.99997L32 5.99999C35.3137 5.99999 38 8.68628 38 12V28C38 31.3137 35.3137 34 32 34H8C4.68629 34 2 31.3137 2 28V12C2 8.68626 4.6863 5.99997 8.00001 5.99997ZM20.6563 25.0937C20.3516 25.1562 19.7734 25.2109 19.1641 25.2109C16.7109 25.2109 15.7422 24.5 15.7422 22.7656V18.7422H14.4219V16.4297H15.7422V14.5H18.9453V16.4297H20.6563V18.7422H18.9453V22.0547C18.9453 22.6094 19.2656 22.8984 19.9375 22.8984C20.2813 22.8984 20.4688 22.8828 20.6563 22.8594V25.0937ZM26.0025 18.5625C26.0025 19.5469 25.315 20.2578 24.2681 20.2578C23.2213 20.2578 22.5338 19.5469 22.5338 18.5625C22.5338 17.5781 23.2213 16.8672 24.2681 16.8672C25.315 16.8672 26.0025 17.5781 26.0025 18.5625ZM26.0025 23.8281C26.0025 24.8125 25.315 25.5234 24.2681 25.5234C23.2213 25.5234 22.5338 24.8125 22.5338 23.8281C22.5338 22.8437 23.2213 22.1328 24.2681 22.1328C25.315 22.1328 26.0025 22.8437 26.0025 23.8281Z" />
|
|
3
|
-
</svg>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 12C2 8.68629 4.68629 6 8 6H32C35.3137 6 38 8.68629 38 12V28C38 31.3137 35.3137 34 32 34H8C4.68629 34 2 31.3137 2 28V12ZM6 27.1715V12.8285L13.1715 20L6 27.1715ZM8.8284 30H31.1716L23.9932 22.8216C21.722 24.8504 18.278 24.8504 16.0068 22.8216L8.8284 30ZM26.8285 20L34 27.1715V12.8285L26.8285 20ZM8.8284 10H31.1716L21.4142 19.7574C20.6332 20.5384 19.3668 20.5384 18.5858 19.7574L8.8284 10Z" fill="black"/>
|
|
3
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atb-as/generate-assets",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "OOS Design System generate-assets",
|
|
6
6
|
"license": "EUPL-1.2",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atb-as/theme": "^
|
|
30
|
+
"@atb-as/theme": "^6.0.0-alpha.0",
|
|
31
31
|
"commander": "^8.3.0",
|
|
32
32
|
"fast-glob": "^3.2.7",
|
|
33
33
|
"micromatch": "^4.0.4",
|
|
34
34
|
"normalize-path": "^3.0.0",
|
|
35
35
|
"stream-editor": "^1.11.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "710e85db095e6f10d80a67e9d963ee97389f3f69"
|
|
38
38
|
}
|
package/lib/list-files.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ThemeVariant } from '@atb-as/theme/lib/';
|
|
2
|
-
import { AssetTypes } from './utils';
|
|
3
|
-
export declare const vaildOrgIds: ThemeVariant[];
|
|
4
|
-
export declare const searchGlob = "**/*.{svg,png,jpg,jpeg,ico}";
|
|
5
|
-
declare type Options = {
|
|
6
|
-
patterns?: string | readonly string[];
|
|
7
|
-
};
|
|
8
|
-
export declare function listAssets(orgId: ThemeVariant, assetType?: AssetTypes, opts?: Options): Promise<Promise<string>[]>;
|
|
9
|
-
export {};
|
package/lib/list-files.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
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.listAssets = exports.searchGlob = exports.vaildOrgIds = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const lib_1 = require("@atb-as/theme/lib/");
|
|
9
|
-
const micromatch_1 = __importDefault(require("micromatch"));
|
|
10
|
-
const utils_1 = require("./utils");
|
|
11
|
-
exports.vaildOrgIds = [lib_1.ThemeVariant.AtB, lib_1.ThemeVariant.Nfk];
|
|
12
|
-
exports.searchGlob = '**/*.{svg,png,jpg,jpeg,ico}';
|
|
13
|
-
const defaultOpts = {};
|
|
14
|
-
async function listAssets(orgId, assetType = 'all', opts = defaultOpts) {
|
|
15
|
-
const assetDir = assetType == 'all' ? '{colors,mono}' : assetType;
|
|
16
|
-
const fromBase = (...p) => {
|
|
17
|
-
const fullPath = path_1.default.join(__dirname, '..', 'files', ...p, assetDir, exports.searchGlob);
|
|
18
|
-
console.log(fullPath);
|
|
19
|
-
return (0, utils_1.fgNormalizedForUnix)(fullPath);
|
|
20
|
-
};
|
|
21
|
-
if (!exports.vaildOrgIds.includes(orgId))
|
|
22
|
-
throw new Error(`Invalid orgId provided, valid orgIds are ${exports.vaildOrgIds}`);
|
|
23
|
-
// File paths are returned as UNIX type separators.
|
|
24
|
-
const commonFiles = await fromBase('common');
|
|
25
|
-
const orgFiles = await fromBase((0, utils_1.themeVariantAsString)(orgId));
|
|
26
|
-
const allFilesToBeCopied = (0, utils_1.mergeFiles)(assetType, commonFiles, orgFiles);
|
|
27
|
-
const potentiallyFiltered = opts.patterns
|
|
28
|
-
? (0, micromatch_1.default)(allFilesToBeCopied, opts.patterns)
|
|
29
|
-
: allFilesToBeCopied;
|
|
30
|
-
let allFiles = potentiallyFiltered.map(async (absolutePath) => {
|
|
31
|
-
return path_1.default.normalize((0, utils_1.getGeneralNameWithoutFullPath)(assetType, absolutePath));
|
|
32
|
-
});
|
|
33
|
-
return allFiles;
|
|
34
|
-
}
|
|
35
|
-
exports.listAssets = listAssets;
|
|
36
|
-
//# sourceMappingURL=list-files.js.map
|
package/lib/list-files.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-files.js","sourceRoot":"","sources":["../src/list-files.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,4CAAgD;AAEhD,4DAAoC;AAEpC,mCAMiB;AAEJ,QAAA,WAAW,GAAG,CAAC,kBAAY,CAAC,GAAG,EAAE,kBAAY,CAAC,GAAG,CAAC,CAAC;AACnD,QAAA,UAAU,GAAG,6BAA6B,CAAC;AAKxD,MAAM,WAAW,GAAY,EAAE,CAAC;AAEzB,KAAK,UAAU,UAAU,CAC9B,KAAmB,EACnB,YAAwB,KAAK,EAC7B,OAAgB,WAAW;IAE3B,MAAM,QAAQ,GAAG,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAW,EAAE,EAAE;QAClC,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CACxB,SAAS,EACT,IAAI,EACJ,OAAO,EACP,GAAG,CAAC,EACJ,QAAQ,EACR,kBAAU,CACX,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEtB,OAAO,IAAA,2BAAmB,EAAC,QAAQ,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,IAAI,CAAC,mBAAW,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,4CAA4C,mBAAW,EAAE,CAAC,CAAC;IAE7E,mDAAmD;IACnD,MAAM,WAAW,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