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
22
22
23
23
Qiita CLI を使うには ` Node.js 18.0.0 ` 以上が必要です。Node.js をはじめて使う場合はインストールする必要があります。
24
24
25
- > ` Docker ` で利用するには` Docker ` がインストールされている必要があります。
25
+ > ` Docker ` で利用するには` Docker ` がインストールされている必要があります。
26
26
27
27
### 2. Qiita CLI をインストールする
28
28
@@ -32,11 +32,11 @@ Qiita のコンテンツを管理したいディレクトリで、以下のコ
32
32
npm install @qiita/qiita-cli --save-dev
33
33
```
34
34
35
- > ` Docker ` で環境を構築する場合は次のコマンドで実行できます。
35
+ > ` Docker ` で環境を構築する場合は次のコマンドで実行できます。
36
36
>
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
+ > ` ` `
40
40
41
41
以下のコマンドでバージョンが表示されればインストール完了です。
42
42
@@ -68,11 +68,11 @@ npm install @qiita/qiita-cli@latest
68
68
69
69
が生成されます。
70
70
71
- > ` Docker ` で環境を構築する場合はコンテナを起動してから実行してください。
71
+ > ` Docker ` で環境を構築する場合はコンテナを起動してから実行してください。
72
72
>
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
+ > ` ` `
76
76
77
77
```console
78
78
npx qiita init
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ jest.mock("node:fs/promises", () => {
55
55
writeFile : jest . fn ( ( filePath : string , text : string ) => {
56
56
setFile ( filePath , text ) ;
57
57
} ) ,
58
- mkdir : jest . fn ( ( ) => { } ) ,
58
+ mkdir : jest . fn ( ( ) => { } ) ,
59
59
} ;
60
60
} ) ;
61
61
jest . mock ( "node:fs" , ( ) => {
Original file line number Diff line number Diff line change 1
1
import { AddressInfo } from "net" ;
2
2
import { getUrlAddress } from "./getUrlAddress" ;
3
3
4
-
5
4
describe ( "getUrlAddress" , ( ) => {
6
5
describe ( "when null is passed" , ( ) => {
7
6
it ( "returns null" , ( ) => {
@@ -23,7 +22,7 @@ describe("getUrlAddress", () => {
23
22
address : "0.0.0.0" ,
24
23
family : "IPv4" ,
25
24
port : 8888 ,
26
- }
25
+ } ;
27
26
const url = getUrlAddress ( address ) ;
28
27
expect ( url ) . toEqual ( `http://${ address . address } :${ address . port } ` ) ;
29
28
} ) ;
@@ -35,9 +34,9 @@ describe("getUrlAddress", () => {
35
34
address : "::" ,
36
35
family : "IPv6" ,
37
36
port : 8888 ,
38
- }
37
+ } ;
39
38
const url = getUrlAddress ( address ) ;
40
39
expect ( url ) . toEqual ( `http://[${ address . address } ]:${ address . port } ` ) ;
41
40
} ) ;
42
41
} ) ;
43
- } ) ;
42
+ } ) ;
Original file line number Diff line number Diff line change 1
1
import { AddressInfo } from "net" ;
2
2
3
-
4
3
export const getUrlAddress = ( address : string | AddressInfo | null ) => {
5
4
if ( ! address || typeof address === "string" ) return null ;
6
5
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" ) ;
8
8
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() {
43
43
const address = server . address ( ) ;
44
44
const url = getUrlAddress ( address ) ;
45
45
if ( url ) {
46
- console . log ( `Preview: ${ url } ` )
46
+ console . log ( `Preview: ${ url } ` ) ;
47
47
}
48
48
49
49
resolve ( server ) ;
You can’t perform that action at this time.
0 commit comments