@tehw0lf/contact-form 0.0.6 → 0.0.10

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": "@tehw0lf/contact-form",
3
- "version": "0.0.6",
3
+ "version": "0.0.10",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/tehw0lf/tehwol.fi.git",
6
6
  "repository": {
@@ -22,9 +22,6 @@
22
22
  "tslib": "^2.2.0"
23
23
  },
24
24
  "schematics": "./schematics/collection.json",
25
- "ng-add": {
26
- "save": "dependencies"
27
- },
28
25
  "module": "fesm2015/tehw0lf-contact-form.mjs",
29
26
  "es2020": "fesm2020/tehw0lf-contact-form.mjs",
30
27
  "esm2020": "esm2020/tehw0lf-contact-form.mjs",
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const tasks_1 = require("@angular-devkit/schematics/tasks");
13
- const schematics_1 = require("@angular/cdk/schematics");
13
+ const dependencies_1 = require("@schematics/angular/utility/dependencies");
14
14
  const workspace_1 = require("@schematics/angular/utility/workspace");
15
15
  const workspace_models_1 = require("@schematics/angular/utility/workspace-models");
16
16
  const package_config_1 = require("./package-config");
@@ -18,12 +18,22 @@ function default_1(options) {
18
18
  return (host, context) => __awaiter(this, void 0, void 0, function* () {
19
19
  const materialVersion = (0, package_config_1.getPackageVersionFromPackageJson)(host, '@angular/material');
20
20
  const workspace = yield (0, workspace_1.getWorkspace)(host);
21
- const project = (0, schematics_1.getProjectFromWorkspace)(workspace, options.project);
21
+ const defaultProject = workspace.extensions.defaultProject;
22
+ const project = options.project
23
+ ? workspace.projects.get(options.project)
24
+ : workspace.projects.get(defaultProject);
25
+ if (!project) {
26
+ (0, dependencies_1.removePackageJsonDependency)(host, '@tehw0lf/contact-form');
27
+ context.logger.error(`No project specified and can not find default project ${project}`);
28
+ return;
29
+ }
22
30
  if (project.extensions.projectType !== workspace_models_1.ProjectType.Application) {
31
+ (0, dependencies_1.removePackageJsonDependency)(host, '@tehw0lf/contact-form');
23
32
  context.logger.error('This library needs to be added to an application project');
24
33
  return;
25
34
  }
26
35
  if (!materialVersion) {
36
+ (0, dependencies_1.removePackageJsonDependency)(host, '@tehw0lf/contact-form');
27
37
  context.logger.error(`@angular/material not found.
28
38
  Please run 'ng add @angular/material' first`);
29
39
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/contact-form/schematics/ng-add/index.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,4DAAoE;AACpE,wDAAkE;AAClE,qEAAqE;AACrE,mFAA2E;AAE3E,qDAAoE;AAGpE,mBAAyB,OAAe;IACtC,OAAO,CAAO,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,MAAM,eAAe,GAAG,IAAA,iDAAgC,EACtD,IAAI,EACJ,mBAAmB,CACpB,CAAC;QACF,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAA,oCAAuB,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEpE,IAAI,OAAO,CAAC,UAAU,CAAC,WAAW,KAAK,8BAAW,CAAC,WAAW,EAAE;YAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,0DAA0D,CAC3D,CAAC;YACF,OAAO;SACR;QAED,IAAI,CAAC,eAAe,EAAE;YACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;mDACwB,CAAC,CAAC;YAC/C,OAAO;SACR;QAED,OAAO,CAAC,OAAO,CAAC,IAAI,wBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC,CAAA,CAAC;AACJ,CAAC;AAxBD,4BAwBC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["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