본문으로 바로가기

[smartthings CLI][4] 프로젝트 소스 빌드

category 카테고리 없음 2024. 8. 13. 15:42

: Ubuntu22.04 에서 smartthings CLI  프로젝트 빌드하기

 

소스코드 위치

https://github.com/SmartThingsCommunity/smartthings-cli

 

GitHub - SmartThingsCommunity/smartthings-cli: Command-line Interface for the SmartThings APIs.

Command-line Interface for the SmartThings APIs. Contribute to SmartThingsCommunity/smartthings-cli development by creating an account on GitHub.

github.com

위 링크에서 소스코드를  다운로드 합니다.

 

▶ node.js 설치

$ node --version
v22.6.0

 

▶ typescript 설치

$ npm install -g typescript

 

▶node.js 버전이 낮다고 나오면 

$ sudo npm install -g n

 

 

▶ smartthings-cli  빌드하기

$ npm run compile

~/Project/Others/smartthings-cli-1.8.2$ npm run compile

> compile
> npm run compile --workspaces


> @smartthings/cli-lib@2.2.4 compile
> tsc -b


> @smartthings/cli-testlib@2.0.6 compile
> tsc -b


> @smartthings/plugin-cli-edge@3.3.3 compile
> tsc -b


> @smartthings/cli@1.8.2 compile
> tsc -b

 

 

↓ 빌드 완료후 smartthings 파일 찾기

smartthings-cli-1.8.2/node_modules/.bin$ ls -l smartthings
lrwxrwxrwx 1 xxx xxx 27 Aug 13 15:11 smartthings -> ../@smartthings/cli/bin/run  <--요기

smartthings-cli-1.8.2/node_modules/@smartthings$ ll
total 48
~~ 중략 ~~
lrwxrwxrwx   1 xxx xxx    18 Aug 13 15:11 cli -> ../../packages/cli/

smartthings-cli-1.8.2/packages/cli/bin$ ll
total 24
~~ 중략 ~~
-rwxrwxr-x 1 xxx xxx  180 Apr 18 05:23 run*       <-------- 요기
-rw-rw-r-- 1 xxx xxx   31 Apr 18 05:23 run.cmd

 

 

npm run watch

 : 수정사항 및 컴파일 보기

2$ npm run watch

> watch
> npm run watch --workspaces


> @smartthings/cli-lib@2.2.4 watch
> tsc -b -w
[4:25:19 PM] Starting compilation in watch mode...

[4:25:19 PM] Found 0 errors. Watching for file changes.
>> 여기서 대기중

 

npm run build

    : clean and compile

더보기
$ npm run build

> build
> npm run clean --workspaces && npm run compile --workspaces && npm run readme


> @smartthings/cli-lib@2.2.4 clean
> rimraf dist && rimraf tsconfig.tsbuildinfo


> @smartthings/cli-testlib@2.0.6 clean
> rimraf dist && rimraf tsconfig.tsbuildinfo


> @smartthings/plugin-cli-edge@3.3.3 clean
> rimraf lib && rimraf tsconfig.tsbuildinfo


> @smartthings/cli@1.8.2 clean
> rimraf lib && rimraf tsconfig.tsbuildinfo


> @smartthings/cli-lib@2.2.4 compile
> tsc -b


> @smartthings/cli-testlib@2.0.6 compile
> tsc -b


> @smartthings/plugin-cli-edge@3.3.3 compile
> tsc -b


> @smartthings/cli@1.8.2 compile
> tsc -b


> readme
> npm run readme -w packages/edge && npm run readme -w packages/cli


> @smartthings/plugin-cli-edge@3.3.3 readme
> oclif readme

replacing <!-- commands --> in README.md
replacing <!-- toc --> in README.md

> @smartthings/cli@1.8.2 readme
> oclif readme

replacing <!-- commands --> in README.md
replacing <!-- toc --> in README.md

 

npm run format

  : lint 이슈 자동 수정

더보기
$ npm run format

> format
> npm run format --workspaces


> @smartthings/cli-lib@2.2.4 format
> eslint --ext ts src --fix

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.8.0

YOUR TYPESCRIPT VERSION: 4.8.3

Please only submit bug reports when using the officially supported version.

=============

> @smartthings/cli-testlib@2.0.6 format
> eslint --ext ts src --fix

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.8.0

YOUR TYPESCRIPT VERSION: 4.8.3

Please only submit bug reports when using the officially supported version.

=============

> @smartthings/plugin-cli-edge@3.3.3 format
> eslint --ext .ts src --fix

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.8.0

YOUR TYPESCRIPT VERSION: 4.8.3

Please only submit bug reports when using the officially supported version.

