taiga-ui 2.49.1 → 2.50.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,5 +1,4 @@
1
- import { workspaces } from '@angular-devkit/core';
2
1
  import { Rule } from '@angular-devkit/schematics';
3
2
  import { Schema } from '../schema';
4
3
  export declare function addTaigaIcons(options: Schema): Rule;
5
- export declare function addTaigaStylesToAngularJson(workspace: workspaces.WorkspaceDefinition, project: workspaces.ProjectDefinition): Rule;
4
+ export declare function addTaigaStylesToAngularJson(options: Schema): Rule;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const workspace_1 = require("@schematics/angular/utility/workspace");
5
- const workspace_2 = require("@schematics/angular/utility/workspace");
6
5
  const get_project_1 = require("../../utils/get-project");
7
6
  const get_project_target_options_1 = require("../../utils/get-project-target-options");
8
7
  const ICON_ASSETS = {
@@ -11,22 +10,17 @@ const ICON_ASSETS = {
11
10
  output: 'assets/taiga-ui/icons',
12
11
  };
13
12
  function addTaigaIcons(options) {
14
- return (tree) => tslib_1.__awaiter(this, void 0, void 0, function* () {
15
- const workspace = yield workspace_2.getWorkspace(tree);
16
- const project = get_project_1.getProject(options, workspace);
17
- return addTaigaStylesToAngularJson(workspace, project);
13
+ return (_) => tslib_1.__awaiter(this, void 0, void 0, function* () {
14
+ return addTaigaStylesToAngularJson(options);
18
15
  });
19
16
  }
20
17
  exports.addTaigaIcons = addTaigaIcons;
21
- function addTaigaStylesToAngularJson(workspace, project) {
22
- const targetOptions = get_project_target_options_1.getProjectTargetOptions(project, 'build');
23
- const assets = targetOptions.assets;
24
- if (!assets) {
25
- targetOptions.assets = [ICON_ASSETS];
26
- }
27
- else {
28
- targetOptions.assets = [...assets, ICON_ASSETS];
29
- }
30
- return workspace_1.updateWorkspace(workspace);
18
+ function addTaigaStylesToAngularJson(options) {
19
+ return workspace_1.updateWorkspace(workspace => {
20
+ const project = get_project_1.getProject(options, workspace);
21
+ const targetOptions = get_project_target_options_1.getProjectTargetOptions(project, 'build');
22
+ const assets = targetOptions.assets;
23
+ targetOptions.assets = assets ? [...assets, ICON_ASSETS] : [ICON_ASSETS];
24
+ });
31
25
  }
32
26
  exports.addTaigaStylesToAngularJson = addTaigaStylesToAngularJson;
@@ -1,5 +1,4 @@
1
- import { workspaces } from '@angular-devkit/core';
2
1
  import { Rule } from '@angular-devkit/schematics';
3
2
  import { Schema } from '../schema';
4
3
  export declare function addTaigaStyles(options: Schema): Rule;
5
- export declare function addTaigaStylesToAngularJson(workspace: workspaces.WorkspaceDefinition, project: workspaces.ProjectDefinition): Rule;
4
+ export declare function addTaigaStylesToAngularJson(options: Schema): Rule;
@@ -2,29 +2,25 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const workspace_1 = require("@schematics/angular/utility/workspace");
5
- const workspace_2 = require("@schematics/angular/utility/workspace");
6
5
  const get_project_1 = require("../../utils/get-project");
7
6
  const get_project_target_options_1 = require("../../utils/get-project-target-options");
8
7
  const TAIGA_GLOBAL_STYLE = 'node_modules/@taiga-ui/core/styles/taiga-ui-global.less';
9
8
  const TAIGA_THEME_STYLE = 'node_modules/@taiga-ui/core/styles/taiga-ui-theme.less';
10
9
  function addTaigaStyles(options) {
11
- return (tree) => tslib_1.__awaiter(this, void 0, void 0, function* () {
12
- const workspace = yield workspace_2.getWorkspace(tree);
13
- const project = get_project_1.getProject(options, workspace);
14
- return addTaigaStylesToAngularJson(workspace, project);
10
+ return (_) => tslib_1.__awaiter(this, void 0, void 0, function* () {
11
+ return addTaigaStylesToAngularJson(options);
15
12
  });
16
13
  }
17
14
  exports.addTaigaStyles = addTaigaStyles;
18
- function addTaigaStylesToAngularJson(workspace, project) {
19
- const targetOptions = get_project_target_options_1.getProjectTargetOptions(project, 'build');
20
- const styles = targetOptions.styles;
21
- const taigaStyles = [TAIGA_GLOBAL_STYLE, TAIGA_THEME_STYLE];
22
- if (!styles) {
23
- targetOptions.styles = taigaStyles;
24
- }
25
- else {
26
- targetOptions.styles = Array.from(new Set([...taigaStyles, ...styles]));
27
- }
28
- return workspace_1.updateWorkspace(workspace);
15
+ function addTaigaStylesToAngularJson(options) {
16
+ return workspace_1.updateWorkspace(workspace => {
17
+ const project = get_project_1.getProject(options, workspace);
18
+ const targetOptions = get_project_target_options_1.getProjectTargetOptions(project, 'build');
19
+ const styles = targetOptions.styles;
20
+ const taigaStyles = [TAIGA_GLOBAL_STYLE, TAIGA_THEME_STYLE];
21
+ targetOptions.styles = styles
22
+ ? Array.from(new Set([...taigaStyles, ...styles]))
23
+ : taigaStyles;
24
+ });
29
25
  }
30
26
  exports.addTaigaStylesToAngularJson = addTaigaStylesToAngularJson;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taiga-ui",
3
- "version": "2.49.1",
3
+ "version": "2.50.1",
4
4
  "description": "Taiga UI package that provides ng add command for Taiga library",
5
5
  "keywords": [
6
6
  "angular",
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const schematics_1 = require("@angular-devkit/schematics");
4
4
  function getProject(options, workspace) {
5
- const projectName = options.project || workspace.extensions.defaultProject.toString();
5
+ var _a;
6
+ const projectName = options.project || ((_a = workspace.extensions.defaultProject) === null || _a === void 0 ? void 0 : _a.toString()) || '';
6
7
  const project = workspace.projects.get(projectName);
7
8
  if (!project) {
8
9
  throw new schematics_1.SchematicsException(`Unable to find project '${projectName}' in the workspace`);