From 3357970eac7313b3c08ce713bf403e49200060c6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2020 07:04:43 +0000 Subject: [PATCH] feat: build for release --- README.md | 38 +- release/index.js | 1412 ++++++++++++++++++---------------------------- 2 files changed, 565 insertions(+), 885 deletions(-) diff --git a/README.md b/README.md index c56554a..6867259 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,49 @@ # GitHub Action - Release TypeScript Library + This GitHub action releases a TypeScript/JavaScript library by updating its package version(s) and publishing it to npm ![Github JavaScript Actions CI/CD](https://github.com/dolittle/release-typescript-lib-action/workflows/Github%20JavaScript%20Actions%20CI/CD/badge.svg) ### Pre requisites + Create a workflow `.yml` file in your `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file) ### Inputs -- `version`: The version -- `root` (optional): The relative path to the root of the TypeScript project. default = root of the repository + +- `version`: The version +- `root` (optional): The relative path to the root of the TypeScript project. default = root of the repository ### Example Workflow + ```yaml on: - push: - branches: - - '**' - pull_request: - types: [closed] + push: + branches: + - "**" + pull_request: + types: [closed] name: GitHub action workflow name jobs: - context: - name: Job name - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Name here - uses: dolittle/action-repository-here@tag-to-use - + context: + name: Job name + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Name here + uses: dolittle/action-repository-here@tag-to-use ``` + ## Contributing + We're always open for contributions and bug fixes! ### Pre requisites + node <= 12 yarn git diff --git a/release/index.js b/release/index.js index 617ece1..0ef6d01 100644 --- a/release/index.js +++ b/release/index.js @@ -22620,22 +22620,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Sources = void 0; -var path_1 = __importDefault(__webpack_require__(5622)); -var _1 = __webpack_require__(8990); +const path_1 = __importDefault(__webpack_require__(5622)); +const _1 = __webpack_require__(8990); /** * Represents a project's sources * * @export * @class Sources */ -var Sources = /** @class */ (function () { +class Sources { /** * Instantiates an instance of {Sources}. * @param {string} _rootFolder * @param {YarnWorkspace[]} [_workspaces=[]] */ - function Sources(_rootFolder, _rootPackage, _workspaces) { - if (_workspaces === void 0) { _workspaces = []; } + constructor(_rootFolder, _rootPackage, _workspaces = []) { this._rootFolder = _rootFolder; this._rootPackage = _rootPackage; this._workspaces = _workspaces; @@ -22643,20 +22642,15 @@ var Sources = /** @class */ (function () { this.sourceFiles = new _1.SourceFiles(this._rootFolder, this._rootPackage, this._workspaces); this.outputFiles = new _1.OutputFiles(this._rootFolder, this._workspaces); } - Object.defineProperty(Sources.prototype, "root", { - /** - * The root folder - * - * @readonly - */ - get: function () { - return this._rootFolder; - }, - enumerable: false, - configurable: true - }); - return Sources; -}()); + /** + * The root folder + * + * @readonly + */ + get root() { + return this._rootFolder; + } +} exports.Sources = Sources; //# sourceMappingURL=Sources.js.map @@ -24622,26 +24616,6 @@ defineProperty( "use strict"; -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; @@ -24649,18 +24623,18 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.WallabySettings = void 0; // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var slash_1 = __importDefault(__webpack_require__(1143)); -var typescript_1 = __importDefault(__webpack_require__(3186)); -var Sources_1 = __webpack_require__(8990); -var INSTRUMENTED_NODE_MODULES = [ +const slash_1 = __importDefault(__webpack_require__(1143)); +const typescript_1 = __importDefault(__webpack_require__(3186)); +const Sources_1 = __webpack_require__(8990); +const INSTRUMENTED_NODE_MODULES = [ 'chai', 'chai-as-promised', 'sinon', 'sinon-chai', '@dolittle/typescript.build' ]; -var WallabySettings = /** @class */ (function () { - function WallabySettings(_wallaby, _project, _setup, _settingsCallback, _compilerOptions) { +class WallabySettings { + constructor(_wallaby, _project, _setup, _settingsCallback, _compilerOptions) { this._wallaby = _wallaby; this._project = _project; this._setup = _setup; @@ -24678,158 +24652,129 @@ var WallabySettings = /** @class */ (function () { this.createTests(); this.createCompilers(); } - Object.defineProperty(WallabySettings.prototype, "settings", { - get: function () { - var settings = { - files: this.files, - tests: this.tests, - compilers: this.compilers, - setup: this._setup.setup, - testFramework: 'mocha', - env: { - type: 'node', - runner: 'node' - }, - }; - if (typeof this._settingsCallback === 'function') - this._settingsCallback(this._wallaby, settings); - return settings; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(WallabySettings.prototype, "files", { - get: function () { - if (this._files === undefined) - this.createFiles(); - return this._files; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(WallabySettings.prototype, "tests", { - get: function () { - if (this._tests === undefined) - this.createTests(); - return this._tests; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(WallabySettings.prototype, "compilers", { - get: function () { - if (this._compilers === undefined) - this.createCompilers(); - return this._compilers; - }, - enumerable: false, - configurable: true - }); - WallabySettings.prototype.createFiles = function () { - var _a, _b; - var _this = this; + get settings() { + const settings = { + files: this.files, + tests: this.tests, + compilers: this.compilers, + setup: this._setup.setup, + testFramework: 'mocha', + env: { + type: 'node', + runner: 'node' + }, + }; + if (typeof this._settingsCallback === 'function') + this._settingsCallback(this._wallaby, settings); + return settings; + } + get files() { + if (this._files === undefined) + this.createFiles(); + return this._files; + } + get tests() { + if (this._tests === undefined) + this.createTests(); + return this._tests; + } + get compilers() { + if (this._compilers === undefined) + this.createCompilers(); + return this._compilers; + } + createFiles() { this._files = []; - (_a = this._files).push.apply(_a, __spread(this.getBaseIgnoredFiles(), this.getBaseInstrumentedFiles())); + this._files.push(...this.getBaseIgnoredFiles(), ...this.getBaseInstrumentedFiles()); if (this._project.workspaces.length > 0) { - this._project.workspaces.forEach(function (_) { - var _a; - return (_a = _this._files).push.apply(_a, __spread(_this.getFilesFromSources(_.sources))); - }); + this._project.workspaces.forEach(_ => this._files.push(...this.getFilesFromSources(_.sources))); } else - (_b = this._files).push.apply(_b, __spread(this.getFilesFromSources(this._project.sources))); - }; - WallabySettings.prototype.createTests = function () { - var _a; - var _this = this; + this._files.push(...this.getFilesFromSources(this._project.sources)); + } + createTests() { this._tests = this.getBaseIgnoredFiles(); if (this._project.workspaces.length > 0) { - this._project.workspaces.forEach(function (_) { - var _a; - return (_a = _this._tests).push.apply(_a, __spread(_this.getTestsFromSources(_.sources))); - }); + this._project.workspaces.forEach(_ => this._tests.push(...this.getTestsFromSources(_.sources))); } else - (_a = this._tests).push.apply(_a, __spread(this.getTestsFromSources(this._project.sources))); - }; - WallabySettings.prototype.getFilesFromSources = function (sources) { - var files = []; - var sourceRoot = this.pathAsRelativeGlobFromRoot(sources.sourceFiles.root); - var outputRoot = this.pathAsRelativeGlobFromRoot(sources.outputFiles.root); - files.push({ pattern: outputRoot + "/**/*", ignore: true }); - files.push({ pattern: sourceRoot + "/**/for_*/**/!(given)/*.@(ts|js)", ignore: true }); - files.push({ pattern: sourceRoot + "/**/for_*/*.@(ts|js)", ignore: true }); - files.push({ pattern: sourceRoot + "/**/for_*/**/given/*.@(ts|js)", instrument: false }); - files.push({ pattern: sourceRoot + "/**/*.@(ts|js)" }); + this._tests.push(...this.getTestsFromSources(this._project.sources)); + } + getFilesFromSources(sources) { + const files = []; + const sourceRoot = this.pathAsRelativeGlobFromRoot(sources.sourceFiles.root); + const outputRoot = this.pathAsRelativeGlobFromRoot(sources.outputFiles.root); + files.push({ pattern: `${outputRoot}/**/*`, ignore: true }); + files.push({ pattern: `${sourceRoot}/**/for_*/**/!(given)/*.@(ts|js)`, ignore: true }); + files.push({ pattern: `${sourceRoot}/**/for_*/*.@(ts|js)`, ignore: true }); + files.push({ pattern: `${sourceRoot}/**/for_*/**/given/*.@(ts|js)`, instrument: false }); + files.push({ pattern: `${sourceRoot}/**/*.@(ts|js)` }); return files; - }; - WallabySettings.prototype.getTestsFromSources = function (sources) { - var files = []; - var sourceRoot = this.pathAsRelativeGlobFromRoot(sources.sourceFiles.root); - var outputRoot = this.pathAsRelativeGlobFromRoot(sources.outputFiles.root); - files.push({ pattern: outputRoot + "/**/*", ignore: true }); - files.push({ pattern: sourceRoot + "/**/for_*/**/given/*.@(ts|js)", ignore: true }); - files.push({ pattern: sourceRoot + "/**/for_*/*.@(ts|js)" }); - files.push({ pattern: sourceRoot + "/**/for_*/**/!(given)/*.@(ts|js)" }); + } + getTestsFromSources(sources) { + const files = []; + const sourceRoot = this.pathAsRelativeGlobFromRoot(sources.sourceFiles.root); + const outputRoot = this.pathAsRelativeGlobFromRoot(sources.outputFiles.root); + files.push({ pattern: `${outputRoot}/**/*`, ignore: true }); + files.push({ pattern: `${sourceRoot}/**/for_*/**/given/*.@(ts|js)`, ignore: true }); + files.push({ pattern: `${sourceRoot}/**/for_*/*.@(ts|js)` }); + files.push({ pattern: `${sourceRoot}/**/for_*/**/!(given)/*.@(ts|js)` }); return files; - }; - WallabySettings.prototype.createCompilers = function () { + } + createCompilers() { this._compilers = { '**/*.@(js|ts)': this._wallaby.compilers.typeScript(this._compilerOptions) }; - }; - WallabySettings.prototype.getBaseInstrumentedFiles = function () { - var _this = this; - var baseFiles = [{ pattern: 'package.json', instrument: false }]; + } + getBaseInstrumentedFiles() { + const baseFiles = [{ pattern: 'package.json', instrument: false }]; if (this._project.workspaces.length > 0) { - this._project.workspaces.forEach(function (_) { - var root = _this.pathAsRelativeGlobFromRoot(_.sources.root); - baseFiles.push({ pattern: root + "/package.json", instrument: false }); + this._project.workspaces.forEach((_) => { + const root = this.pathAsRelativeGlobFromRoot(_.sources.root); + baseFiles.push({ pattern: `${root}/package.json`, instrument: false }); }); } - return baseFiles.concat(INSTRUMENTED_NODE_MODULES.map(function (_) { - return { pattern: "node_modules/" + _, instrument: false }; + return baseFiles.concat(INSTRUMENTED_NODE_MODULES.map(_ => { + return { pattern: `node_modules/${_}`, instrument: false }; })); - }; - WallabySettings.prototype.getBaseIgnoredFiles = function () { - var _this = this; - var baseFiles = []; + } + getBaseIgnoredFiles() { + const baseFiles = []; if (this._project.workspaces.length > 0) { - this._project.workspaces.forEach(function (_) { - var root = _this.pathAsRelativeGlobFromRoot(_.sources.root); - baseFiles.push({ pattern: root + "/node_modules", ignore: true }); + this._project.workspaces.forEach(_ => { + const root = this.pathAsRelativeGlobFromRoot(_.sources.root); + baseFiles.push({ pattern: `${root}/node_modules`, ignore: true }); if (_.workspacePackage.usesWebpack()) { - Sources_1.SourceFiles.getWebpackSpecificExcludes(_.workspacePackage).forEach(function (pattern) { - baseFiles.push({ pattern: root + "/" + pattern, ignore: true }); + Sources_1.SourceFiles.getWebpackSpecificExcludes(_.workspacePackage).forEach(pattern => { + baseFiles.push({ pattern: `${root}/${pattern}`, ignore: true }); }); } }); } else { - var rootPackage = this._project.rootPackage; + const rootPackage = this._project.rootPackage; if (rootPackage.usesWebpack()) { - Sources_1.SourceFiles.getWebpackSpecificExcludes(rootPackage).forEach(function (pattern) { - baseFiles.push({ pattern: pattern, ignore: true }); + Sources_1.SourceFiles.getWebpackSpecificExcludes(rootPackage).forEach((pattern) => { + baseFiles.push({ pattern, ignore: true }); }); } } - var scopedPackages = INSTRUMENTED_NODE_MODULES.filter(function (_) { return _.startsWith('@'); }); - var unscopedPackages = INSTRUMENTED_NODE_MODULES.filter(function (_) { return !_.startsWith('@'); }); - baseFiles.push({ pattern: "node_modules/!(" + unscopedPackages.join('|') + ")", ignore: true }); - scopedPackages.forEach(function (_) { - var splitPackage = _.split('/'); - var scope = splitPackage[0], packageName = splitPackage[1]; - baseFiles.push({ pattern: "node_modules/" + scope + "/!(" + packageName + ")", ignore: true }); + const scopedPackages = INSTRUMENTED_NODE_MODULES.filter(_ => _.startsWith('@')); + const unscopedPackages = INSTRUMENTED_NODE_MODULES.filter(_ => !_.startsWith('@')); + baseFiles.push({ pattern: `node_modules/!(${unscopedPackages.join('|')})`, ignore: true }); + scopedPackages.forEach(_ => { + const splitPackage = _.split('/'); + const scope = splitPackage[0], packageName = splitPackage[1]; + baseFiles.push({ pattern: `node_modules/${scope}/!(${packageName})`, ignore: true }); }); return baseFiles; - }; - WallabySettings.prototype.pathAsRelativeGlobFromRoot = function (path) { + } + pathAsRelativeGlobFromRoot(path) { path = slash_1.default(path); - var root = slash_1.default(this._project.sources.root); - return root === path ? '.' : path.replace(root + "/", ''); - }; - return WallabySettings; -}()); + const root = slash_1.default(this._project.sources.root); + return root === path ? '.' : path.replace(`${root}/`, ''); + } +} exports.WallabySettings = WallabySettings; //# sourceMappingURL=WallabySettings.js.map @@ -39208,86 +39153,57 @@ module.exports = { // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SourceFiles = void 0; -var fs_1 = __importDefault(__webpack_require__(5747)); -var path_1 = __importDefault(__webpack_require__(5622)); -var slash_1 = __importDefault(__webpack_require__(1143)); -var _1 = __webpack_require__(8990); +const fs_1 = __importDefault(__webpack_require__(5747)); +const path_1 = __importDefault(__webpack_require__(5622)); +const slash_1 = __importDefault(__webpack_require__(1143)); +const _1 = __webpack_require__(8990); /** * Represents the source files * * @export * @class SourceFiles */ -var SourceFiles = /** @class */ (function () { +class SourceFiles { /** * Instantiates an instance of {SourceFiles}. * @param {string} _projectRootFolder * @param {YarnWorkspace[]} [_workspaces=[]] */ - function SourceFiles(_projectRootFolder, _rootPackage, _workspaces) { - if (_workspaces === void 0) { _workspaces = []; } + constructor(_projectRootFolder, _rootPackage, _workspaces = []) { this._projectRootFolder = _projectRootFolder; this._rootPackage = _rootPackage; this._workspaces = _workspaces; this._underSourceFolder = false; this.root = this._projectRootFolder; - var sourceFolder = path_1.default.resolve(this._projectRootFolder, SourceFiles.FOLDER_NAME); + const sourceFolder = path_1.default.resolve(this._projectRootFolder, SourceFiles.FOLDER_NAME); if (fs_1.default.existsSync(sourceFolder) && fs_1.default.statSync(sourceFolder).isDirectory()) { this._underSourceFolder = true; this.root = sourceFolder; } - this.sourceFileGlobs = this.createSourceFileGlobs.apply(this, __spread(SourceFiles.sourceFilesGlobPatterns)); - this.staticSourceFileGlobs = this.createSourceFileGlobs.apply(this, __spread(_1.StaticFiles.staticSourceFilesGlobPatterns)); - this.testFileGlobs = this.createSourceFileGlobs.apply(this, __spread(SourceFiles.testFilesGlobPatterns)); - this.testSetupFileGlobs = this.createSourceFileGlobs.apply(this, __spread(SourceFiles.testSetupFilesGlobPatterns)); + this.sourceFileGlobs = this.createSourceFileGlobs(...SourceFiles.sourceFilesGlobPatterns); + this.staticSourceFileGlobs = this.createSourceFileGlobs(..._1.StaticFiles.staticSourceFilesGlobPatterns); + this.testFileGlobs = this.createSourceFileGlobs(...SourceFiles.testFilesGlobPatterns); + this.testSetupFileGlobs = this.createSourceFileGlobs(...SourceFiles.testSetupFilesGlobPatterns); } - Object.defineProperty(SourceFiles, "FOLDER_NAME", { - /** - * The name that the Source folder should have, if any - * - * @readonly - * @static - */ - get: function () { return 'Source'; }, - enumerable: false, - configurable: true - }); - Object.defineProperty(SourceFiles, "FILE_EXTENSIONS", { - /** - * The list of valid source file extensions - * - * @readonly - * @static - */ - get: function () { return ['ts', 'js']; }, - enumerable: false, - configurable: true - }); + /** + * The name that the Source folder should have, if any + * + * @readonly + * @static + */ + static get FOLDER_NAME() { return 'Source'; } + /** + * The list of valid source file extensions + * + * @readonly + * @static + */ + static get FILE_EXTENSIONS() { return ['ts', 'js']; } /** * Gets the relative patterns to exclude that are specific for webpack based on the project package * @@ -39295,78 +39211,75 @@ var SourceFiles = /** @class */ (function () { * @param {Package} rootPackage * @returns */ - SourceFiles.getWebpackSpecificExcludes = function (rootPackage) { - var excludes = []; + static getWebpackSpecificExcludes(rootPackage) { + const excludes = []; if (rootPackage.usesWebpack()) { - var outputFolder = path_1.default.basename(require(rootPackage.webpackConfigPath)().output.path); - excludes.push.apply(excludes, __spread([outputFolder + "/**/*"], SourceFiles.webpackSpecificPatternsToExclude)); + const outputFolder = path_1.default.basename(require(rootPackage.webpackConfigPath)().output.path); + excludes.push(`${outputFolder}/**/*`, ...SourceFiles.webpackSpecificPatternsToExclude); } return excludes; - }; - SourceFiles.prototype.createSourceFileGlobs = function () { - var _a; - var _this = this; - var globPatterns = []; - for (var _i = 0; _i < arguments.length; _i++) { - globPatterns[_i] = arguments[_i]; - } - var globs = { + } + createSourceFileGlobs(...globPatterns) { + const globs = { includes: [], excludes: [] }; if (this._workspaces.length > 0) { - this._workspaces.forEach(function (_) { - var _a; - (_a = globs.includes).push.apply(_a, __spread(_1.createGlobPatterns(_.sources.sourceFiles.root, globPatterns, _.sources.sourceFiles.root === _this._projectRootFolder ? '' : slash_1.default(_.sources.sourceFiles.root.replace("" + _this._projectRootFolder + path_1.default.sep, ''))))); + this._workspaces.forEach(_ => { + globs.includes.push(..._1.createGlobPatterns(_.sources.sourceFiles.root, globPatterns, _.sources.sourceFiles.root === this._projectRootFolder ? '' : slash_1.default(_.sources.sourceFiles.root.replace(`${this._projectRootFolder}${path_1.default.sep}`, '')))); }); } else { - (_a = globs.includes).push.apply(_a, __spread(_1.createGlobPatterns(this.root, globPatterns, this._underSourceFolder === true ? SourceFiles.FOLDER_NAME : undefined))); + globs.includes.push(..._1.createGlobPatterns(this.root, globPatterns, this._underSourceFolder === true ? SourceFiles.FOLDER_NAME : undefined)); } - var excludePatterns = __spread(['node_modules/**/*', '**/node_modules/**/*'], SourceFiles.getWebpackSpecificExcludes(this._rootPackage), SourceFiles.filesToIgnore); - excludePatterns.forEach(function (globPattern) { - globs.excludes.push({ relative: globPattern, absolute: _1.globAsAbsoluteGlob(_this._projectRootFolder, globPattern) }); + const excludePatterns = ['node_modules/**/*', '**/node_modules/**/*', ...SourceFiles.getWebpackSpecificExcludes(this._rootPackage), ...SourceFiles.filesToIgnore]; + excludePatterns.forEach(globPattern => { + globs.excludes.push({ relative: globPattern, absolute: _1.globAsAbsoluteGlob(this._projectRootFolder, globPattern) }); }); return globs; - }; - /** - * The patterns to exclude that are common to webpack projects - * - * @static - */ - SourceFiles.webpackSpecificPatternsToExclude = [ - 'Configurations/**/*', 'Scripts/**/*' - ]; - /** - * The list of files that should not be considered a part of the source files - * - * @static - */ - SourceFiles.filesToIgnore = [ - 'wallaby.config.js', 'wallaby.conf.js', 'wallaby.js', 'Gulpfile.js', 'gulpfile.js', 'webpack.config.js', 'webpack.conf.js', 'webpack.js', 'webpack.prod.config.js', 'webpack.prod.conf.js', 'webpack.prod.js', - 'mocha.options.js', 'mocha.opts.js', 'mocha.js', 'run.js', 'nginx-default.conf', 'tsconfig.json', 'tsconfig.settings.json', 'package.json', 'package-lock.json', 'yarn.lock' - ]; - /** - * The list of source file glob patterns - * - * @static - */ - SourceFiles.sourceFilesGlobPatterns = _1.toPatternsThatIgnoreNodeModules("*" + _1.asPossibleFileExtensionsPattern(SourceFiles.FILE_EXTENSIONS)); - /** - * The list of test source file glob patterns - * - * @static - */ - SourceFiles.testFilesGlobPatterns = __spread(_1.toPatternsThatIgnoreNodeModules("for_*/**/!(given)/*" + _1.asPossibleFileExtensionsPattern(SourceFiles.FILE_EXTENSIONS)), _1.toPatternsThatIgnoreNodeModules("for_*/*" + _1.asPossibleFileExtensionsPattern(SourceFiles.FILE_EXTENSIONS))); - /** - * The list of test setup source file glob patterns - * - * @static - */ - SourceFiles.testSetupFilesGlobPatterns = __spread(_1.toPatternsThatIgnoreNodeModules("for_*/**/given/**/*" + _1.asPossibleFileExtensionsPattern(SourceFiles.FILE_EXTENSIONS))); - return SourceFiles; -}()); + } +} exports.SourceFiles = SourceFiles; +/** + * The patterns to exclude that are common to webpack projects + * + * @static + */ +SourceFiles.webpackSpecificPatternsToExclude = [ + 'Configurations/**/*', 'Scripts/**/*' +]; +/** + * The list of files that should not be considered a part of the source files + * + * @static + */ +SourceFiles.filesToIgnore = [ + 'wallaby.config.js', 'wallaby.conf.js', 'wallaby.js', 'Gulpfile.js', 'gulpfile.js', 'webpack.config.js', 'webpack.conf.js', 'webpack.js', 'webpack.prod.config.js', 'webpack.prod.conf.js', 'webpack.prod.js', + 'mocha.options.js', 'mocha.opts.js', 'mocha.js', 'run.js', 'nginx-default.conf', 'tsconfig.json', 'tsconfig.settings.json', 'package.json', 'package-lock.json', 'yarn.lock' +]; +/** + * The list of source file glob patterns + * + * @static + */ +SourceFiles.sourceFilesGlobPatterns = _1.toPatternsThatIgnoreNodeModules(`*${_1.asPossibleFileExtensionsPattern(SourceFiles.FILE_EXTENSIONS)}`); +/** + * The list of test source file glob patterns + * + * @static + */ +SourceFiles.testFilesGlobPatterns = [ + ..._1.toPatternsThatIgnoreNodeModules(`for_*/**/!(given)/*${_1.asPossibleFileExtensionsPattern(SourceFiles.FILE_EXTENSIONS)}`), + ..._1.toPatternsThatIgnoreNodeModules(`for_*/*${_1.asPossibleFileExtensionsPattern(SourceFiles.FILE_EXTENSIONS)}`) +]; +/** + * The list of test setup source file glob patterns + * + * @static + */ +SourceFiles.testSetupFilesGlobPatterns = [ + ..._1.toPatternsThatIgnoreNodeModules(`for_*/**/given/**/*${_1.asPossibleFileExtensionsPattern(SourceFiles.FILE_EXTENSIONS)}`) +]; //# sourceMappingURL=SourceFiles.js.map /***/ }), @@ -39525,34 +39438,19 @@ module.exports = { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.InvalidYarnWorkspace = void 0; // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var InvalidYarnWorkspace = /** @class */ (function (_super) { - __extends(InvalidYarnWorkspace, _super); +class InvalidYarnWorkspace extends Error { /** * Instantiates an instance of {InvalidYarnWorkspace}. * @param {string} path */ - function InvalidYarnWorkspace(path, innerError) { - return _super.call(this, "Could not create YarnWorkspace structure. Invalid yarn workspace at path '" + path + "'. " + (innerError ? "Inner error message: " + innerError.message : '')) || this; + constructor(path, innerError) { + super(`Could not create YarnWorkspace structure. Invalid yarn workspace at path '${path}'. ${innerError ? `Inner error message: ${innerError.message}` : ''}`); } - return InvalidYarnWorkspace; -}(Error)); +} exports.InvalidYarnWorkspace = InvalidYarnWorkspace; //# sourceMappingURL=InvalidYarnWorkspace.js.map @@ -44479,89 +44377,56 @@ module.exports = { // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.OutputFiles = void 0; -var path_1 = __importDefault(__webpack_require__(5622)); -var slash_1 = __importDefault(__webpack_require__(1143)); -var _1 = __webpack_require__(8990); +const path_1 = __importDefault(__webpack_require__(5622)); +const slash_1 = __importDefault(__webpack_require__(1143)); +const _1 = __webpack_require__(8990); /** * Represents the files that are outputted * * @export * @class OutputFiles */ -var OutputFiles = /** @class */ (function () { +class OutputFiles { /** * Instantiates an instance of {OutputFiles}. * @param {string} _projectRootFolder * @param {YarnWorkspace[]} [_workspaces=[]] */ - function OutputFiles(_projectRootFolder, _workspaces) { - if (_workspaces === void 0) { _workspaces = []; } + constructor(_projectRootFolder, _workspaces = []) { this._projectRootFolder = _projectRootFolder; this._workspaces = _workspaces; this.root = this._workspaces.length > 0 ? undefined : path_1.default.join(this._projectRootFolder, OutputFiles.FOLDER_NAME); - this.compiledFilesGlobs = this.createCompiledFileGlobs.apply(this, __spread(OutputFiles.compiledSourceFilesGlobPatterns)); - this.staticOutputFileGlobs = this.createCompiledFileGlobs.apply(this, __spread(_1.StaticFiles.staticOutputFilesGlobPatterns)); - this.declarationFilesGlobs = this.createCompiledFileGlobs.apply(this, __spread(OutputFiles.declarationFilesGlobPatterns)); - this.compiledTestsGlobs = this.createCompiledFileGlobs.apply(this, __spread(OutputFiles.compiledTestFilesGlobPatterns)); - } - Object.defineProperty(OutputFiles, "FOLDER_NAME", { - get: function () { return 'Distribution'; }, - enumerable: false, - configurable: true - }); - OutputFiles.prototype.createCompiledFileGlobs = function () { - var _a; - var _this = this; - var globPatterns = []; - for (var _i = 0; _i < arguments.length; _i++) { - globPatterns[_i] = arguments[_i]; - } - var globs = { + this.compiledFilesGlobs = this.createCompiledFileGlobs(...OutputFiles.compiledSourceFilesGlobPatterns); + this.staticOutputFileGlobs = this.createCompiledFileGlobs(..._1.StaticFiles.staticOutputFilesGlobPatterns); + this.declarationFilesGlobs = this.createCompiledFileGlobs(...OutputFiles.declarationFilesGlobPatterns); + this.compiledTestsGlobs = this.createCompiledFileGlobs(...OutputFiles.compiledTestFilesGlobPatterns); + } + static get FOLDER_NAME() { return 'Distribution'; } + createCompiledFileGlobs(...globPatterns) { + const globs = { includes: [], excludes: [] }; if (this._workspaces.length > 0) { - this._workspaces.forEach(function (_) { - var _a; - (_a = globs.includes).push.apply(_a, __spread(_1.createGlobPatterns(_.sources.outputFiles.root, globPatterns, _.sources.outputFiles.root === _this._projectRootFolder ? '' : slash_1.default(_.sources.outputFiles.root.replace("" + _this._projectRootFolder + path_1.default.sep, ''))))); + this._workspaces.forEach(_ => { + globs.includes.push(..._1.createGlobPatterns(_.sources.outputFiles.root, globPatterns, _.sources.outputFiles.root === this._projectRootFolder ? '' : slash_1.default(_.sources.outputFiles.root.replace(`${this._projectRootFolder}${path_1.default.sep}`, '')))); }); } else { - (_a = globs.includes).push.apply(_a, __spread(_1.createGlobPatterns(this.root, globPatterns, OutputFiles.FOLDER_NAME))); + globs.includes.push(..._1.createGlobPatterns(this.root, globPatterns, OutputFiles.FOLDER_NAME)); } return globs; - }; - OutputFiles.declarationFilesGlobPatterns = ['**/*.d.ts']; - OutputFiles.compiledSourceFilesGlobPatterns = ['**/*.js']; - OutputFiles.compiledTestFilesGlobPatterns = ['**/for_*/**/!(given)/*.js', '**/for_*/*.js']; - return OutputFiles; -}()); + } +} exports.OutputFiles = OutputFiles; +OutputFiles.declarationFilesGlobPatterns = ['**/*.d.ts']; +OutputFiles.compiledSourceFilesGlobPatterns = ['**/*.js']; +OutputFiles.compiledTestFilesGlobPatterns = ['**/for_*/**/!(given)/*.js', '**/for_*/*.js']; //# sourceMappingURL=OutputFiles.js.map /***/ }), @@ -67559,40 +67424,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTestTasks = exports.TestTasks = void 0; -var gulp_1 = __importDefault(__webpack_require__(69)); -var gulp_mocha_1 = __importDefault(__webpack_require__(3066)); -var _1 = __webpack_require__(2574); -var TestTasks = /** @class */ (function () { - function TestTasks(_context) { +const gulp_1 = __importDefault(__webpack_require__(69)); +const gulp_mocha_1 = __importDefault(__webpack_require__(3066)); +const _1 = __webpack_require__(2574); +class TestTasks { + constructor(_context) { this._context = _context; } - Object.defineProperty(TestTasks.prototype, "runTestsTask", { - get: function () { - var _this = this; - if (this._runTestsTask === undefined) { - this._runTestsTask = _1.createTask(this._context, 'test-run', false, function (workspace) { - var projectSources = workspace !== undefined ? workspace.sources : _this._context.project.sources; - var compiledTests = projectSources.outputFiles.compiledTestsGlobs.includes.map(function (_) { return _.absolute; }); - var excludedCompiledTests = projectSources.outputFiles.compiledTestsGlobs.excludes.map(function (_) { return _.absolute; }); - return function (done) { return gulp_1.default.src(compiledTests.concat(excludedCompiledTests.map(function (_) { return '!' + _; })), { read: false }) - .pipe(gulp_mocha_1.default({ reporter: 'spec', require: ['jsdom-global/register', '@dolittle/typescript.build/mocha.opts',] })) - .on('end', done); }; - }); - } - return this._runTestsTask; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(TestTasks.prototype, "allTasks", { - get: function () { - return [this.runTestsTask]; - }, - enumerable: false, - configurable: true - }); - return TestTasks; -}()); + get runTestsTask() { + if (this._runTestsTask === undefined) { + this._runTestsTask = _1.createTask(this._context, 'test-run', false, (workspace) => { + const projectSources = workspace !== undefined ? workspace.sources : this._context.project.sources; + const compiledTests = projectSources.outputFiles.compiledTestsGlobs.includes.map(_ => _.absolute); + const excludedCompiledTests = projectSources.outputFiles.compiledTestsGlobs.excludes.map(_ => _.absolute); + return done => gulp_1.default.src(compiledTests.concat(excludedCompiledTests.map(_ => '!' + _)), { read: false }) + .pipe(gulp_mocha_1.default({ reporter: 'spec', require: ['jsdom-global/register', '@dolittle/typescript.build/mocha.opts',] })) + .on('end', done); + }); + } + return this._runTestsTask; + } + get allTasks() { + return [this.runTestsTask]; + } +} exports.TestTasks = TestTasks; function getTestTasks(context) { if (TestTasks.testTasks === undefined) @@ -215168,25 +215023,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Package = void 0; -var fs_1 = __importDefault(__webpack_require__(5747)); -var path_1 = __importDefault(__webpack_require__(5622)); -var is_valid_path_1 = __importDefault(__webpack_require__(7709)); -var _1 = __webpack_require__(8283); -var PACKAGE_NAME = 'package.json'; -var WEBPACK_CONFIG_NAME = 'webpack.config.js'; +const fs_1 = __importDefault(__webpack_require__(5747)); +const path_1 = __importDefault(__webpack_require__(5622)); +const is_valid_path_1 = __importDefault(__webpack_require__(7709)); +const _1 = __webpack_require__(8283); +const PACKAGE_NAME = 'package.json'; +const WEBPACK_CONFIG_NAME = 'webpack.config.js'; /** * Represents an npm package * * @export * @class Package */ -var Package = /** @class */ (function () { +class Package { /** * Instantiates an instance of {Package}. * @param {string} _rootFolder Path to the root of the project containing a package.json file * @param {Package} [_parentPackage] The parent {Package} if this {Package} is a yarn workspace */ - function Package(rootFolder, _parentPackage) { + constructor(rootFolder, _parentPackage) { this._parentPackage = _parentPackage; if (!is_valid_path_1.default(rootFolder) || !fs_1.default.statSync(rootFolder).isDirectory()) { throw new _1.PathIsNotDirectory(rootFolder); @@ -215197,41 +215052,36 @@ var Package = /** @class */ (function () { throw new _1.NoPackageJson(this.path); } this.packageObject = JSON.parse(fs_1.default.readFileSync(this.path)); - var webpackConfigPath = path_1.default.join(this.rootFolder, WEBPACK_CONFIG_NAME); + const webpackConfigPath = path_1.default.join(this.rootFolder, WEBPACK_CONFIG_NAME); if (fs_1.default.existsSync(webpackConfigPath)) { this.webpackConfigPath = webpackConfigPath; } } - Object.defineProperty(Package.prototype, "parentPackage", { - /** - * Gets the parent package for this yarn workspace - * - * @readonly - */ - get: function () { - return this._parentPackage; - }, - enumerable: false, - configurable: true - }); + /** + * Gets the parent package for this yarn workspace + * + * @readonly + */ + get parentPackage() { + return this._parentPackage; + } /** * Whether or not this is yarn workspaces root package * * @returns */ - Package.prototype.hasWorkspaces = function () { + hasWorkspaces() { return this.packageObject.workspaces !== undefined; - }; + } /** * Whether or not this package uses webpack * * @returns */ - Package.prototype.usesWebpack = function () { + usesWebpack() { return this.webpackConfigPath !== undefined; - }; - return Package; -}()); + } +} exports.Package = Package; //# sourceMappingURL=Package.js.map @@ -230907,7 +230757,7 @@ function changeVersionNumbers(version, project) { const packages = getPackages(project); packages.forEach(_ => { var _a; - const file = editJsonFile(_.path); + const file = editJsonFile(_.path, { stringify_width: 4 }); const packageObject = file.toObject(); logger.info(`Updating ${_.packageObject.name} to version ${version}`); file.set('version', version); @@ -230919,8 +230769,8 @@ function changeVersionNumbers(version, project) { for (let dependencyName of Object.keys(dependencies)) { if (workspaceNames.includes(dependencyName)) { logger.info(`Updating workspace ${field} '${dependencyName}' to version ${version}`); - dependencyName = dependencyName.replace('.', '\\.'); - field = field.replace('.', '\\.'); + dependencyName = dependencyName.replace(/\./g, '\\.'); + field = field.replace(/\./g, '\\.'); const key = `${field}.${dependencyName}`; file.set(key, version); } @@ -231669,74 +231519,60 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getLintTasks = exports.LintTasks = void 0; -var gulp_1 = __importStar(__webpack_require__(69)); -var _1 = __webpack_require__(2574); -var gulpEslint = __webpack_require__(4596); -var gulpIf = __webpack_require__(1407); -var LintTasks = /** @class */ (function () { - function LintTasks(_context) { +const gulp_1 = __importStar(__webpack_require__(69)); +const _1 = __webpack_require__(2574); +const gulpEslint = __webpack_require__(4596); +const gulpIf = __webpack_require__(1407); +class LintTasks { + constructor(_context) { this._context = _context; } - Object.defineProperty(LintTasks.prototype, "lintTask", { - /** - * The task for linting - * - * @readonly - */ - get: function () { - if (this._lintTask === undefined) { - this._lintTask = this.createLintTask(false); - } - return this._lintTask; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LintTasks.prototype, "lintFixTask", { - /** - * The task for linting and fixing - * - * @readonly - */ - get: function () { - if (this._lintFixTask === undefined) { - this._lintFixTask = this.createLintTask(true); - } - return this._lintFixTask; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LintTasks.prototype, "allTasks", { - /** - * Gets all the tasks - * - * @readonly - */ - get: function () { - return [this.lintTask, this.lintFixTask]; - }, - enumerable: false, - configurable: true - }); - LintTasks.prototype.createLintTask = function (fix) { - var _this = this; - var task = _1.createTask(this._context, fix ? 'lint-fix' : 'lint', true, function (workspace) { - var projectSources = workspace !== undefined ? workspace.sources : _this._context.project.sources; - var sourceFiles = projectSources.sourceFiles.sourceFileGlobs.includes.map(function (_) { return _.absolute; }); - var excludedSourceFiles = projectSources.sourceFiles.sourceFileGlobs.excludes.map(function (_) { return _.absolute; }); - var destination = projectSources.sourceFiles.root; - return function (done) { return gulp_1.default.src(sourceFiles.concat(excludedSourceFiles.map(function (_) { return '!' + _; }))) - .pipe(gulpEslint({ fix: fix })) + /** + * The task for linting + * + * @readonly + */ + get lintTask() { + if (this._lintTask === undefined) { + this._lintTask = this.createLintTask(false); + } + return this._lintTask; + } + /** + * The task for linting and fixing + * + * @readonly + */ + get lintFixTask() { + if (this._lintFixTask === undefined) { + this._lintFixTask = this.createLintTask(true); + } + return this._lintFixTask; + } + /** + * Gets all the tasks + * + * @readonly + */ + get allTasks() { + return [this.lintTask, this.lintFixTask]; + } + createLintTask(fix) { + const task = _1.createTask(this._context, fix ? 'lint-fix' : 'lint', true, workspace => { + const projectSources = workspace !== undefined ? workspace.sources : this._context.project.sources; + const sourceFiles = projectSources.sourceFiles.sourceFileGlobs.includes.map(_ => _.absolute); + const excludedSourceFiles = projectSources.sourceFiles.sourceFileGlobs.excludes.map(_ => _.absolute); + const destination = projectSources.sourceFiles.root; + return done => gulp_1.default.src(sourceFiles.concat(excludedSourceFiles.map(_ => '!' + _))) + .pipe(gulpEslint({ fix })) .pipe(gulpEslint.format()) .pipe(gulpEslint.failAfterError()) .pipe(gulpIf(fix, gulp_1.dest(destination))) - .on('end', done); }; + .on('end', done); }); return task; - }; - return LintTasks; -}()); + } +} exports.LintTasks = LintTasks; function getLintTasks(context) { if (LintTasks.lintTasks === undefined) @@ -235700,37 +235536,28 @@ exports.YarnWorkspace = void 0; * @export * @class YarnWorkspace */ -var YarnWorkspace = /** @class */ (function () { - function YarnWorkspace(_workspacePackage, _sources) { +class YarnWorkspace { + constructor(_workspacePackage, _sources) { this._workspacePackage = _workspacePackage; this._sources = _sources; } - Object.defineProperty(YarnWorkspace.prototype, "sources", { - /** - * Gets the {ProjectSources} for this yarn workspace - * - * @readonly - */ - get: function () { - return this._sources; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(YarnWorkspace.prototype, "workspacePackage", { - /** - * Gets the {Package} for this yarn workspace - * - * @readonly - */ - get: function () { - return this._workspacePackage; - }, - enumerable: false, - configurable: true - }); - return YarnWorkspace; -}()); + /** + * Gets the {ProjectSources} for this yarn workspace + * + * @readonly + */ + get sources() { + return this._sources; + } + /** + * Gets the {Package} for this yarn workspace + * + * @readonly + */ + get workspacePackage() { + return this._workspacePackage; + } +} exports.YarnWorkspace = YarnWorkspace; //# sourceMappingURL=YarnWorkspace.js.map @@ -244773,55 +244600,40 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCleanTasks = exports.CleanTasks = void 0; -var del_1 = __importDefault(__webpack_require__(3245)); -var slash_1 = __importDefault(__webpack_require__(1143)); -var _1 = __webpack_require__(2574); -var CleanTasks = /** @class */ (function () { - function CleanTasks(_context) { +const del_1 = __importDefault(__webpack_require__(3245)); +const slash_1 = __importDefault(__webpack_require__(1143)); +const _1 = __webpack_require__(2574); +class CleanTasks { + constructor(_context) { this._context = _context; } - Object.defineProperty(CleanTasks.prototype, "cleanTask", { - get: function () { - var _this = this; - if (this._cleanTask === undefined) { - this._cleanTask = _1.createTask(this._context, 'clean', true, function (workspace) { - var projectSources = workspace !== undefined ? workspace.sources : _this._context.project.sources; - return function (done) { - var outputFolder = projectSources.outputFiles.root; - return del_1.default(outputFolder) - .then(function (_) { return done(); }) - .catch(function (error) { return done(error); }); - }; - }); - } - return this._cleanTask; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CleanTasks.prototype, "testsCleanTask", { - get: function () { - var _this = this; - if (this._testsCleanTask === undefined) { - this._testsCleanTask = _1.createTask(this._context, 'test-clean', true, function (workspace) { - var projectSources = workspace !== undefined ? workspace.sources : _this._context.project.sources; - return function (done) { return del_1.default(slash_1.default(projectSources.outputFiles.root) + "/**/for_*").then(function (_) { return done(); }).catch(function (error) { return done(error); }); }; - }); - } - return this._testsCleanTask; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(CleanTasks.prototype, "allTasks", { - get: function () { - return [this.cleanTask, this.testsCleanTask]; - }, - enumerable: false, - configurable: true - }); - return CleanTasks; -}()); + get cleanTask() { + if (this._cleanTask === undefined) { + this._cleanTask = _1.createTask(this._context, 'clean', true, workspace => { + const projectSources = workspace !== undefined ? workspace.sources : this._context.project.sources; + return done => { + const outputFolder = projectSources.outputFiles.root; + return del_1.default(outputFolder) + .then(_ => done()) + .catch(error => done(error)); + }; + }); + } + return this._cleanTask; + } + get testsCleanTask() { + if (this._testsCleanTask === undefined) { + this._testsCleanTask = _1.createTask(this._context, 'test-clean', true, workspace => { + const projectSources = workspace !== undefined ? workspace.sources : this._context.project.sources; + return done => del_1.default(`${slash_1.default(projectSources.outputFiles.root)}/**/for_*`).then(_ => done()).catch(error => done(error)); + }); + } + return this._testsCleanTask; + } + get allTasks() { + return [this.cleanTask, this.testsCleanTask]; + } +} exports.CleanTasks = CleanTasks; function getCleanTasks(context) { if (CleanTasks.cleanTasks === undefined) @@ -280464,34 +280276,19 @@ module.exports = (additionalOptions = {}) => { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.PathIsNotDirectory = void 0; // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var PathIsNotDirectory = /** @class */ (function (_super) { - __extends(PathIsNotDirectory, _super); +class PathIsNotDirectory extends Error { /** * Instantiates an instance of {PathIsNotDirectory}. * @param {string} path */ - function PathIsNotDirectory(path) { - return _super.call(this, "'" + path + "' is not a directory") || this; + constructor(path) { + super(`'${path}' is not a directory`); } - return PathIsNotDirectory; -}(Error)); +} exports.PathIsNotDirectory = PathIsNotDirectory; //# sourceMappingURL=PathIsNotDirectory.js.map @@ -291879,60 +291676,55 @@ exports.HttpClient = HttpClient; // Licensed under the MIT license. See LICENSE file in the project root for full license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.WallabySetup = void 0; -var WallabySetup = /** @class */ (function () { - function WallabySetup(_w, _project, _setupCallback) { +class WallabySetup { + constructor(_w, _project, _setupCallback) { this._w = _w; this._project = _project; this._setupCallback = _setupCallback; } - Object.defineProperty(WallabySetup.prototype, "setup", { - get: function () { - if (this._setup === undefined) - this._setup = this.getSetupFunction(); - return this._setup; - }, - enumerable: false, - configurable: true - }); - WallabySetup.prototype.getFunctionBody = function (func) { - var entire = func.toString(); - var body = entire.substring(entire.indexOf('{') + 1, entire.lastIndexOf('}')); + get setup() { + if (this._setup === undefined) + this._setup = this.getSetupFunction(); + return this._setup; + } + getFunctionBody(func) { + const entire = func.toString(); + const body = entire.substring(entire.indexOf('{') + 1, entire.lastIndexOf('}')); return body; - }; - WallabySetup.prototype.getSetupFunction = function () { - var setup = function (_wallaby) { + } + getSetupFunction() { + const setup = (_wallaby) => { process.env.IS_TESTING = true; // eslint-disable-next-line import/no-extraneous-dependencies - var Project = __webpack_require__(13).Project; - var project = new Project(process.cwd()); + const Project = __webpack_require__(13).Project; + const project = new Project(process.cwd()); if (project.workspaces.length > 0) { - var aliases_1 = {}; - project.workspaces.forEach(function (workspace) { - var packageObject = workspace.workspacePackage.packageObject; - var rootFolder = workspace.workspacePackage.rootFolder; - aliases_1[packageObject.name] = rootFolder; + const aliases = {}; + project.workspaces.forEach((workspace) => { + const packageObject = workspace.workspacePackage.packageObject; + const rootFolder = workspace.workspacePackage.rootFolder; + aliases[packageObject.name] = rootFolder; }); - __webpack_require__(2123).addAliases(aliases_1); + __webpack_require__(2123).addAliases(aliases); } global.expect = chai.expect; - var should = chai.should(); + const should = chai.should(); global.sinon = __webpack_require__(483); - var sinonChai = __webpack_require__(3573); - var chaiAsPromised = __webpack_require__(5757); + const sinonChai = __webpack_require__(3573); + const chaiAsPromised = __webpack_require__(5757); chai.use(sinonChai); chai.use(chaiAsPromised); }; if (typeof this._setupCallback === 'function') { - var setupBody = this.getFunctionBody(setup); - var setupCallbackBody = this.getFunctionBody(this._setupCallback); - var combined = setupBody + '\n' + setupCallbackBody; - var newFunction = new Function(combined); + const setupBody = this.getFunctionBody(setup); + const setupCallbackBody = this.getFunctionBody(this._setupCallback); + const combined = setupBody + '\n' + setupCallbackBody; + const newFunction = new Function(combined); return newFunction; } return setup; - }; - return WallabySetup; -}()); + } +} exports.WallabySetup = WallabySetup; //# sourceMappingURL=WallabySetup.js.map @@ -293442,34 +293234,19 @@ module.exports = { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.NotValidGlob = void 0; // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var NotValidGlob = /** @class */ (function (_super) { - __extends(NotValidGlob, _super); +class NotValidGlob extends Error { /** * Instantiates an instance of {NotValidGlob}. * @param {string} pattern */ - function NotValidGlob(pattern) { - return _super.call(this, "The pattern '" + pattern + "' is not a valid glob pattern") || this; + constructor(pattern) { + super(`The pattern '${pattern}' is not a valid glob pattern`); } - return NotValidGlob; -}(Error)); +} exports.NotValidGlob = NotValidGlob; //# sourceMappingURL=NotValidGlob.js.map @@ -294600,49 +294377,39 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getStaticFilesTasks = exports.StaticFilesTasks = void 0; -var gulp_1 = __importDefault(__webpack_require__(69)); -var _1 = __webpack_require__(2574); -var StaticFilesTasks = /** @class */ (function () { - function StaticFilesTasks(_context) { +const gulp_1 = __importDefault(__webpack_require__(69)); +const _1 = __webpack_require__(2574); +class StaticFilesTasks { + constructor(_context) { this._context = _context; } - Object.defineProperty(StaticFilesTasks.prototype, "copyStaticTask", { - get: function () { - if (this._copyStaticTask === undefined) { - this._copyStaticTask = this.createCopyStaticTask(); - } - return this._copyStaticTask; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(StaticFilesTasks.prototype, "allTasks", { - get: function () { - return [this.copyStaticTask]; - }, - enumerable: false, - configurable: true - }); - StaticFilesTasks.prototype.createCopyStaticTask = function () { - var _this = this; + get copyStaticTask() { if (this._copyStaticTask === undefined) { - this._copyStaticTask = _1.createTask(this._context, 'copy', true, function (workspace) { - var usesWebPack = workspace ? workspace.workspacePackage.usesWebpack() : _this._context.project.rootPackage.usesWebpack(); + this._copyStaticTask = this.createCopyStaticTask(); + } + return this._copyStaticTask; + } + get allTasks() { + return [this.copyStaticTask]; + } + createCopyStaticTask() { + if (this._copyStaticTask === undefined) { + this._copyStaticTask = _1.createTask(this._context, 'copy', true, workspace => { + const usesWebPack = workspace ? workspace.workspacePackage.usesWebpack() : this._context.project.rootPackage.usesWebpack(); if (usesWebPack) - return function (done) { return done(); }; - var projectSources = workspace !== undefined ? workspace.sources : _this._context.project.sources; - var staticFiles = projectSources.sourceFiles.staticSourceFileGlobs.includes.map(function (_) { return _.absolute; }); - var excludedStaticFiles = projectSources.sourceFiles.staticSourceFileGlobs.excludes.map(function (_) { return _.absolute; }); - var destination = projectSources.outputFiles.root; - return function (done) { return gulp_1.default.src(staticFiles.concat(excludedStaticFiles.map(function (_) { return '!' + _; }))) + return done => done(); + const projectSources = workspace !== undefined ? workspace.sources : this._context.project.sources; + const staticFiles = projectSources.sourceFiles.staticSourceFileGlobs.includes.map(_ => _.absolute); + const excludedStaticFiles = projectSources.sourceFiles.staticSourceFileGlobs.excludes.map(_ => _.absolute); + const destination = projectSources.outputFiles.root; + return done => gulp_1.default.src(staticFiles.concat(excludedStaticFiles.map(_ => '!' + _))) .pipe(gulp_1.default.dest(destination)) - .on('end', done); }; + .on('end', done); }); } return this._copyStaticTask; - }; - return StaticFilesTasks; -}()); + } +} exports.StaticFilesTasks = StaticFilesTasks; function getStaticFilesTasks(context) { if (StaticFilesTasks.staticFilesTasks === undefined) @@ -294758,17 +294525,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.wallaby = void 0; -var fs_1 = __importDefault(__webpack_require__(5747)); -var path_1 = __importDefault(__webpack_require__(5622)); -var Project_1 = __webpack_require__(8283); -var WallabySetup_1 = __webpack_require__(6541); -var Sources_1 = __webpack_require__(8990); -var WallabySettings_1 = __webpack_require__(909); +const fs_1 = __importDefault(__webpack_require__(5747)); +const path_1 = __importDefault(__webpack_require__(5622)); +const Project_1 = __webpack_require__(8283); +const WallabySetup_1 = __webpack_require__(6541); +const Sources_1 = __webpack_require__(8990); +const WallabySettings_1 = __webpack_require__(909); function wallaby(options) { - return function (wallaby) { - var project = new Project_1.Project(process.cwd()); - var setup = new WallabySetup_1.WallabySetup(wallaby, project, options === null || options === void 0 ? void 0 : options.setupCallback); - var settings = new WallabySettings_1.WallabySettings(wallaby, project, setup, options === null || options === void 0 ? void 0 : options.settingsCallback, options === null || options === void 0 ? void 0 : options.compilerOptions); + return (wallaby) => { + const project = new Project_1.Project(process.cwd()); + const setup = new WallabySetup_1.WallabySetup(wallaby, project, options === null || options === void 0 ? void 0 : options.setupCallback); + const settings = new WallabySettings_1.WallabySettings(wallaby, project, setup, options === null || options === void 0 ? void 0 : options.settingsCallback, options === null || options === void 0 ? void 0 : options.compilerOptions); setNodePath(wallaby, project); if (typeof (options === null || options === void 0 ? void 0 : options.settingsCallback) === 'function') options === null || options === void 0 ? void 0 : options.settingsCallback(wallaby, settings); @@ -294777,8 +294544,8 @@ function wallaby(options) { } exports.wallaby = wallaby; function setNodePath(w, project) { - var nodePath = w.projectCacheDir; - var sourcePath = path_1.default.join(project.sources.root, Sources_1.SourceFiles.FOLDER_NAME); + let nodePath = w.projectCacheDir; + const sourcePath = path_1.default.join(project.sources.root, Sources_1.SourceFiles.FOLDER_NAME); if (project.workspaces.length > 1 && fs_1.default.existsSync(sourcePath)) { nodePath = path_1.default.join(nodePath, Sources_1.SourceFiles.FOLDER_NAME); } @@ -299173,8 +298940,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.createGlobPatterns = exports.asPossibleFileExtensionsPattern = exports.toPatternsThatIgnoreNodeModules = exports.globAsAbsoluteGlob = void 0; -var slash_1 = __importDefault(__webpack_require__(1143)); -var is_glob_1 = __importDefault(__webpack_require__(5357)); +const slash_1 = __importDefault(__webpack_require__(1143)); +const is_glob_1 = __importDefault(__webpack_require__(5357)); /** * Returns a glob pattern as a glob pattern with absolute path instead of relative. * @@ -299184,7 +298951,7 @@ var is_glob_1 = __importDefault(__webpack_require__(5357)); * @returns */ function globAsAbsoluteGlob(rootFolder, glob) { - return slash_1.default(rootFolder) + "/" + glob; + return `${slash_1.default(rootFolder)}/${glob}`; } exports.globAsAbsoluteGlob = globAsAbsoluteGlob; /** @@ -299197,8 +298964,8 @@ exports.globAsAbsoluteGlob = globAsAbsoluteGlob; function toPatternsThatIgnoreNodeModules(pattern) { return [ pattern, - "**/!(node_modules)/**/" + pattern, - "**/!(node_modules)/" + pattern + `**/!(node_modules)/**/${pattern}`, + `**/!(node_modules)/${pattern}` ]; } exports.toPatternsThatIgnoreNodeModules = toPatternsThatIgnoreNodeModules; @@ -299209,11 +298976,10 @@ exports.toPatternsThatIgnoreNodeModules = toPatternsThatIgnoreNodeModules; * @param {string[]} fileExtensions * @returns */ -function asPossibleFileExtensionsPattern(fileExtensions, negate) { - if (negate === void 0) { negate = false; } +function asPossibleFileExtensionsPattern(fileExtensions, negate = false) { if (fileExtensions.length <= 0) throw new Error('No file extension to create pattern from'); - return "." + (negate === true ? '!' : '@') + "(" + fileExtensions.join('|') + ")"; + return `.${negate === true ? '!' : '@'}(${fileExtensions.join('|')})`; } exports.asPossibleFileExtensionsPattern = asPossibleFileExtensionsPattern; /** @@ -299226,11 +298992,11 @@ exports.asPossibleFileExtensionsPattern = asPossibleFileExtensionsPattern; * @returns */ function createGlobPatterns(rootFolderAbsolutePath, globPatterns, folderName) { - var result = []; - globPatterns.forEach(function (globPattern) { + const result = []; + globPatterns.forEach(globPattern => { if (!is_glob_1.default(globPattern)) - throw new Error("'" + globPattern + "' is not a valid glob pattern"); - result.push({ relative: "" + (folderName ? folderName + "/" : '') + globPattern, absolute: globAsAbsoluteGlob(rootFolderAbsolutePath, globPattern) }); + throw new Error(`'${globPattern}' is not a valid glob pattern`); + result.push({ relative: `${folderName ? `${folderName}/` : ''}${globPattern}`, absolute: globAsAbsoluteGlob(rootFolderAbsolutePath, globPattern) }); }); return result; } @@ -306854,27 +306620,24 @@ module.exports = picomatch; // Licensed under the MIT license. See LICENSE file in the project root for full license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.StaticFiles = void 0; -var _1 = __webpack_require__(8990); -var NOT_STATIC_FILE_EXTENSIONS = ['js', 'ts', 'd.ts']; +const _1 = __webpack_require__(8990); +const NOT_STATIC_FILE_EXTENSIONS = ['js', 'ts', 'd.ts']; /** * Represents the static files * * @export * @class StaticFiles */ -var StaticFiles = /** @class */ (function () { - function StaticFiles() { - } - /** - * The list of static source file glob patterns - * - * @static - */ - StaticFiles.staticSourceFilesGlobPatterns = _1.toPatternsThatIgnoreNodeModules("*" + _1.asPossibleFileExtensionsPattern(NOT_STATIC_FILE_EXTENSIONS, true)); - StaticFiles.staticOutputFilesGlobPatterns = ["**/*" + _1.asPossibleFileExtensionsPattern(NOT_STATIC_FILE_EXTENSIONS, true)]; - return StaticFiles; -}()); +class StaticFiles { +} exports.StaticFiles = StaticFiles; +/** + * The list of static source file glob patterns + * + * @static + */ +StaticFiles.staticSourceFilesGlobPatterns = _1.toPatternsThatIgnoreNodeModules(`*${_1.asPossibleFileExtensionsPattern(NOT_STATIC_FILE_EXTENSIONS, true)}`); +StaticFiles.staticOutputFilesGlobPatterns = [`**/*${_1.asPossibleFileExtensionsPattern(NOT_STATIC_FILE_EXTENSIONS, true)}`]; //# sourceMappingURL=StaticFiles.js.map /***/ }), @@ -310873,24 +310636,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Project = void 0; -var path_1 = __importDefault(__webpack_require__(5622)); -var glob_1 = __importDefault(__webpack_require__(6402)); -var is_glob_1 = __importDefault(__webpack_require__(5357)); -var fs_1 = __importDefault(__webpack_require__(5747)); -var _1 = __webpack_require__(8283); -var Sources_1 = __webpack_require__(8990); +const path_1 = __importDefault(__webpack_require__(5622)); +const glob_1 = __importDefault(__webpack_require__(6402)); +const is_glob_1 = __importDefault(__webpack_require__(5357)); +const fs_1 = __importDefault(__webpack_require__(5747)); +const _1 = __webpack_require__(8283); +const Sources_1 = __webpack_require__(8990); /** * Represents a project * * @export * @class Project */ -var Project = /** @class */ (function () { +class Project { /** * Instantiates an instance of {Project}. * @param {string} [root] The root folder of the project */ - function Project(root) { + constructor(root) { this._workspaces = []; this.root = root !== undefined ? path_1.default.resolve(root) : process.cwd(); this.rootPackage = new _1.Package(this.root); @@ -310899,38 +310662,33 @@ var Project = /** @class */ (function () { } this.sources = new Sources_1.Sources(this.root, this.rootPackage, this._workspaces); } - Object.defineProperty(Project.prototype, "workspaces", { - /** - * Gets the {YarnWorkspace} configuration for each yarn workspace in the project - * - * @readonly - */ - get: function () { - return this._workspaces; - }, - enumerable: false, - configurable: true - }); + /** + * Gets the {YarnWorkspace} configuration for each yarn workspace in the project + * + * @readonly + */ + get workspaces() { + return this._workspaces; + } /** * Whether or not this project has yarn workspaces * * @returns */ - Project.prototype.hasWorkspaces = function () { + hasWorkspaces() { return this._workspaces !== undefined && this._workspaces.length > 0; - }; - Project.prototype.createWorkspaces = function () { - var _this = this; + } + createWorkspaces() { this._workspaces = []; - var rootPackageObject = this.rootPackage.packageObject; - rootPackageObject.workspaces.forEach(function (workspace) { + const rootPackageObject = this.rootPackage.packageObject; + rootPackageObject.workspaces.forEach(workspace => { if (is_glob_1.default(workspace)) { - glob_1.default.sync(workspace, { absolute: true, }).forEach(function (workspacePath) { + glob_1.default.sync(workspace, { absolute: true, }).forEach(workspacePath => { try { if (fs_1.default.statSync(workspacePath).isDirectory()) { - var workspacePackage = new _1.Package(workspacePath, _this.rootPackage); - var workspaceSources = new Sources_1.Sources(workspacePackage.rootFolder, workspacePackage); - _this._workspaces.push(new _1.YarnWorkspace(workspacePackage, workspaceSources)); + const workspacePackage = new _1.Package(workspacePath, this.rootPackage); + const workspaceSources = new Sources_1.Sources(workspacePackage.rootFolder, workspacePackage); + this._workspaces.push(new _1.YarnWorkspace(workspacePackage, workspaceSources)); } } catch (error) { @@ -310941,9 +310699,9 @@ var Project = /** @class */ (function () { else { try { if (fs_1.default.statSync(workspace).isDirectory()) { - var workspacePackage = new _1.Package(workspace, _this.rootPackage); - var workspaceSources = new Sources_1.Sources(workspacePackage.rootFolder, workspacePackage); - _this._workspaces.push(new _1.YarnWorkspace(workspacePackage, workspaceSources)); + const workspacePackage = new _1.Package(workspace, this.rootPackage); + const workspaceSources = new Sources_1.Sources(workspacePackage.rootFolder, workspacePackage); + this._workspaces.push(new _1.YarnWorkspace(workspacePackage, workspaceSources)); } } catch (error) { @@ -310951,9 +310709,8 @@ var Project = /** @class */ (function () { } } }); - }; - return Project; -}()); + } +} exports.Project = Project; //# sourceMappingURL=Project.js.map @@ -325556,29 +325313,24 @@ module.exports = function defineProperty(obj, prop, val) { // Licensed under the MIT license. See LICENSE file in the project root for full license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.GulpContext = void 0; -var Project_1 = __webpack_require__(8283); -var GulpContext = /** @class */ (function () { +const Project_1 = __webpack_require__(8283); +class GulpContext { /** * Initializes a new instance of {GulpContext} */ - function GulpContext() { + constructor() { process.chdir(process.env.PWD || process.env.INIT_CWD); this._project = new Project_1.Project(process.env.PWD); } - Object.defineProperty(GulpContext.prototype, "project", { - /** - * Gets the {Project} that holds all the meta data for the current project - * - * @readonly - */ - get: function () { - return this._project; - }, - enumerable: false, - configurable: true - }); - return GulpContext; -}()); + /** + * Gets the {Project} that holds all the meta data for the current project + * + * @readonly + */ + get project() { + return this._project; + } +} exports.GulpContext = GulpContext; //# sourceMappingURL=GulpContext.js.map @@ -329931,49 +329683,27 @@ module.exports = validRange // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __values = (this && this.__values) || function(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -var fancy_log_1 = __importDefault(__webpack_require__(9749)); -var _1 = __webpack_require__(6586); -var Tasks_1 = __webpack_require__(2574); +const fancy_log_1 = __importDefault(__webpack_require__(9749)); +const _1 = __webpack_require__(6586); +const Tasks_1 = __webpack_require__(2574); /** * Setup the tasks from this package * @param {any} originalExports The original exports object in the scope of the gulpfile importing this */ function setupGulp(originalExports) { - var e_1, _a; fancy_log_1.default.info('Creating tasks...'); - var context = new _1.GulpContext(); - var gulpTasks = Tasks_1.getGulpTasks(context); - try { - for (var _b = __values(gulpTasks.allTasks), _c = _b.next(); !_c.done; _c = _b.next()) { - var task = _c.value; - if (task.displayName === undefined) - throw new Error('Task missing displayName!'); - originalExports[task.displayName] = task; - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - originalExports.default = function (done) { + const context = new _1.GulpContext(); + const gulpTasks = Tasks_1.getGulpTasks(context); + for (const task of gulpTasks.allTasks) { + if (task.displayName === undefined) + throw new Error('Task missing displayName!'); + originalExports[task.displayName] = task; + } + originalExports.default = (done) => { console.info('There is no default task'); done(); process.exit(0); @@ -332541,75 +332271,34 @@ module.exports = require("http"); // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __read = (this && this.__read) || function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -}; -var __spread = (this && this.__spread) || function () { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTask = exports.getGulpTasks = void 0; -var gulp_1 = __importDefault(__webpack_require__(69)); -var _1 = __webpack_require__(2574); -var StaticFilesTasks_1 = __webpack_require__(6839); -var GulpTasks = /** @class */ (function () { - function GulpTasks(_context) { +const gulp_1 = __importDefault(__webpack_require__(69)); +const _1 = __webpack_require__(2574); +const StaticFilesTasks_1 = __webpack_require__(6839); +class GulpTasks { + constructor(_context) { this._context = _context; } - Object.defineProperty(GulpTasks.prototype, "cleanTasks", { - get: function () { - return _1.getCleanTasks(this._context); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(GulpTasks.prototype, "lintTasks", { - get: function () { - return _1.getLintTasks(this._context); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(GulpTasks.prototype, "staticFilesTasks", { - get: function () { - return StaticFilesTasks_1.getStaticFilesTasks(this._context); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(GulpTasks.prototype, "testTasks", { - get: function () { - return _1.getTestTasks(this._context); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(GulpTasks.prototype, "allTasks", { - get: function () { - return __spread(this.cleanTasks.allTasks, this.lintTasks.allTasks, this.testTasks.allTasks, this.staticFilesTasks.allTasks); - }, - enumerable: false, - configurable: true - }); - return GulpTasks; -}()); + get cleanTasks() { + return _1.getCleanTasks(this._context); + } + get lintTasks() { + return _1.getLintTasks(this._context); + } + get staticFilesTasks() { + return StaticFilesTasks_1.getStaticFilesTasks(this._context); + } + get testTasks() { + return _1.getTestTasks(this._context); + } + get allTasks() { + return [...this.cleanTasks.allTasks, ...this.lintTasks.allTasks, ...this.testTasks.allTasks, ...this.staticFilesTasks.allTasks]; + } +} function getGulpTasks(context) { if (GulpTasks.gulpTask === undefined) GulpTasks.gulpTask = new GulpTasks(context); @@ -332617,15 +332306,15 @@ function getGulpTasks(context) { } exports.getGulpTasks = getGulpTasks; function createTask(context, taskName, parallel, createTaskCallback) { - var task; + let task; if (context.project.workspaces.length > 0) { - var workspaceTasks_1 = []; - context.project.workspaces.forEach(function (_) { - var workspaceTask = createTaskCallback(_); - workspaceTask.displayName = taskName + ":" + _.workspacePackage.packageObject.name; - workspaceTasks_1.push(workspaceTask); + const workspaceTasks = []; + context.project.workspaces.forEach(_ => { + const workspaceTask = createTaskCallback(_); + workspaceTask.displayName = `${taskName}:${_.workspacePackage.packageObject.name}`; + workspaceTasks.push(workspaceTask); }); - task = parallel ? gulp_1.default.parallel(workspaceTasks_1) : gulp_1.default.series(workspaceTasks_1); + task = parallel ? gulp_1.default.parallel(workspaceTasks) : gulp_1.default.series(workspaceTasks); task.displayName = taskName; } else { @@ -361435,34 +361124,19 @@ function hasOwn(obj, key) { "use strict"; -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); Object.defineProperty(exports, "__esModule", { value: true }); exports.NoPackageJson = void 0; // Copyright (c) Dolittle. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -var NoPackageJson = /** @class */ (function (_super) { - __extends(NoPackageJson, _super); +class NoPackageJson extends Error { /** * Instantiates an instance of {NoPackageJson}. * @param {string} path */ - function NoPackageJson(path) { - return _super.call(this, "Could not find package.json at path '" + path + "'") || this; + constructor(path) { + super(`Could not find package.json at path '${path}'`); } - return NoPackageJson; -}(Error)); +} exports.NoPackageJson = NoPackageJson; //# sourceMappingURL=NoPackageJson.js.map