=============

> @smartthings/cli@1.8.2 format
> eslint --ext ts src --fix

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.8.0

YOUR TYPESCRIPT VERSION: 4.8.3

Please only submit bug reports when using the officially supported version.

=============

 

npm run full-clean

더보기

 

$ npm run full-clean

> full-clean
> npm run full-clean --workspaces && rimraf node_modules


> @smartthings/cli-lib@2.2.4 full-clean
> rimraf node_modules && rimraf coverage && rimraf jest*html* && npm run clean


> @smartthings/cli-lib@2.2.4 clean
> rimraf dist && rimraf tsconfig.tsbuildinfo


> @smartthings/cli-testlib@2.0.6 full-clean
> rimraf node_modules && rimraf coverage && rimraf jest*html* && npm run clean


> @smartthings/cli-testlib@2.0.6 clean
> rimraf dist && rimraf tsconfig.tsbuildinfo


> @smartthings/plugin-cli-edge@3.3.3 full-clean
> rimraf node_modules && rimraf coverage && rimraf jest*html* && npm run clean


> @smartthings/plugin-cli-edge@3.3.3 clean
> rimraf lib && rimraf tsconfig.tsbuildinfo


> @smartthings/cli@1.8.2 full-clean
> rimraf node_modules && rimraf dist_bin && rimraf coverage && rimraf jest*html*reporters* && npm run clean


> @smartthings/cli@1.8.2 clean
> rimraf lib && rimraf tsconfig.tsbuildinfo

 

 npm run readme

더보기
$ npm run readme

> readme
> npm run readme -w packages/edge && npm run readme -w packages/cli


> @smartthings/plugin-cli-edge@3.3.3 readme
> oclif readme

 ›   Warning: oclif update available from 3.1.2 to 4.14.19.
replacing <!-- commands --> in README.md
replacing <!-- toc --> in README.md

> @smartthings/cli@1.8.2 readme
> oclif readme

 ›   Warning: oclif update available from 3.1.2 to 4.14.19.
replacing <!-- commands --> in README.md
replacing <!-- toc --> in README.md

 

▶ build error 시 처리

  ↓ expect 에러

     >> $ npm install expect

../lib/src/__tests__/item-input/object.test.ts:497:4 - error TS2304: Cannot find name 'expect'.

497    expect(input2SummarizeForEditMock).toHaveBeenCalled()
       ~~~~~~
       


$ npm install expect
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@smartthings/cli@1.8.2',
npm warn EBADENGINE   required: { node: '>=18.5.0 <19', npm: '>=9.5' },
npm warn EBADENGINE   current: { node: 'v22.6.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@smartthings/plugin-cli-edge@3.3.3',
npm warn EBADENGINE   required: { node: '>=18.5.0 <19', npm: '>=9.5' },
npm warn EBADENGINE   current: { node: 'v22.6.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@smartthings/cli-lib@2.2.4',
npm warn EBADENGINE   required: { node: '>=18.5.0 <19', npm: '>=9.5' },
npm warn EBADENGINE   current: { node: 'v22.6.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@smartthings/cli-testlib@2.0.6',
npm warn EBADENGINE   required: { node: '>=18.5.0 <19', npm: '>=9.5' },
npm warn EBADENGINE   current: { node: 'v22.6.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@smartthings/cli@1.8.2',
npm warn EBADENGINE   required: { node: '>=18.5.0 <19', npm: '>=9.5' },
npm warn EBADENGINE   current: { node: 'v22.6.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@smartthings/cli-lib@2.2.4',
npm warn EBADENGINE   required: { node: '>=18.5.0 <19', npm: '>=9.5' },
npm warn EBADENGINE   current: { node: 'v22.6.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@smartthings/cli-testlib@2.0.6',
npm warn EBADENGINE   required: { node: '>=18.5.0 <19', npm: '>=9.5' },
npm warn EBADENGINE   current: { node: 'v22.6.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '@smartthings/plugin-cli-edge@3.3.3',
npm warn EBADENGINE   required: { node: '>=18.5.0 <19', npm: '>=9.5' },
npm warn EBADENGINE   current: { node: 'v22.6.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm warn deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm warn deprecated @npmcli/fs@1.1.0: this version had an improper engines field added, update to 1.1.1

added 1725 packages, and audited 1730 packages in 12s

174 packages are looking for funding
  run `npm fund` for details

21 vulnerabilities (6 moderate, 15 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

 

 ↓ axios 에러 

    > $ npm install axios

 

src/login-authenticator.ts(1,70): error TS2307: Cannot find module 'axios' or its corresponding type declarations.

 

 

반응형