@storm-software/workspace-tools
Version:
Tools for managing a Storm workspace, including various Nx generators and executors for common development tasks.
69 lines (53 loc) • 2.6 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
var _chunkRBU35LQWjs = require('./chunk-RBU35LQW.js');
var _chunkHI4G4OOGjs = require('./chunk-HI4G4OOG.js');
var _chunkNQ4W3N7Ojs = require('./chunk-NQ4W3N7O.js');
var _chunkJTAXCQX6js = require('./chunk-JTAXCQX6.js');
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
// src/generators/node-library/generator.ts
var _devkit = require('@nx/devkit');
async function nodeLibraryGeneratorFn(tree, schema, config) {
const filesDir = _chunkJTAXCQX6js.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
const tsLibraryGeneratorOptions = {
platform: "node",
devDependencies: {
"@types/node": _chunkHI4G4OOGjs.typesNodeVersion
},
buildExecutor: "@storm-software/workspace-tools:unbuild",
...schema,
directory: schema.directory,
description: schema.description
};
const options = await _chunkRBU35LQWjs.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
const { className, name, propertyName } = _devkit.names.call(void 0, options.name);
_devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
...schema,
dot: ".",
className,
name,
namespace: _nullishCoalesce(process.env.STORM_NAMESPACE, () => ( "storm-software")),
description: _nullishCoalesce(schema.description, () => ( "")),
propertyName,
js: !!options.js,
cliCommand: "nx",
strict: void 0,
tmpl: "",
offsetFromRoot: _devkit.offsetFromRoot.call(void 0, options.projectRoot),
buildable: options.bundler && options.bundler !== "none",
hasUnitTestRunner: options.unitTestRunner !== "none"
});
await _chunkRBU35LQWjs.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
await _devkit.formatFiles.call(void 0, tree);
return null;
}
_chunk3GQAWCBQjs.__name.call(void 0, nodeLibraryGeneratorFn, "nodeLibraryGeneratorFn");
var generator_default = _chunkNQ4W3N7Ojs.withRunGenerator.call(void 0, "TypeScript Library Creator (NodeJs Platform)", nodeLibraryGeneratorFn, {
hooks: {
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
options.description ??= "A library used by Storm Software to support NodeJs applications";
options.platform ??= "node";
return options;
}, "applyDefaultOptions")
}
});
exports.nodeLibraryGeneratorFn = nodeLibraryGeneratorFn; exports.generator_default = generator_default;