File tree Expand file tree Collapse file tree 5 files changed +20
-19
lines changed Expand file tree Collapse file tree 5 files changed +20
-19
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Qiita の Markdown 記法については[Markdown 記法 チートシート](htt
2222
2323Qiita CLI を使うには ` Node.js 18.0.0 ` 以上が必要です。Node.js をはじめて使う場合はインストールする必要があります。
2424
25- > ` Docker ` で利用するには` Docker ` がインストールされている必要があります。
25+ > ` Docker ` で利用するには` Docker ` がインストールされている必要があります。
2626
2727### 2. Qiita CLI をインストールする
2828
@@ -32,11 +32,11 @@ Qiita のコンテンツを管理したいディレクトリで、以下のコ
3232npm install @qiita/qiita-cli --save-dev
3333```
3434
35- > ` Docker ` で環境を構築する場合は次のコマンドで実行できます。
35+ > ` Docker ` で環境を構築する場合は次のコマンドで実行できます。
3636>
37- > ``` console
38- >docker run --rm -v $(pwd):/opt -w /opt node:20-alpine3.17 sh -c "npm install @qiita/qiita-cli --save-dev && npx qiita init"
39- >```
37+ > ``` console
38+ > docker run --rm -v $( pwd) :/opt -w /opt node:20-alpine3.17 sh -c " npm install @qiita/qiita-cli --save-dev && npx qiita init"
39+ > ` ` `
4040
4141以下のコマンドでバージョンが表示されればインストール完了です。
4242
@@ -68,11 +68,11 @@ npm install @qiita/qiita-cli@latest
6868
6969が生成されます。
7070
71- > ` Docker ` で環境を構築する場合はコンテナを起動してから実行してください。
71+ > ` Docker ` で環境を構築する場合はコンテナを起動してから実行してください。
7272>
73- > ``` console
74- >docker-compose up -d && docker-compose exec qiita sh
75- >```
73+ > ``` console
74+ > docker-compose up -d && docker-compose exec qiita sh
75+ > ` ` `
7676
7777```console
7878npx qiita init
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ jest.mock("node:fs/promises", () => {
5555 writeFile : jest . fn ( ( filePath : string , text : string ) => {
5656 setFile ( filePath , text ) ;
5757 } ) ,
58- mkdir : jest . fn ( ( ) => { } ) ,
58+ mkdir : jest . fn ( ( ) => { } ) ,
5959 } ;
6060} ) ;
6161jest . mock ( "node:fs" , ( ) => {
Original file line number Diff line number Diff line change 11import { AddressInfo } from "net" ;
22import { getUrlAddress } from "./getUrlAddress" ;
33
4-
54describe ( "getUrlAddress" , ( ) => {
65 describe ( "when null is passed" , ( ) => {
76 it ( "returns null" , ( ) => {
@@ -23,7 +22,7 @@ describe("getUrlAddress", () => {
2322 address : "0.0.0.0" ,
2423 family : "IPv4" ,
2524 port : 8888 ,
26- }
25+ } ;
2726 const url = getUrlAddress ( address ) ;
2827 expect ( url ) . toEqual ( `http://${ address . address } :${ address . port } ` ) ;
2928 } ) ;
@@ -35,9 +34,9 @@ describe("getUrlAddress", () => {
3534 address : "::" ,
3635 family : "IPv6" ,
3736 port : 8888 ,
38- }
37+ } ;
3938 const url = getUrlAddress ( address ) ;
4039 expect ( url ) . toEqual ( `http://[${ address . address } ]:${ address . port } ` ) ;
4140 } ) ;
4241 } ) ;
43- } ) ;
42+ } ) ;
Original file line number Diff line number Diff line change 11import { AddressInfo } from "net" ;
22
3-
43export const getUrlAddress = ( address : string | AddressInfo | null ) => {
54 if ( ! address || typeof address === "string" ) return null ;
65
7- if ( [ "IPv4" , "IPv6" ] . indexOf ( address . family ) === - 1 ) throw new Error ( "Unknown address family" ) ;
6+ if ( [ "IPv4" , "IPv6" ] . indexOf ( address . family ) === - 1 )
7+ throw new Error ( "Unknown address family" ) ;
88
9- return `http://${ address . family === "IPv4" ? address . address : `[${ address . address } ]` } :${ address . port } ` ;
10- }
9+ return `http://${
10+ address . family === "IPv4" ? address . address : `[${ address . address } ]`
11+ } :${ address . port } `;
12+ } ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export async function startServer() {
4343 const address = server . address ( ) ;
4444 const url = getUrlAddress ( address ) ;
4545 if ( url ) {
46- console . log ( `Preview: ${ url } ` )
46+ console . log ( `Preview: ${ url } ` ) ;
4747 }
4848
4949 resolve ( server ) ;
You can’t perform that action at this time.
0 commit comments