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

@nx-go/nx-go

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nx-go/nx-go - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

src/schematics/library/files/__name___test.go.template

6

collection.json

@@ -11,4 +11,10 @@ {

"description": "Create a new Go application"
},
"library": {
"aliases": ["lib"],
"factory": "./src/schematics/library/schematic",
"schema": "./src/schematics/library/schema.json",
"description": "Create a new Go library"
}
}
}

2

package.json
{
"name": "@nx-go/nx-go",
"version": "1.5.0",
"version": "1.6.0",
"main": "src/index.js",

@@ -5,0 +5,0 @@ "schematics": "./collection.json",

@@ -10,5 +10,8 @@ "use strict";

var _a;
return rxjs_1.from(context.getProjectMetadata((_a = context === null || context === void 0 ? void 0 : context.target) === null || _a === void 0 ? void 0 : _a.project)).pipe(operators_1.map(() => {
const mainFile = `${options.main}`;
return go_utils_1.runGoCommand(context, 'run', [mainFile], { cmd: options.cmd });
return rxjs_1.from(context.getProjectMetadata((_a = context === null || context === void 0 ? void 0 : context.target) === null || _a === void 0 ? void 0 : _a.project)).pipe(operators_1.map((project) => {
var _a;
const cwd = `${project.root}`;
// We strip the project root from the mail file
const mainFile = (_a = options.main) === null || _a === void 0 ? void 0 : _a.replace(`${cwd}/`, '');
return go_utils_1.runGoCommand(context, 'run', [mainFile], { cmd: options.cmd, cwd });
}));

@@ -15,0 +18,0 @@ }

@@ -5,2 +5,3 @@ export interface ApplicationSchematicSchema {

directory?: string
skipGoMod?: boolean
}

@@ -25,2 +25,7 @@ {

"alias": "d"
},
"skipGoMod": {
"type": "boolean",
"description": "Skip creation of go.mod.",
"default": false
}

@@ -27,0 +32,0 @@ },

@@ -19,3 +19,3 @@ "use strict";

projectDirectory,
parsedTags });
parsedTags, skipGoMod: options.skipGoMod || false });
}

@@ -28,2 +28,13 @@ function addFiles(options) {

}
function createGoMod(options) {
return (tree, context) => {
if (options.skipGoMod === false) {
const modFile = 'go.mod';
if (!tree.exists(`${modFile}`)) {
context.logger.info(`Creating ${modFile} in workspace root`);
tree.create(`${modFile}`, `module ${options.name}\n`);
}
}
};
}
function default_1(options) {

@@ -70,2 +81,3 @@ const normalizedOptions = normalizeOptions(options);

addFiles(normalizedOptions),
createGoMod(normalizedOptions),
]);

@@ -72,0 +84,0 @@ }

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