Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-material-schematics

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-material-schematics - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

ngx-material-schematics-0.0.3.tgz

5

package.json
{
"name": "ngx-material-schematics",
"version": "0.0.3",
"version": "0.0.4",
"description": "A blank schematics",

@@ -16,3 +16,3 @@ "licenses": [

"ng-add": {
"save": "devDependencies"
"save": false
},

@@ -42,2 +42,3 @@ "scripts": {

"devDependencies": {
"@schematics/angular": "^13.1.1",
"@types/jasmine": "~3.10.0",

@@ -44,0 +45,0 @@ "@types/node": "^12.11.1",

21

src/ng-add/index_spec.js

@@ -15,12 +15,19 @@ "use strict";

const path = require("path");
const collectionPath = path.join(__dirname, '../collection.json');
describe('ng-add', () => {
it('works', () => __awaiter(void 0, void 0, void 0, function* () {
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
const tree = yield runner
.runSchematicAsync('ng-add', {}, schematics_1.Tree.empty())
const collectionPath = path.join(__dirname, "../collection.json");
describe("ng-add", () => {
let appTree;
let schematicRunner;
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
schematicRunner = new testing_1.SchematicTestRunner("ngx-material-schematics", require.resolve(collectionPath));
appTree = new testing_1.UnitTestTree(new schematics_1.HostTree());
appTree.create("/package.json", JSON.stringify({}));
}));
it("works", () => __awaiter(void 0, void 0, void 0, function* () {
const tree = yield schematicRunner
.runSchematicAsync("ng-add", undefined, appTree)
.toPromise();
expect(tree.files).toEqual([]);
const packageJSONContent = JSON.parse(tree.readContent("/package.json"));
expect(packageJSONContent.devDependencies["ngx-material-schematics"]).toBeTruthy();
}));
});
//# sourceMappingURL=index_spec.js.map

@@ -5,4 +5,16 @@ "use strict";

const tasks_1 = require("@angular-devkit/schematics/tasks");
const utils_1 = require("../utils");
// eslint-disable-next-line @typescript-eslint/no-var-requires
const packageJSON = require("../../package.json");
function ngAdd(_options) {
return (tree, _context) => {
if (!tree.exists("package.json")) {
throw new Error("Could not find a `package.json` file at the root of your workspace");
}
const projectPackageJSON = tree.read("package.json").toString("utf-8");
const json = JSON.parse(projectPackageJSON);
json.devDependencies = json.devDependencies || {};
json.devDependencies[packageJSON.name] = packageJSON.version;
json.devDependencies = (0, utils_1.sortObjectByKeys)(json.devDependencies);
tree.overwrite("package.json", JSON.stringify(json, null, 2));
_context.addTask(new tasks_1.NodePackageInstallTask());

@@ -9,0 +21,0 @@ _context.logger.info(`

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc