diff --git a/packages/dist-util/.npmrc b/packages/dist-util/.npmrc deleted file mode 100644 index 43c97e719a5a..000000000000 --- a/packages/dist-util/.npmrc +++ /dev/null @@ -1 +0,0 @@ -package-lock=false diff --git a/packages/dist-util/CHANGELOG.md b/packages/dist-util/CHANGELOG.md deleted file mode 100644 index 67875619fe2e..000000000000 --- a/packages/dist-util/CHANGELOG.md +++ /dev/null @@ -1,92 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - - -# [0.4.0](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.7...@loopback/dist-util@0.4.0) (2018-10-06) - - -### Features - -* deprecate dist-util package ([91a343c](https://github.com/strongloop/loopback-next/commit/91a343c)) - - - - - - -## [0.3.7](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.6...@loopback/dist-util@0.3.7) (2018-09-10) - -**Note:** Version bump only for package @loopback/dist-util - - - - - - -## [0.3.6](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.5...@loopback/dist-util@0.3.6) (2018-08-08) - - - - -**Note:** Version bump only for package @loopback/dist-util - - -## [0.3.5](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.4...@loopback/dist-util@0.3.5) (2018-07-21) - - - - -**Note:** Version bump only for package @loopback/dist-util - - -## [0.3.4](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.3...@loopback/dist-util@0.3.4) (2018-07-20) - - - - -**Note:** Version bump only for package @loopback/dist-util - - -## [0.3.3](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.2...@loopback/dist-util@0.3.3) (2018-06-20) - - - - -**Note:** Version bump only for package @loopback/dist-util - - -## [0.3.2](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.1...@loopback/dist-util@0.3.2) (2018-06-08) - - - - -**Note:** Version bump only for package @loopback/dist-util - - -## [0.3.1](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.0...@loopback/dist-util@0.3.1) (2018-05-08) - - - - -**Note:** Version bump only for package @loopback/dist-util - - -# 0.3.0 (2018-05-03) - - -### Features - -* add helper package "dist-util" ([532f153](https://github.com/strongloop/loopback-next/commit/532f153)) - - - - - -# 0.2.0 (2018-05-03) - - -### Features - -* add helper package "dist-util" ([532f153](https://github.com/strongloop/loopback-next/commit/532f153)) diff --git a/packages/dist-util/LICENSE b/packages/dist-util/LICENSE deleted file mode 100644 index f0f445f9bf6d..000000000000 --- a/packages/dist-util/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) IBM Corp. 2018. All Rights Reserved. -Node module: @loopback/dist-util -This project is licensed under the MIT License, full text below. - --------- - -MIT license - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/dist-util/README.md b/packages/dist-util/README.md deleted file mode 100644 index 4c59a961dc8e..000000000000 --- a/packages/dist-util/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# @loopback/dist-util - -**This package is no longer actively maintained.** - -Please upgrade your project to use a single compilation target, for example by -changing your `build` script in `package.json` as follows: - -```json -{ - "scripts": { - "build": "lb-tsc es2017 --outDir dist" - } -} -``` - -## Overview - -Utilities to work with `dist` folders used by different Node.js versions. - -| version | directory | -| ------- | --------------- | -| 6.x LTS | _not supported_ | -| 8.x LTS | `dist8` | -| 9.x | `dist8` | -| 10.x | `dist10` | -| newer | `dist10` | - -## Installation - -Run the following command to install this package: - -``` -$ npm install @loopback/dist-util -``` - -## Basic Use - -Configure your TypeScript build to produce two distribution versions: - -- `dist8` compiled for `es2017` target -- `dist10` compiled for `es2018` target - -Put the following line to your main `index.js` file: - -```js -module.exports = require('@loopback/dist-util').loadDist(__dirname); -// calls `require(__dirname + '/dist8')` or `require(__dirname + '/dist10')` -``` - -It is also possible to obtain the name of the correct `dist` directory without -loading the dist files: - -```js -const dist = require('@loopback/dist-util').getDist(); -console.log(dist); -// prints `dist8` or `dist10` -``` - -## Contributions - -- [Guidelines](https://github.com/strongloop/loopback-next/blob/master/docs/CONTRIBUTING.md) -- [Join the team](https://github.com/strongloop/loopback-next/issues/110) - -## Contributors - -See -[all contributors](https://github.com/strongloop/loopback-next/graphs/contributors). - -## License - -MIT diff --git a/packages/dist-util/index.js b/packages/dist-util/index.js deleted file mode 100644 index 6e4803bb13ce..000000000000 --- a/packages/dist-util/index.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright IBM Corp. 2018. All Rights Reserved. -// Node module: @loopback/dist-util -// This file is licensed under the MIT License. -// License text available at https://opensource.org/licenses/MIT - -'use strict'; - -const path = require('path'); -const util = require('util'); -const semver = require('semver'); - -/** - * Make sure node version meets the requirement. This file intentionally - * only uses ES5 features so that it can be run with lower versions of Node - * to report the version requirement. - */ -function checkNodeVersion(range) { - const nodeVer = process.versions.node; - const requiredVer = range || require('./package.json').engines.node; - const ok = semver.satisfies(nodeVer, requiredVer); - if (!ok) { - const format = 'Node.js %s is not supported. Please use a version %s.'; - const msg = util.format(format, nodeVer, requiredVer); - throw new Error(msg); - } -} - -function getDist() { - checkNodeVersion(); - const nodeMajorVersion = +process.versions.node.split('.')[0]; - return nodeMajorVersion >= 10 ? './dist10' : './dist8'; -} - -function loadDist(projectRootDir) { - const dist = getDist(); - return require(path.join(projectRootDir, dist)); -} - -module.exports = {getDist, loadDist, checkNodeVersion}; diff --git a/packages/dist-util/package.json b/packages/dist-util/package.json deleted file mode 100644 index 9d8a6ab6a899..000000000000 --- a/packages/dist-util/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@loopback/dist-util", - "version": "0.4.0", - "description": "Select dist directory based on Node.js major version.", - "homepage": "https://github.com/strongloop/loopback-next/tree/master/packages/dist-select", - "author": { - "name": "IBM" - }, - "engines": { - "node": ">=8.9" - }, - "dependencies": { - "semver": "^5.5.1" - }, - "files": [ - "index.js" - ], - "keywords": [ - "LoopBack" - ], - "repository": { - "type": "git", - "url": "https://github.com/strongloop/loopback-next" - }, - "copyright.owner": "IBM Corp.", - "license": "MIT" -}