[Cybozu Days 2019 도쿄] 피로한 kintone CLI를 사용해 보았다
14565 단어 cybozudayskintone-cli금과
소개
Cybozu Days 2019 도쿄의 기조 강연에서, kintone의 개발자용 정보의 발표가 있었던 것 같습니다.
자세한 내용은 여기 Cybozu Days 2019 kintone 개발자 정보
거기서 발표가 있었다 킨톤 CLI 에 흥미를 가졌으므로, 실제로 시험해 보았습니다.
환경 등
설정
전역적으로 설치합니다.
$ npm install -g git://github.com/kintone/kintone-cli.git
$ kintone-cli -V
0.1.0
$ kintone-cli -h
Usage: kintone-cli [options] [command]
kintone Node CLI
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
create-template [options]
init [options] Initialize kintone project
build [options]
deploy [options]
lint [options]
dev [options]
auth [options]
kintone-cli init
init 명령의 도움말을 확인해 봅니다.
-p 옵션으로 임의의 프로젝트명을 건네줄 수 있는 것 같습니다.
$ kintone-cli init -h
Usage: init [options]
Initialize kintone project
Options:
--install Install dependencies or not
--quick Quickly create a kintone project
-p, --project-name <projectName> Project name
-h, --help output usage information
절차서대로 init 해 봅니다.
$ kintone-cli init --quick
Initialized empty Git repository in /Users/kazoo/local/kintone/kintone-cli/kintone-cli-test/kintone-customization-project/.git/
Project created!
To create new app, use:
kintone-cli create-template
과연, kintone 커스터마이즈에 필수적인 (?) 라이브러리를 설정하게 되어 있습니다.
package.json{
"name": "kintone-customization-project",
"version": "0.0.1",
"description": "kintone customization project",
"author": "",
"license": "MIT",
"dependencies": {
"@kintone/kintone-ui-component": "^0.4.0",
"@kintone/kintone-js-sdk": "^0.6.2"
},
"devDependencies": {
"local-web-server": "^2.6.1"
},
"scripts": {
"dev": "ws"
}
}
kintone-cli create-template
create-templete합니다.
init 할 때 생성 된 package.json이있는 디렉토리로 이동하여 실행하십시오.
위의 라이브러리도 함께 설치됩니다.
$ ls -la
total 16
drwxr-xr-x 5 kazoo staff 160 11 14 00:37 .
drwxr-xr-x 4 kazoo staff 128 11 12 07:51 ..
drwxr-xr-x 5 kazoo staff 160 11 14 00:37 kintone-customization-project
Kazu-MacBook-Pro:kintone-cli-test kazoo$ cd kintone-customization-project/
$ kintone-cli create-template --quick
Creating app...
npx: 1個のパッケージを2.317秒でインストールしました。
kintone-1573660015713/source/js/script.js 42ms
Installing dependencies...
> [email protected] postinstall /Users/kazoo/local/kintone/kintone-cli/kintone-cli-test/kintone-customization-project/node_modules/core-js
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=0.10.0 <9.0.0"} (current: {"node":"12.13.0","npm":"6.12.0"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN @kintone/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @kintone/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
added 408 packages from 269 contributors and audited 784 packages in 17.647s
found 0 vulnerabilities
To set auth info, use:
kintone-cli auth --app-name kintone-1573660015713
$ ls -la
total 312
drwxr-xr-x 8 kazoo staff 256 11 14 00:47 .
drwxr-xr-x 5 kazoo staff 160 11 14 00:37 ..
drwxr-xr-x 10 kazoo staff 320 11 14 00:48 .git
-rw-r--r-- 1 kazoo staff 44 11 14 00:46 .gitignore
drwxr-xr-x 4 kazoo staff 128 11 14 00:46 kintone-1573660015713
drwxr-xr-x 331 kazoo staff 10592 11 14 00:47 node_modules
-rw-r--r-- 1 kazoo staff 150444 11 14 00:47 package-lock.json
-rw-r--r-- 1 kazoo staff 468 11 14 00:46 package.json
스크린샷입니다.
kintone-cli auth
자격 증명 파일 만들기
$ kintone-cli auth -h
Usage: auth [options]
Options:
-a, --app-name <appName> Kintone domain
-d, --domain <domain> Kintone domain
-u, --username <username> Kintone username
-p, --password <password> Kintone password
-i, --app-id <appID> Kintone app ID
-r, --use-proxy Use proxy or not
-x, --proxy <proxy> Proxy full URL, including port number
-h, --help output usage information
$ kintone-cli auth -d 'xxxxx.cybozu.com' -u 'xxxxxxxx' -p 'xxxxxxx' -a 'kintone-1573660015713'
? What is the app ID ? 1
? Do you use proxy ? No
Set auth info complete.
To start dev, use:
kintone-cli dev --app-name kintone-1573660015713
To deploy app, use:
kintone-cli deploy --app-name kintone-1573660015713
kintone-cli dev
개발용 서버를 시작합니다.
옵션
$ kintone-cli dev --help
Usage: dev [options]
Options:
--watch Watch for changes in source code
--app-name <appName> Watch for changes in source code
--localhost Use localhost as link
-h, --help output usage information
실행해 보겠습니다.
$ kintone-cli dev --app-name kintone-1573660015713
Starting local webserver...
Please open this link in your browser to trust kintone Customization files:
https://192.168.0.10:8000
Then, press any key to continue:
Attaching links to kintone...
カスタマイズのアップロードを開始します
JavaScript/CSS ファイルをアップロードしました!
JavaScript/CSS カスタマイズの設定を変更しました!
運用環境への反映の完了を待っています...
運用環境への反映の完了を待っています...
運用環境に反映しました!
All done. Happy customizing!
Press Ctrl + C to stop local web server.
앱 설정 화면의 스크린 샷입니다.
로컬 웹 서버를 통해 사용자 정의 JS 파일이 링크된 것 같습니다.
파일을 편집할 때.
사용자 정의가 적용되었습니다.
deploy
개발 서버를 중지하고 배포합니다.
$ kintone-cli deploy --app-name kintone-15736600153
カスタマイズのアップロードを開始します
kintone-1573660015713/source/js/script.js をアップロードしました!
kintone-1573660015713/source/css/style.css をアップロードしました!
JavaScript/CSS ファイルをアップロードしました!
JavaScript/CSS カスタマイズの設定を変更しました!
運用環境への反映の完了を待っています...
運用環境への反映の完了を待っています...
運用環境への反映の完了を待っています...
運用環境に反映しました!
JS 파일이 배포되었습니다.
참고
$ npm install -g git://github.com/kintone/kintone-cli.git
$ kintone-cli -V
0.1.0
$ kintone-cli -h
Usage: kintone-cli [options] [command]
kintone Node CLI
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
create-template [options]
init [options] Initialize kintone project
build [options]
deploy [options]
lint [options]
dev [options]
auth [options]
$ kintone-cli init -h
Usage: init [options]
Initialize kintone project
Options:
--install Install dependencies or not
--quick Quickly create a kintone project
-p, --project-name <projectName> Project name
-h, --help output usage information
$ kintone-cli init --quick
Initialized empty Git repository in /Users/kazoo/local/kintone/kintone-cli/kintone-cli-test/kintone-customization-project/.git/
Project created!
To create new app, use:
kintone-cli create-template
{
"name": "kintone-customization-project",
"version": "0.0.1",
"description": "kintone customization project",
"author": "",
"license": "MIT",
"dependencies": {
"@kintone/kintone-ui-component": "^0.4.0",
"@kintone/kintone-js-sdk": "^0.6.2"
},
"devDependencies": {
"local-web-server": "^2.6.1"
},
"scripts": {
"dev": "ws"
}
}
$ ls -la
total 16
drwxr-xr-x 5 kazoo staff 160 11 14 00:37 .
drwxr-xr-x 4 kazoo staff 128 11 12 07:51 ..
drwxr-xr-x 5 kazoo staff 160 11 14 00:37 kintone-customization-project
Kazu-MacBook-Pro:kintone-cli-test kazoo$ cd kintone-customization-project/
$ kintone-cli create-template --quick
Creating app...
npx: 1個のパッケージを2.317秒でインストールしました。
kintone-1573660015713/source/js/script.js 42ms
Installing dependencies...
> [email protected] postinstall /Users/kazoo/local/kintone/kintone-cli/kintone-cli-test/kintone-customization-project/node_modules/core-js
> node scripts/postinstall || echo "ignore"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=0.10.0 <9.0.0"} (current: {"node":"12.13.0","npm":"6.12.0"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN @kintone/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @kintone/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
added 408 packages from 269 contributors and audited 784 packages in 17.647s
found 0 vulnerabilities
To set auth info, use:
kintone-cli auth --app-name kintone-1573660015713
$ ls -la
total 312
drwxr-xr-x 8 kazoo staff 256 11 14 00:47 .
drwxr-xr-x 5 kazoo staff 160 11 14 00:37 ..
drwxr-xr-x 10 kazoo staff 320 11 14 00:48 .git
-rw-r--r-- 1 kazoo staff 44 11 14 00:46 .gitignore
drwxr-xr-x 4 kazoo staff 128 11 14 00:46 kintone-1573660015713
drwxr-xr-x 331 kazoo staff 10592 11 14 00:47 node_modules
-rw-r--r-- 1 kazoo staff 150444 11 14 00:47 package-lock.json
-rw-r--r-- 1 kazoo staff 468 11 14 00:46 package.json
$ kintone-cli auth -h
Usage: auth [options]
Options:
-a, --app-name <appName> Kintone domain
-d, --domain <domain> Kintone domain
-u, --username <username> Kintone username
-p, --password <password> Kintone password
-i, --app-id <appID> Kintone app ID
-r, --use-proxy Use proxy or not
-x, --proxy <proxy> Proxy full URL, including port number
-h, --help output usage information
$ kintone-cli auth -d 'xxxxx.cybozu.com' -u 'xxxxxxxx' -p 'xxxxxxx' -a 'kintone-1573660015713'
? What is the app ID ? 1
? Do you use proxy ? No
Set auth info complete.
To start dev, use:
kintone-cli dev --app-name kintone-1573660015713
To deploy app, use:
kintone-cli deploy --app-name kintone-1573660015713
$ kintone-cli dev --help
Usage: dev [options]
Options:
--watch Watch for changes in source code
--app-name <appName> Watch for changes in source code
--localhost Use localhost as link
-h, --help output usage information
$ kintone-cli dev --app-name kintone-1573660015713
Starting local webserver...
Please open this link in your browser to trust kintone Customization files:
https://192.168.0.10:8000
Then, press any key to continue:
Attaching links to kintone...
カスタマイズのアップロードを開始します
JavaScript/CSS ファイルをアップロードしました!
JavaScript/CSS カスタマイズの設定を変更しました!
運用環境への反映の完了を待っています...
運用環境への反映の完了を待っています...
運用環境に反映しました!
All done. Happy customizing!
Press Ctrl + C to stop local web server.
$ kintone-cli deploy --app-name kintone-15736600153
カスタマイズのアップロードを開始します
kintone-1573660015713/source/js/script.js をアップロードしました!
kintone-1573660015713/source/css/style.css をアップロードしました!
JavaScript/CSS ファイルをアップロードしました!
JavaScript/CSS カスタマイズの設定を変更しました!
運用環境への反映の完了を待っています...
運用環境への反映の完了を待っています...
運用環境への反映の完了を待っています...
運用環境に反映しました!
후기
이것은 개발이 드물 것 같네요.
이 근처를 보면,
htps : // 기주 b. 코 m / Kintone / Kinto Ne-c # 2-c Rete-ku s와 Mizachion-p-Gin-mp ぁ
webpack이나 TypeScript의 설정도 할 수 있을 것 같기 때문에, 또 시험해 보고 싶습니다.
Reference
이 문제에 관하여([Cybozu Days 2019 도쿄] 피로한 kintone CLI를 사용해 보았다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/sy250f/items/0d503cefe7af0082f7d4
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
Reference
이 문제에 관하여([Cybozu Days 2019 도쿄] 피로한 kintone CLI를 사용해 보았다), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/sy250f/items/0d503cefe7af0082f7d4텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)