UNPKG

@storm-software/workspace-tools

Version:

Tools for managing a Storm workspace, including various Nx generators and executors for common development tasks.

50 lines (44 loc) 2.59 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _chunkBSW6NZVBjs = require('./chunk-BSW6NZVB.js'); // src/release/js-version-actions.ts var _versionactionsjs = require('@nx/js/src/release/version-actions.js'); var _versionactionsjs2 = _interopRequireDefault(_versionactionsjs); var StormJsVersionActions = (_class = class extends _versionactionsjs2.default { /** * The Storm workspace configuration object, which is loaded from the `storm-workspace.json` file. * * @remarks * This member variable is populated during the {@link init} method. */ __init() {this.workspaceConfig = null} constructor(releaseGroup, projectGraphNode, finalConfigForProject) { super(releaseGroup, projectGraphNode, finalConfigForProject);_class.prototype.__init.call(this);; } /** * Asynchronous initialization of the version actions and resolution of manifest paths. * * @remarks * This does NOT validate that manifest files exist - that happens later in validate(). * * @params tree - The file system tree to read from. */ async init(tree) { this.workspaceConfig = await _chunkBSW6NZVBjs.getWorkspaceConfig.call(void 0, ); return super.init(tree); } /** * Reads the current version of a package from the registry. * * @param tree - The file system tree to read from. * @param currentVersionResolverMetadata - Metadata for resolving the current version. * @returns The current version and log text. */ readCurrentVersionFromRegistry(tree, currentVersionResolverMetadata) { currentVersionResolverMetadata ??= {}; currentVersionResolverMetadata.registry ??= _optionalChain([this, 'access', _ => _.workspaceConfig, 'optionalAccess', _2 => _2.registry, 'optionalAccess', _3 => _3.npm]); return super.readCurrentVersionFromRegistry( tree, currentVersionResolverMetadata ); } }, _class); exports.StormJsVersionActions = StormJsVersionActions;