UNPKG

1.52 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.getProjectStyleFile = exports.getDependencies = void 0;
4const core_1 = require("@angular-devkit/core");
5const currentVersions = require("./current_dependency_versions.json");
6const NGX_BOOTSTRAP_VERSION = currentVersions.NGX_BOOTSTRAP_VERSION;
7const BOOTSTRAP_VERSION = currentVersions.BOOTSTRAP_VERSION;
8// Regular expression that matches all possible Angular CLI default style files
9const defaultStyleFileRegex = /styles\.(c|le|sc|sa)ss/;
10// Regular expression that matches all files that have a proper stylesheet extension
11const validStyleFileRegex = /\.(c|le|sc|sa)ss/;
12function getDependencies(host) {
13 return [
14 { name: 'bootstrap', version: BOOTSTRAP_VERSION },
15 { name: 'ngx-bootstrap', version: NGX_BOOTSTRAP_VERSION }
16 ];
17}
18exports.getDependencies = getDependencies;
19function getProjectStyleFile(existingStyles, extension) {
20 const defaultExtension = existingStyles.find((file) => extension ? file === `styles.${extension}` : defaultStyleFileRegex.test(file));
21 if (defaultExtension) {
22 return defaultExtension;
23 }
24 ;
25 const fallbackStylePath = existingStyles.find((file) => extension ? file === null || file === void 0 ? void 0 : file.endsWith(`.${extension}`) : validStyleFileRegex.test(file));
26 if (fallbackStylePath) {
27 return core_1.normalize(fallbackStylePath);
28 }
29 ;
30}
31exports.getProjectStyleFile = getProjectStyleFile;
32//# sourceMappingURL=getVersions.js.map
\No newline at end of file