mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: drop unleash cli support from v4
This commit is contained in:
		
							parent
							
								
									38791a45ce
								
							
						
					
					
						commit
						c859566dab
					
				@ -24,9 +24,6 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "license": "Apache-2.0",
 | 
					  "license": "Apache-2.0",
 | 
				
			||||||
  "main": "./dist/lib/server-impl.js",
 | 
					  "main": "./dist/lib/server-impl.js",
 | 
				
			||||||
  "bin": {
 | 
					 | 
				
			||||||
    "unleash": "./dist/bin/unleash.js"
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
    "start": "node ./dist/server.js",
 | 
					    "start": "node ./dist/server.js",
 | 
				
			||||||
    "start:google": "node examples/google-auth-unleash.js",
 | 
					    "start:google": "node examples/google-auth-unleash.js",
 | 
				
			||||||
@ -103,8 +100,7 @@
 | 
				
			|||||||
    "response-time": "^2.3.2",
 | 
					    "response-time": "^2.3.2",
 | 
				
			||||||
    "serve-favicon": "^2.5.0",
 | 
					    "serve-favicon": "^2.5.0",
 | 
				
			||||||
    "unleash-frontend": "4.0.0-beta.1",
 | 
					    "unleash-frontend": "4.0.0-beta.1",
 | 
				
			||||||
    "uuid": "^8.3.2",
 | 
					    "uuid": "^8.3.2"
 | 
				
			||||||
    "yargs": "^16.0.3"
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@istanbuljs/nyc-config-typescript": "^1.0.1",
 | 
					    "@istanbuljs/nyc-config-typescript": "^1.0.1",
 | 
				
			||||||
 | 
				
			|||||||
@ -1,65 +0,0 @@
 | 
				
			|||||||
#!/usr/bin/env node
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
'use strict';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
process.env.NODE_ENV = 'production';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const fs = require('fs');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const { argv } = require('yargs')
 | 
					 | 
				
			||||||
    .usage('$0 [options]')
 | 
					 | 
				
			||||||
    .env(true)
 | 
					 | 
				
			||||||
    .option('port', {
 | 
					 | 
				
			||||||
        alias: 'p',
 | 
					 | 
				
			||||||
        describe: 'The HTTP port you want to start unleash on',
 | 
					 | 
				
			||||||
        demand: false,
 | 
					 | 
				
			||||||
        default: 4242,
 | 
					 | 
				
			||||||
        type: 'number',
 | 
					 | 
				
			||||||
    })
 | 
					 | 
				
			||||||
    .option('host', {
 | 
					 | 
				
			||||||
        alias: 'l',
 | 
					 | 
				
			||||||
        describe: 'The HTTP address the server will accept connections on.',
 | 
					 | 
				
			||||||
        demand: false,
 | 
					 | 
				
			||||||
        type: 'string',
 | 
					 | 
				
			||||||
    })
 | 
					 | 
				
			||||||
    .option('databaseUrl', {
 | 
					 | 
				
			||||||
        alias: 'd',
 | 
					 | 
				
			||||||
        describe:
 | 
					 | 
				
			||||||
            'The full databaseUrl to connect to, including username and password. Either databaseUrl or databaseUrlFile is required.',
 | 
					 | 
				
			||||||
        demand: false,
 | 
					 | 
				
			||||||
        type: 'string',
 | 
					 | 
				
			||||||
    })
 | 
					 | 
				
			||||||
    .option('databaseUrlFile', {
 | 
					 | 
				
			||||||
        alias: 'f',
 | 
					 | 
				
			||||||
        describe:
 | 
					 | 
				
			||||||
            'The full path to a file containing the full database url to connect to, including username and password. When this option is supplied, it takes precedence over databaseUrl.',
 | 
					 | 
				
			||||||
        demand: false,
 | 
					 | 
				
			||||||
        type: 'string',
 | 
					 | 
				
			||||||
    })
 | 
					 | 
				
			||||||
    .check(args => !!(args.databaseUrl || args.databaseUrlFile))
 | 
					 | 
				
			||||||
    .option('databaseSchema', {
 | 
					 | 
				
			||||||
        alias: 's',
 | 
					 | 
				
			||||||
        describe: 'The database schema to use',
 | 
					 | 
				
			||||||
        default: 'public',
 | 
					 | 
				
			||||||
        demand: false,
 | 
					 | 
				
			||||||
        type: 'string',
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const serverImpl = require('../lib/server-impl.js');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if (argv.databaseUrlFile) {
 | 
					 | 
				
			||||||
    argv.databaseUrl = fs.readFileSync(argv.databaseUrlFile, 'utf8');
 | 
					 | 
				
			||||||
    delete argv.databaseUrlFile;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
serverImpl
 | 
					 | 
				
			||||||
    .start(argv)
 | 
					 | 
				
			||||||
    .then(instance => {
 | 
					 | 
				
			||||||
        const address = instance.server.address();
 | 
					 | 
				
			||||||
        // eslint-disable-next-line no-console
 | 
					 | 
				
			||||||
        console.log(
 | 
					 | 
				
			||||||
            `Unleash started on http://${address.address}:${address.port}`,
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
    })
 | 
					 | 
				
			||||||
    // eslint-disable-next-line no-console
 | 
					 | 
				
			||||||
    .catch(console.err);
 | 
					 | 
				
			||||||
							
								
								
									
										37
									
								
								yarn.lock
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								yarn.lock
									
									
									
									
									
								
							@ -1324,15 +1324,6 @@ cliui@^6.0.0:
 | 
				
			|||||||
    strip-ansi "^6.0.0"
 | 
					    strip-ansi "^6.0.0"
 | 
				
			||||||
    wrap-ansi "^6.2.0"
 | 
					    wrap-ansi "^6.2.0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cliui@^7.0.0:
 | 
					 | 
				
			||||||
  version "7.0.1"
 | 
					 | 
				
			||||||
  resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.1.tgz"
 | 
					 | 
				
			||||||
  integrity sha512-rcvHOWyGyid6I1WjT/3NatKj2kDt9OdSHSXpyLXaMWFbKpGACNW8pRhhdPUq9MWUOdwn8Rz9AVETjF4105rZZQ==
 | 
					 | 
				
			||||||
  dependencies:
 | 
					 | 
				
			||||||
    string-width "^4.2.0"
 | 
					 | 
				
			||||||
    strip-ansi "^6.0.0"
 | 
					 | 
				
			||||||
    wrap-ansi "^7.0.0"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
cliui@^7.0.2:
 | 
					cliui@^7.0.2:
 | 
				
			||||||
  version "7.0.4"
 | 
					  version "7.0.4"
 | 
				
			||||||
  resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
 | 
					  resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f"
 | 
				
			||||||
@ -2173,11 +2164,6 @@ es6-weak-map@^2.0.3:
 | 
				
			|||||||
    es6-iterator "^2.0.3"
 | 
					    es6-iterator "^2.0.3"
 | 
				
			||||||
    es6-symbol "^3.1.1"
 | 
					    es6-symbol "^3.1.1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
escalade@^3.0.2:
 | 
					 | 
				
			||||||
  version "3.1.0"
 | 
					 | 
				
			||||||
  resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.0.tgz"
 | 
					 | 
				
			||||||
  integrity sha512-mAk+hPSO8fLDkhV7V0dXazH5pDc6MrjBTPyD3VeKzxnVFjH1MIxbCdqGZB9O8+EwWakZs3ZCbDS4IpRt79V1ig==
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
escalade@^3.1.1:
 | 
					escalade@^3.1.1:
 | 
				
			||||||
  version "3.1.1"
 | 
					  version "3.1.1"
 | 
				
			||||||
  resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
 | 
					  resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
 | 
				
			||||||
@ -7086,11 +7072,6 @@ y18n@^4.0.0:
 | 
				
			|||||||
  resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz"
 | 
					  resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz"
 | 
				
			||||||
  integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
 | 
					  integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==
 | 
				
			||||||
 | 
					
 | 
				
			||||||
y18n@^5.0.1:
 | 
					 | 
				
			||||||
  version "5.0.1"
 | 
					 | 
				
			||||||
  resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.1.tgz"
 | 
					 | 
				
			||||||
  integrity sha512-/jJ831jEs4vGDbYPQp4yGKDYPSCCEQ45uZWJHE1AoYBzqdZi8+LDWas0z4HrmJXmKdpFsTiowSHXdxyFhpmdMg==
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
y18n@^5.0.5:
 | 
					y18n@^5.0.5:
 | 
				
			||||||
  version "5.0.8"
 | 
					  version "5.0.8"
 | 
				
			||||||
  resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
 | 
					  resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
 | 
				
			||||||
@ -7119,11 +7100,6 @@ yargs-parser@^18.1.2:
 | 
				
			|||||||
    camelcase "^5.0.0"
 | 
					    camelcase "^5.0.0"
 | 
				
			||||||
    decamelize "^1.2.0"
 | 
					    decamelize "^1.2.0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
yargs-parser@^20.0.0:
 | 
					 | 
				
			||||||
  version "20.2.0"
 | 
					 | 
				
			||||||
  resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.0.tgz"
 | 
					 | 
				
			||||||
  integrity sha512-2agPoRFPoIcFzOIp6656gcvsg2ohtscpw2OINr/q46+Sq41xz2OYLqx5HRHabmFU1OARIPAYH5uteICE7mn/5A==
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
yargs-parser@^20.2.2:
 | 
					yargs-parser@^20.2.2:
 | 
				
			||||||
  version "20.2.7"
 | 
					  version "20.2.7"
 | 
				
			||||||
  resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a"
 | 
					  resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a"
 | 
				
			||||||
@ -7146,19 +7122,6 @@ yargs@^15.0.2, yargs@^15.3.1:
 | 
				
			|||||||
    y18n "^4.0.0"
 | 
					    y18n "^4.0.0"
 | 
				
			||||||
    yargs-parser "^18.1.2"
 | 
					    yargs-parser "^18.1.2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
yargs@^16.0.3:
 | 
					 | 
				
			||||||
  version "16.0.3"
 | 
					 | 
				
			||||||
  resolved "https://registry.npmjs.org/yargs/-/yargs-16.0.3.tgz"
 | 
					 | 
				
			||||||
  integrity sha512-6+nLw8xa9uK1BOEOykaiYAJVh6/CjxWXK/q9b5FpRgNslt8s22F2xMBqVIKgCRjNgGvGPBy8Vog7WN7yh4amtA==
 | 
					 | 
				
			||||||
  dependencies:
 | 
					 | 
				
			||||||
    cliui "^7.0.0"
 | 
					 | 
				
			||||||
    escalade "^3.0.2"
 | 
					 | 
				
			||||||
    get-caller-file "^2.0.5"
 | 
					 | 
				
			||||||
    require-directory "^2.1.1"
 | 
					 | 
				
			||||||
    string-width "^4.2.0"
 | 
					 | 
				
			||||||
    y18n "^5.0.1"
 | 
					 | 
				
			||||||
    yargs-parser "^20.0.0"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
yargs@^16.1.0, yargs@^16.2.0:
 | 
					yargs@^16.1.0, yargs@^16.2.0:
 | 
				
			||||||
  version "16.2.0"
 | 
					  version "16.2.0"
 | 
				
			||||||
  resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
 | 
					  resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66"
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user