@filip.mazev/blocks 1.2.10 → 1.2.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filip.mazev/blocks",
3
- "version": "1.2.10",
3
+ "version": "1.2.11",
4
4
  "license": "MIT",
5
5
  "schematics": "./schematics/collection.json",
6
6
  "exports": {
@@ -0,0 +1,5 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export interface NgAddOptions {
3
+ theme: 'purple' | 'orange' | 'red' | 'green';
4
+ }
5
+ export declare function ngAdd(options: NgAddOptions): Rule;
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngAdd = ngAdd;
4
- const tasks_1 = require("@angular-devkit/schematics/tasks");
5
4
  function ngAdd(options) {
6
5
  return (tree, context) => {
7
6
  injectStyles(tree, context, options);
8
- context.addTask(new tasks_1.NodePackageInstallTask());
9
7
  return tree;
10
8
  };
11
9
  }
12
10
  function injectStyles(tree, context, options) {
11
+ var _a, _b;
13
12
  const workspaceConfigPath = '/angular.json';
14
13
  if (!tree.exists(workspaceConfigPath)) {
15
14
  context.logger.warn('Could not find angular.json. Please configure the Blocks theme manually.');
@@ -25,7 +24,7 @@ function injectStyles(tree, context, options) {
25
24
  context.logger.warn('Could not find a valid project in angular.json.');
26
25
  return;
27
26
  }
28
- const buildOptions = project.architect?.build?.options;
27
+ const buildOptions = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.options;
29
28
  if (!buildOptions || !buildOptions.styles) {
30
29
  context.logger.warn(`Could not find styles configuration for project "${projectName}".`);
31
30
  return;
@@ -43,6 +42,7 @@ function injectStyles(tree, context, options) {
43
42
  return;
44
43
  }
45
44
  const content = tree.read(targetStylePath).toString('utf-8');
45
+ // Update the check to look for the new package namespace
46
46
  if (content.includes('@filip.mazev/blocks')) {
47
47
  context.logger.info('Blocks SCSS configuration already exists. Skipping style injection.');
48
48
  return;
@@ -1,11 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es2019",
5
- "outDir": "../dist/blocks/schematics",
6
- "rootDir": "./",
7
- "esModuleInterop": true,
8
- "strict": true
9
- },
10
- "include": ["**/*.ts"]
11
- }