From 0e1e0e95e8973a280f80735757d727468723c044 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Thu, 26 Nov 2020 08:42:16 +0000 Subject: [PATCH 1/3] fix(*): upgrade adapter to work with TypeScript --- nodemon.json | 5 +++++ package-lock.json | 7 +++---- package.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 nodemon.json diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 000000000..2276b28d9 --- /dev/null +++ b/nodemon.json @@ -0,0 +1,5 @@ +{ + "watch": ["src"], + "ext": "js, ts", + "exec": "ts-node src/index.ts" +} diff --git a/package-lock.json b/package-lock.json index 29223c5f3..3378cc236 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1491,9 +1491,9 @@ } }, "@sasjs/adapter": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-1.18.3.tgz", - "integrity": "sha512-wzDFJRyt2dXFeQP+JzqRGunYUbujrAbU/Jc4IWg5URsCkGAzwsNl/4G0xJVbqOTy1MvoZ431rfCnvhkUlg7D3Q==", + "version": "1.18.6", + "resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-1.18.6.tgz", + "integrity": "sha512-9IEIyVVYsLuFQUJgoopCyxO5oeOWNmxwzg14eroa4nSh2yNZgKG0/uSvdbIcsKSv7hY1eB1g4arMhi+/C/Q4sw==", "requires": { "es6-promise": "^4.2.8", "form-data": "^3.0.0", @@ -10563,7 +10563,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "requires": { "glob": "^7.1.3" } diff --git a/package.json b/package.json index b7a6f71bb..35e3afeac 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "access": "public" }, "dependencies": { - "@sasjs/adapter": "^1.18.3", + "@sasjs/adapter": "^1.18.6", "@sasjs/core": "^1.8.0", "base64-img": "^1.0.4", "btoa": "^1.2.1", From 552d1b0dba4247b7ca5b4fdce50b290fb36c28a6 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Thu, 26 Nov 2020 08:51:17 +0000 Subject: [PATCH 2/3] fix(*): remove nodemon arguments --- package.json | 2 +- src/index.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 35e3afeac..08306259f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "build/**/*" ], "scripts": { - "start": "nodemon --watch 'src/**/*' --exec 'npm run build && npm link'", + "start": "nodemon", "build": "rimraf build && tsc -p . && cp ./src/*.json build", "test": "jest --silent --runInBand", "semantic-release": "semantic-release -d", diff --git a/src/index.ts b/src/index.ts index 1e5c4651e..908ba8417 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1 @@ #!/usr/bin/env node - -require = require('esm')(module /*, options*/) -require('./cli').cli(process.argv) From 0ac5c40e41db1230e63d9aa8b95ea4b24c919d5f Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Thu, 26 Nov 2020 13:50:12 +0300 Subject: [PATCH 3/3] fix(adapter): fixed adapter imports --- .gitignore | 1 + package-lock.json | 12 ++++++------ package.json | 8 ++++---- src/index.ts | 3 +++ test/commands/job.spec.js | 4 ++-- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index cfa8acfe4..f4b680747 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ build sas sasbuild .env +.DS_Store \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 3378cc236..a5dccff2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1491,9 +1491,9 @@ } }, "@sasjs/adapter": { - "version": "1.18.6", - "resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-1.18.6.tgz", - "integrity": "sha512-9IEIyVVYsLuFQUJgoopCyxO5oeOWNmxwzg14eroa4nSh2yNZgKG0/uSvdbIcsKSv7hY1eB1g4arMhi+/C/Q4sw==", + "version": "1.18.7", + "resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-1.18.7.tgz", + "integrity": "sha512-OWpk9efBALZ90RJG6rNcHNx7aDkFUo6y+OSaQ+RqGw7aQdj22RhOoJsF90/VWQgJrH91HDH1a6lYSpzPtXvW3Q==", "requires": { "es6-promise": "^4.2.8", "form-data": "^3.0.0", @@ -1501,9 +1501,9 @@ } }, "@sasjs/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@sasjs/core/-/core-1.8.0.tgz", - "integrity": "sha512-j1Jq6P5H3M4bHBdVLTVXO442P5Imd0WWG1oPTG++ckNvAme9MIsABCBDGwrLlqvLUIdYoUQEk11FPlACRoiIUA==" + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@sasjs/core/-/core-1.11.2.tgz", + "integrity": "sha512-riOmAmgaX3VitjANn+0jB3h1bvHUUiYYqtWSjj4dKX96CDGqb+jzlFd0mMQ7dBAfE2sO6i68Mwd4EULPU4tIyQ==" }, "@semantic-release/commit-analyzer": { "version": "8.0.1", diff --git a/package.json b/package.json index 08306259f..c0ce625f0 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "build/**/*" ], "scripts": { - "start": "nodemon", + "start": "nodemon --watch 'src/**/*' --exec 'npm run build && npm link'", "build": "rimraf build && tsc -p . && cp ./src/*.json build", "test": "jest --silent --runInBand", "semantic-release": "semantic-release -d", @@ -19,7 +19,7 @@ ] }, "bin": { - "sasjs": "./build/index.js" + "sasjs": "build/index.js" }, "repository": { "type": "git", @@ -40,8 +40,8 @@ "access": "public" }, "dependencies": { - "@sasjs/adapter": "^1.18.6", - "@sasjs/core": "^1.8.0", + "@sasjs/adapter": "^1.18.7", + "@sasjs/core": "^1.11.2", "base64-img": "^1.0.4", "btoa": "^1.2.1", "chalk": "^4.1.0", diff --git a/src/index.ts b/src/index.ts index 908ba8417..1e5c4651e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,4 @@ #!/usr/bin/env node + +require = require('esm')(module /*, options*/) +require('./cli').cli(process.argv) diff --git a/test/commands/job.spec.js b/test/commands/job.spec.js index f83a37885..ad802f172 100644 --- a/test/commands/job.spec.js +++ b/test/commands/job.spec.js @@ -266,13 +266,13 @@ describe('getContextName', () => { jest.unmock('chalk') }) - it.only('should return the context name if specified in the target', () => { + it('should return the context name if specified in the target', () => { const target = { contextName: 'Test Context' } expect(getContextName(target)).toEqual('Test Context') }) - it.only('should return the default context if context name is not specified', () => { + it('should return the default context if context name is not specified', () => { const target = { contextName: undefined } expect(getContextName(target)).toEqual('SAS Job Execution compute context')