kb84tkhrのブログ

何を書こうか考え中です あ、あと組織とは関係ないってやつです 個人的なやつ

TiddlyWiki5のリポをcloneする

ちょっと思い立ったことがありまして TiddlyWiki5 https://tiddlywiki.com の
ソースを見てみようかと

https://github.com/Jermolene/TiddlyWiki5のreadmeを見てnode.js版をインストールすれば
自動的にソースも入りそうなんですが、ここはひとつリポをcloneしてみたいと思います

環境はWindows

まずは
http://nodejs.org/ からインストーラをダウンロードしてnode.jsを、
http://git-scm.com/downloads からGitを入れます
どちらもインストーラの設定等はあまり考えてません

https://github.com/Jermolene/TiddlyWiki5 をクローンします

$ git clone https://github.com/Jermolene/TiddlyWiki5
Cloning into 'TiddlyWiki5'...
remote: Counting objects: 74761, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 74761 (delta 3), reused 3 (delta 3), pack-reused 74749
Receiving objects: 100% (74761/74761), 32.91 MiB | 1.08 MiB/s, done.
Resolving deltas: 100% (44186/44186), done.
Checking out files: 100% (5344/5344), done.

TiddlyWiki/Dev — documentation for developersによると

Installing TiddlyWiki5 with NPM downloads a snapshot release of TiddlyWiki5. To use a development copy of the TiddlyWiki5 repository instead of the copy installed by NPM, use this command within the root of the TiddlyWiki5 repo:

npm link

だそうなのでよく意味がわかりませんがやっておきます

$ cd TiddlyWiki5/
$ npm link
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN tiddlywiki@5.1.18-prerelease license should be a valid SPDX license expression

up to date in 0.097s
C:\Users\******\AppData\Roaming\npm\tiddlywiki -> C:\Users\******\AppData\Roaming\npm\node_modules\tiddlywiki\tiddlywiki.js
C:\Users\******\AppData\Roaming\npm\node_modules\tiddlywiki -> C:\******\TiddlyWiki5

package-lock.jsonってのはnpmの何かかな
まあ後で調べよう

これで動くようになったの?

$ tiddlywiki --version
5.1.18-prerelease


できてる気がする

$ tiddlywiki mynewwiki --init server
Copied edition 'server' to mynewwiki

http://127.0.0.1:8080/
おお、いけた

git周りを試しておく

$ git diff
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in tiddlywiki.js.
The file will have its original line endings in your working directory.

なんか微妙なこと言ってる
どうするかな

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   package.json
        modified:   tiddlywiki.js

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        mynewwiki/
        package-lock.json

no changes added to commit (use "git add" and/or "git commit -a")

mynewwikiはignoreするとして、npm linkで作られたらしき
package-lock.jsonはどうなんだ

まあ1回コミットしちゃえ

$ git add .
warning: LF will be replaced by CRLF in package.json.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in tiddlywiki.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in package-lock.json.
The file will have its original line endings in your working directory.

ますます微妙か
改行コードどうするかは考えよう
消してイチから試してもいいし

とりあえず今日はここまで