terminal-quest 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/bin/terminal-quest.js +2 -0
- package/dist/App.d.ts +2 -0
- package/dist/App.js +33 -0
- package/dist/components/HintBar.d.ts +9 -0
- package/dist/components/HintBar.js +11 -0
- package/dist/components/MenuItem.d.ts +9 -0
- package/dist/components/MenuItem.js +9 -0
- package/dist/components/ObjectivePanel.d.ts +8 -0
- package/dist/components/ObjectivePanel.js +10 -0
- package/dist/components/ProgressBar.d.ts +8 -0
- package/dist/components/ProgressBar.js +10 -0
- package/dist/components/TerminalOutput.d.ts +11 -0
- package/dist/components/TerminalOutput.js +25 -0
- package/dist/components/TerminalPrompt.d.ts +10 -0
- package/dist/components/TerminalPrompt.js +46 -0
- package/dist/data/commands-meta.d.ts +17 -0
- package/dist/data/commands-meta.js +256 -0
- package/dist/data/stories/00-beginner-pc.d.ts +3 -0
- package/dist/data/stories/00-beginner-pc.js +841 -0
- package/dist/data/stories/01-first-server.d.ts +3 -0
- package/dist/data/stories/01-first-server.js +364 -0
- package/dist/data/stories/02-messy-project.d.ts +3 -0
- package/dist/data/stories/02-messy-project.js +433 -0
- package/dist/data/stories/03-log-detective.d.ts +3 -0
- package/dist/data/stories/03-log-detective.js +291 -0
- package/dist/data/stories/04-deploy-day.d.ts +3 -0
- package/dist/data/stories/04-deploy-day.js +337 -0
- package/dist/data/stories/05-git-incident.d.ts +3 -0
- package/dist/data/stories/05-git-incident.js +534 -0
- package/dist/data/stories/06-pipe-master.d.ts +3 -0
- package/dist/data/stories/06-pipe-master.js +377 -0
- package/dist/data/stories/07-dangerous-commands.d.ts +3 -0
- package/dist/data/stories/07-dangerous-commands.js +411 -0
- package/dist/data/stories/index.d.ts +4 -0
- package/dist/data/stories/index.js +14 -0
- package/dist/data/stories/k1-treasure-hunt.d.ts +3 -0
- package/dist/data/stories/k1-treasure-hunt.js +815 -0
- package/dist/data/types.d.ts +97 -0
- package/dist/data/types.js +2 -0
- package/dist/engine/Achievements.d.ts +5 -0
- package/dist/engine/Achievements.js +93 -0
- package/dist/engine/CommandHandler.d.ts +17 -0
- package/dist/engine/CommandHandler.js +177 -0
- package/dist/engine/HintEngine.d.ts +10 -0
- package/dist/engine/HintEngine.js +26 -0
- package/dist/engine/MissionEngine.d.ts +17 -0
- package/dist/engine/MissionEngine.js +84 -0
- package/dist/engine/TabCompletion.d.ts +14 -0
- package/dist/engine/TabCompletion.js +93 -0
- package/dist/engine/VirtualFS.d.ts +33 -0
- package/dist/engine/VirtualFS.js +276 -0
- package/dist/engine/commands/cat.d.ts +4 -0
- package/dist/engine/commands/cat.js +18 -0
- package/dist/engine/commands/cd.d.ts +4 -0
- package/dist/engine/commands/cd.js +12 -0
- package/dist/engine/commands/chmod.d.ts +4 -0
- package/dist/engine/commands/chmod.js +98 -0
- package/dist/engine/commands/clear.d.ts +4 -0
- package/dist/engine/commands/clear.js +4 -0
- package/dist/engine/commands/cp.d.ts +4 -0
- package/dist/engine/commands/cp.js +26 -0
- package/dist/engine/commands/cut.d.ts +4 -0
- package/dist/engine/commands/cut.js +76 -0
- package/dist/engine/commands/echo.d.ts +4 -0
- package/dist/engine/commands/echo.js +4 -0
- package/dist/engine/commands/find.d.ts +4 -0
- package/dist/engine/commands/find.js +60 -0
- package/dist/engine/commands/git.d.ts +4 -0
- package/dist/engine/commands/git.js +510 -0
- package/dist/engine/commands/grep.d.ts +4 -0
- package/dist/engine/commands/grep.js +127 -0
- package/dist/engine/commands/head.d.ts +4 -0
- package/dist/engine/commands/head.js +59 -0
- package/dist/engine/commands/help.d.ts +4 -0
- package/dist/engine/commands/help.js +32 -0
- package/dist/engine/commands/hint.d.ts +4 -0
- package/dist/engine/commands/hint.js +4 -0
- package/dist/engine/commands/index.d.ts +8 -0
- package/dist/engine/commands/index.js +51 -0
- package/dist/engine/commands/ls.d.ts +4 -0
- package/dist/engine/commands/ls.js +50 -0
- package/dist/engine/commands/man.d.ts +4 -0
- package/dist/engine/commands/man.js +51 -0
- package/dist/engine/commands/mkdir.d.ts +4 -0
- package/dist/engine/commands/mkdir.js +31 -0
- package/dist/engine/commands/mv.d.ts +4 -0
- package/dist/engine/commands/mv.js +15 -0
- package/dist/engine/commands/pwd.d.ts +4 -0
- package/dist/engine/commands/pwd.js +4 -0
- package/dist/engine/commands/rm.d.ts +4 -0
- package/dist/engine/commands/rm.js +49 -0
- package/dist/engine/commands/sort.d.ts +4 -0
- package/dist/engine/commands/sort.js +100 -0
- package/dist/engine/commands/tail.d.ts +4 -0
- package/dist/engine/commands/tail.js +59 -0
- package/dist/engine/commands/touch.d.ts +4 -0
- package/dist/engine/commands/touch.js +18 -0
- package/dist/engine/commands/uniq.d.ts +4 -0
- package/dist/engine/commands/uniq.js +61 -0
- package/dist/engine/commands/wc.d.ts +4 -0
- package/dist/engine/commands/wc.js +67 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/screens/MissionBriefScreen.d.ts +9 -0
- package/dist/screens/MissionBriefScreen.js +27 -0
- package/dist/screens/MissionCompleteScreen.d.ts +9 -0
- package/dist/screens/MissionCompleteScreen.js +30 -0
- package/dist/screens/ProgressScreen.d.ts +8 -0
- package/dist/screens/ProgressScreen.js +24 -0
- package/dist/screens/SettingsScreen.d.ts +8 -0
- package/dist/screens/SettingsScreen.js +45 -0
- package/dist/screens/StorySelectScreen.d.ts +8 -0
- package/dist/screens/StorySelectScreen.js +81 -0
- package/dist/screens/TerminalScreen.d.ts +12 -0
- package/dist/screens/TerminalScreen.js +150 -0
- package/dist/screens/TitleScreen.d.ts +7 -0
- package/dist/screens/TitleScreen.js +27 -0
- package/dist/state/GameState.d.ts +8 -0
- package/dist/state/GameState.js +12 -0
- package/dist/state/ProgressStore.d.ts +9 -0
- package/dist/state/ProgressStore.js +45 -0
- package/dist/state/useGameState.d.ts +11 -0
- package/dist/state/useGameState.js +92 -0
- package/dist/utils/ascii-art.d.ts +4 -0
- package/dist/utils/ascii-art.js +22 -0
- package/dist/utils/colors.d.ts +17 -0
- package/dist/utils/colors.js +17 -0
- package/dist/utils/text.d.ts +4 -0
- package/dist/utils/text.js +28 -0
- package/package.json +58 -0
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
const gitLogContent = [
|
|
2
|
+
'commit a1b2c3d (HEAD -> main)',
|
|
3
|
+
'Author: senpai <senpai@example.com>',
|
|
4
|
+
'Date: Mon Jan 15 10:00:00 2024',
|
|
5
|
+
'',
|
|
6
|
+
' add api endpoint',
|
|
7
|
+
'',
|
|
8
|
+
'commit e4f5g6h',
|
|
9
|
+
'Author: senpai <senpai@example.com>',
|
|
10
|
+
'Date: Mon Jan 15 09:00:00 2024',
|
|
11
|
+
'',
|
|
12
|
+
' add login feature',
|
|
13
|
+
'',
|
|
14
|
+
'commit i7j8k9l',
|
|
15
|
+
'Author: senpai <senpai@example.com>',
|
|
16
|
+
'Date: Mon Jan 15 08:00:00 2024',
|
|
17
|
+
'',
|
|
18
|
+
' initial commit',
|
|
19
|
+
].join('\n');
|
|
20
|
+
const gitStatusOutput = [
|
|
21
|
+
'On branch main',
|
|
22
|
+
'Changes not staged for commit:',
|
|
23
|
+
' (use "git add <file>..." to update what will be committed)',
|
|
24
|
+
' (use "git restore <file>..." to discard changes in working directory)',
|
|
25
|
+
'',
|
|
26
|
+
' modified: src/app.js',
|
|
27
|
+
' modified: config.json',
|
|
28
|
+
'',
|
|
29
|
+
'no changes added to commit (use "git add" to track)',
|
|
30
|
+
].join('\n');
|
|
31
|
+
const gitDiffOutput = [
|
|
32
|
+
'diff --git a/src/app.js b/src/app.js',
|
|
33
|
+
'index 1234567..abcdefg 100644',
|
|
34
|
+
'--- a/src/app.js',
|
|
35
|
+
'+++ b/src/app.js',
|
|
36
|
+
'@@ -1,5 +1,7 @@',
|
|
37
|
+
' const express = require("express");',
|
|
38
|
+
' const app = express();',
|
|
39
|
+
'+const cors = require("cors");',
|
|
40
|
+
'+app.use(cors());',
|
|
41
|
+
' ',
|
|
42
|
+
' app.get("/api/users", (req, res) => {',
|
|
43
|
+
'- res.json([]);',
|
|
44
|
+
'+ res.json([{ id: 1, name: "admin" }]);',
|
|
45
|
+
' });',
|
|
46
|
+
'diff --git a/config.json b/config.json',
|
|
47
|
+
'index 2345678..bcdefgh 100644',
|
|
48
|
+
'--- a/config.json',
|
|
49
|
+
'+++ b/config.json',
|
|
50
|
+
'@@ -1,3 +1,4 @@',
|
|
51
|
+
' {',
|
|
52
|
+
' "port": 3000,',
|
|
53
|
+
'- "debug": false',
|
|
54
|
+
'+ "debug": true,',
|
|
55
|
+
'+ "cors": true',
|
|
56
|
+
' }',
|
|
57
|
+
].join('\n');
|
|
58
|
+
const mission1FS = {
|
|
59
|
+
type: 'directory',
|
|
60
|
+
children: {
|
|
61
|
+
home: {
|
|
62
|
+
type: 'directory',
|
|
63
|
+
children: {
|
|
64
|
+
dev: {
|
|
65
|
+
type: 'directory',
|
|
66
|
+
children: {
|
|
67
|
+
repo: {
|
|
68
|
+
type: 'directory',
|
|
69
|
+
children: {
|
|
70
|
+
'.git': {
|
|
71
|
+
type: 'directory',
|
|
72
|
+
children: {
|
|
73
|
+
HEAD: {
|
|
74
|
+
type: 'file',
|
|
75
|
+
content: 'ref: refs/heads/main',
|
|
76
|
+
},
|
|
77
|
+
branches: {
|
|
78
|
+
type: 'file',
|
|
79
|
+
content: '* main\n feature/login\n feature/api',
|
|
80
|
+
},
|
|
81
|
+
log: {
|
|
82
|
+
type: 'file',
|
|
83
|
+
content: gitLogContent,
|
|
84
|
+
},
|
|
85
|
+
'status-output': {
|
|
86
|
+
type: 'file',
|
|
87
|
+
content: gitStatusOutput,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
src: {
|
|
92
|
+
type: 'directory',
|
|
93
|
+
children: {
|
|
94
|
+
'app.js': {
|
|
95
|
+
type: 'file',
|
|
96
|
+
content: [
|
|
97
|
+
'const express = require("express");',
|
|
98
|
+
'const app = express();',
|
|
99
|
+
'const cors = require("cors");',
|
|
100
|
+
'app.use(cors());',
|
|
101
|
+
'',
|
|
102
|
+
'app.get("/api/users", (req, res) => {',
|
|
103
|
+
' res.json([{ id: 1, name: "admin" }]);',
|
|
104
|
+
'});',
|
|
105
|
+
'',
|
|
106
|
+
'app.listen(3000);',
|
|
107
|
+
].join('\n'),
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
'config.json': {
|
|
112
|
+
type: 'file',
|
|
113
|
+
content: '{\n "port": 3000,\n "debug": true,\n "cors": true\n}\n',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
const mission2FS = {
|
|
124
|
+
type: 'directory',
|
|
125
|
+
children: {
|
|
126
|
+
home: {
|
|
127
|
+
type: 'directory',
|
|
128
|
+
children: {
|
|
129
|
+
dev: {
|
|
130
|
+
type: 'directory',
|
|
131
|
+
children: {
|
|
132
|
+
repo: {
|
|
133
|
+
type: 'directory',
|
|
134
|
+
children: {
|
|
135
|
+
'.git': {
|
|
136
|
+
type: 'directory',
|
|
137
|
+
children: {
|
|
138
|
+
HEAD: {
|
|
139
|
+
type: 'file',
|
|
140
|
+
content: 'ref: refs/heads/main',
|
|
141
|
+
},
|
|
142
|
+
branches: {
|
|
143
|
+
type: 'file',
|
|
144
|
+
content: '* main\n feature/login\n feature/api',
|
|
145
|
+
},
|
|
146
|
+
log: {
|
|
147
|
+
type: 'file',
|
|
148
|
+
content: gitLogContent,
|
|
149
|
+
},
|
|
150
|
+
'status-output': {
|
|
151
|
+
type: 'file',
|
|
152
|
+
content: gitStatusOutput,
|
|
153
|
+
},
|
|
154
|
+
stash: {
|
|
155
|
+
type: 'file',
|
|
156
|
+
content: '',
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
src: {
|
|
161
|
+
type: 'directory',
|
|
162
|
+
children: {
|
|
163
|
+
'app.js': {
|
|
164
|
+
type: 'file',
|
|
165
|
+
content: [
|
|
166
|
+
'const express = require("express");',
|
|
167
|
+
'const app = express();',
|
|
168
|
+
'const cors = require("cors");',
|
|
169
|
+
'app.use(cors());',
|
|
170
|
+
'',
|
|
171
|
+
'app.get("/api/users", (req, res) => {',
|
|
172
|
+
' res.json([{ id: 1, name: "admin" }]);',
|
|
173
|
+
'});',
|
|
174
|
+
'',
|
|
175
|
+
'app.listen(3000);',
|
|
176
|
+
].join('\n'),
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
'config.json': {
|
|
181
|
+
type: 'file',
|
|
182
|
+
content: '{\n "port": 3000,\n "debug": true,\n "cors": true\n}\n',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
const mission3FS = {
|
|
193
|
+
type: 'directory',
|
|
194
|
+
children: {
|
|
195
|
+
home: {
|
|
196
|
+
type: 'directory',
|
|
197
|
+
children: {
|
|
198
|
+
dev: {
|
|
199
|
+
type: 'directory',
|
|
200
|
+
children: {
|
|
201
|
+
repo: {
|
|
202
|
+
type: 'directory',
|
|
203
|
+
children: {
|
|
204
|
+
'.git': {
|
|
205
|
+
type: 'directory',
|
|
206
|
+
children: {
|
|
207
|
+
HEAD: {
|
|
208
|
+
type: 'file',
|
|
209
|
+
content: 'ref: refs/heads/main',
|
|
210
|
+
},
|
|
211
|
+
branches: {
|
|
212
|
+
type: 'file',
|
|
213
|
+
content: '* main\n feature/login\n feature/api',
|
|
214
|
+
},
|
|
215
|
+
log: {
|
|
216
|
+
type: 'file',
|
|
217
|
+
content: gitLogContent,
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
src: {
|
|
222
|
+
type: 'directory',
|
|
223
|
+
children: {
|
|
224
|
+
'app.js': {
|
|
225
|
+
type: 'file',
|
|
226
|
+
content: 'const express = require("express");\nconst app = express();\napp.listen(3000);\n',
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
'config.json': {
|
|
231
|
+
type: 'file',
|
|
232
|
+
content: '{\n "port": 3000,\n "debug": false\n}\n',
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
const mission4FS = {
|
|
243
|
+
type: 'directory',
|
|
244
|
+
children: {
|
|
245
|
+
home: {
|
|
246
|
+
type: 'directory',
|
|
247
|
+
children: {
|
|
248
|
+
dev: {
|
|
249
|
+
type: 'directory',
|
|
250
|
+
children: {
|
|
251
|
+
repo: {
|
|
252
|
+
type: 'directory',
|
|
253
|
+
children: {
|
|
254
|
+
'.git': {
|
|
255
|
+
type: 'directory',
|
|
256
|
+
children: {
|
|
257
|
+
HEAD: {
|
|
258
|
+
type: 'file',
|
|
259
|
+
content: 'ref: refs/heads/hotfix',
|
|
260
|
+
},
|
|
261
|
+
branches: {
|
|
262
|
+
type: 'file',
|
|
263
|
+
content: ' main\n feature/login\n feature/api\n* hotfix',
|
|
264
|
+
},
|
|
265
|
+
log: {
|
|
266
|
+
type: 'file',
|
|
267
|
+
content: gitLogContent,
|
|
268
|
+
},
|
|
269
|
+
'diff-output': {
|
|
270
|
+
type: 'file',
|
|
271
|
+
content: gitDiffOutput,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
src: {
|
|
276
|
+
type: 'directory',
|
|
277
|
+
children: {
|
|
278
|
+
'app.js': {
|
|
279
|
+
type: 'file',
|
|
280
|
+
content: [
|
|
281
|
+
'const express = require("express");',
|
|
282
|
+
'const app = express();',
|
|
283
|
+
'const cors = require("cors");',
|
|
284
|
+
'app.use(cors());',
|
|
285
|
+
'',
|
|
286
|
+
'app.get("/api/users", (req, res) => {',
|
|
287
|
+
' res.json([{ id: 1, name: "admin" }]);',
|
|
288
|
+
'});',
|
|
289
|
+
'',
|
|
290
|
+
'app.listen(3000);',
|
|
291
|
+
].join('\n'),
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
'config.json': {
|
|
296
|
+
type: 'file',
|
|
297
|
+
content: '{\n "port": 3000,\n "debug": true,\n "cors": true\n}\n',
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
const mission5FS = {
|
|
308
|
+
type: 'directory',
|
|
309
|
+
children: {
|
|
310
|
+
home: {
|
|
311
|
+
type: 'directory',
|
|
312
|
+
children: {
|
|
313
|
+
dev: {
|
|
314
|
+
type: 'directory',
|
|
315
|
+
children: {
|
|
316
|
+
repo: {
|
|
317
|
+
type: 'directory',
|
|
318
|
+
children: {
|
|
319
|
+
'.git': {
|
|
320
|
+
type: 'directory',
|
|
321
|
+
children: {
|
|
322
|
+
HEAD: {
|
|
323
|
+
type: 'file',
|
|
324
|
+
content: 'ref: refs/heads/hotfix',
|
|
325
|
+
},
|
|
326
|
+
branches: {
|
|
327
|
+
type: 'file',
|
|
328
|
+
content: ' main\n feature/login\n feature/api\n* hotfix',
|
|
329
|
+
},
|
|
330
|
+
log: {
|
|
331
|
+
type: 'file',
|
|
332
|
+
content: gitLogContent,
|
|
333
|
+
},
|
|
334
|
+
'merge-result': {
|
|
335
|
+
type: 'file',
|
|
336
|
+
content: 'Merge made by the \'ort\' strategy.\n src/app.js | 4 +++-\n config.json | 3 ++-\n 2 files changed, 5 insertions(+), 2 deletions(-)',
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
src: {
|
|
341
|
+
type: 'directory',
|
|
342
|
+
children: {
|
|
343
|
+
'app.js': {
|
|
344
|
+
type: 'file',
|
|
345
|
+
content: [
|
|
346
|
+
'const express = require("express");',
|
|
347
|
+
'const app = express();',
|
|
348
|
+
'const cors = require("cors");',
|
|
349
|
+
'app.use(cors());',
|
|
350
|
+
'',
|
|
351
|
+
'app.get("/api/users", (req, res) => {',
|
|
352
|
+
' res.json([{ id: 1, name: "admin" }]);',
|
|
353
|
+
'});',
|
|
354
|
+
'',
|
|
355
|
+
'app.listen(3000);',
|
|
356
|
+
].join('\n'),
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
'config.json': {
|
|
361
|
+
type: 'file',
|
|
362
|
+
content: '{\n "port": 3000,\n "debug": true,\n "cors": true\n}\n',
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
};
|
|
372
|
+
export const story05 = {
|
|
373
|
+
id: 'story-05',
|
|
374
|
+
title: 'Git大事件',
|
|
375
|
+
description: 'チームのGitリポジトリでトラブル発生!ブランチの混乱を整理し、マージの問題を解決しよう。',
|
|
376
|
+
emoji: '\u{1F33F}',
|
|
377
|
+
missions: [
|
|
378
|
+
{
|
|
379
|
+
id: 'mission-05-01',
|
|
380
|
+
title: '状況確認',
|
|
381
|
+
description: 'git status と git log で現在のリポジトリの状態を把握しよう。',
|
|
382
|
+
narrative: '先輩が「リポジトリがおかしい」と焦っている。まずは状況を確認しよう。',
|
|
383
|
+
initialCwd: '/home/dev/repo',
|
|
384
|
+
newCommands: ['git'],
|
|
385
|
+
initialFS: mission1FS,
|
|
386
|
+
objectives: [
|
|
387
|
+
{
|
|
388
|
+
id: 'obj-05-01-01',
|
|
389
|
+
description: '現在の状態を確認する(変更されたファイルを発見する)',
|
|
390
|
+
checks: [
|
|
391
|
+
{ type: 'command_executed', command: 'git' },
|
|
392
|
+
{ type: 'output_contains', pattern: 'modified' },
|
|
393
|
+
],
|
|
394
|
+
hints: [
|
|
395
|
+
{ level: 1, text: 'リポジトリの状態を確認するGitコマンドがあります。' },
|
|
396
|
+
{ level: 2, text: 'git status コマンドで変更されたファイルを確認できます。' },
|
|
397
|
+
{ level: 3, text: '「git status」と入力してEnterを押してください。' },
|
|
398
|
+
],
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
id: 'obj-05-01-02',
|
|
402
|
+
description: 'コミット履歴を確認する',
|
|
403
|
+
checks: [
|
|
404
|
+
{ type: 'command_executed', command: 'git' },
|
|
405
|
+
{ type: 'output_contains', pattern: 'commit' },
|
|
406
|
+
],
|
|
407
|
+
hints: [
|
|
408
|
+
{ level: 1, text: 'コミットの履歴を表示するGitコマンドがあります。' },
|
|
409
|
+
{ level: 2, text: 'git log コマンドで過去のコミットを確認できます。' },
|
|
410
|
+
{ level: 3, text: '「git log」と入力してEnterを押してください。' },
|
|
411
|
+
],
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
id: 'mission-05-02',
|
|
417
|
+
title: '変更の退避',
|
|
418
|
+
description: 'git stash で作業中の変更を一旦退避しよう。',
|
|
419
|
+
narrative: '作業中の変更を一旦退避して、安全な状態に戻そう。',
|
|
420
|
+
initialCwd: '/home/dev/repo',
|
|
421
|
+
initialFS: mission2FS,
|
|
422
|
+
objectives: [
|
|
423
|
+
{
|
|
424
|
+
id: 'obj-05-02-01',
|
|
425
|
+
description: '変更を stash に退避する',
|
|
426
|
+
checks: [
|
|
427
|
+
{ type: 'command_executed', command: 'git' },
|
|
428
|
+
{ type: 'output_contains', pattern: 'stash' },
|
|
429
|
+
],
|
|
430
|
+
hints: [
|
|
431
|
+
{ level: 1, text: '変更を一時的に退避するGitコマンドがあります。' },
|
|
432
|
+
{ level: 2, text: 'git stash コマンドで変更を退避できます。後で git stash pop で戻せます。' },
|
|
433
|
+
{ level: 3, text: '「git stash」と入力してEnterを押してください。' },
|
|
434
|
+
],
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
id: 'mission-05-03',
|
|
440
|
+
title: 'ブランチ操作',
|
|
441
|
+
description: 'git branch と git checkout でブランチを操作しよう。',
|
|
442
|
+
narrative: '修正用のブランチを作って切り替えよう。',
|
|
443
|
+
initialCwd: '/home/dev/repo',
|
|
444
|
+
initialFS: mission3FS,
|
|
445
|
+
objectives: [
|
|
446
|
+
{
|
|
447
|
+
id: 'obj-05-03-01',
|
|
448
|
+
description: 'ブランチの一覧を確認する',
|
|
449
|
+
checks: [
|
|
450
|
+
{ type: 'command_executed', command: 'git' },
|
|
451
|
+
{ type: 'output_contains', pattern: 'main' },
|
|
452
|
+
],
|
|
453
|
+
hints: [
|
|
454
|
+
{ level: 1, text: 'ブランチの一覧を表示するGitコマンドがあります。' },
|
|
455
|
+
{ level: 2, text: 'git branch コマンドでブランチ一覧を表示できます。' },
|
|
456
|
+
{ level: 3, text: '「git branch」と入力してEnterを押してください。' },
|
|
457
|
+
],
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
id: 'obj-05-03-02',
|
|
461
|
+
description: 'hotfix ブランチを作成して切り替える',
|
|
462
|
+
checks: [
|
|
463
|
+
{ type: 'command_executed', command: 'git' },
|
|
464
|
+
{ type: 'output_contains', pattern: 'hotfix' },
|
|
465
|
+
],
|
|
466
|
+
hints: [
|
|
467
|
+
{ level: 1, text: '新しいブランチを作成して同時に切り替えるオプションがあります。' },
|
|
468
|
+
{ level: 2, text: 'git checkout に -b オプションをつけると、新しいブランチを作って切り替えられます。' },
|
|
469
|
+
{ level: 3, text: '「git checkout -b hotfix」と入力してEnterを押してください。' },
|
|
470
|
+
],
|
|
471
|
+
},
|
|
472
|
+
],
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
id: 'mission-05-04',
|
|
476
|
+
title: '変更の確認',
|
|
477
|
+
description: 'git diff で変更内容を確認して問題箇所を特定しよう。',
|
|
478
|
+
narrative: '変更内容を確認して、問題の箇所を特定しよう。',
|
|
479
|
+
initialCwd: '/home/dev/repo',
|
|
480
|
+
initialFS: mission4FS,
|
|
481
|
+
objectives: [
|
|
482
|
+
{
|
|
483
|
+
id: 'obj-05-04-01',
|
|
484
|
+
description: 'diff で変更内容を確認する',
|
|
485
|
+
checks: [
|
|
486
|
+
{ type: 'command_executed', command: 'git' },
|
|
487
|
+
{ type: 'output_contains', pattern: '@@' },
|
|
488
|
+
],
|
|
489
|
+
hints: [
|
|
490
|
+
{ level: 1, text: 'ファイルの変更差分を表示するGitコマンドがあります。' },
|
|
491
|
+
{ level: 2, text: 'git diff コマンドで変更箇所を確認できます。' },
|
|
492
|
+
{ level: 3, text: '「git diff」と入力してEnterを押してください。' },
|
|
493
|
+
],
|
|
494
|
+
},
|
|
495
|
+
],
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: 'mission-05-05',
|
|
499
|
+
title: 'マージ',
|
|
500
|
+
description: '修正をメインブランチに統合しよう。',
|
|
501
|
+
narrative: '修正が完了した。メインブランチに統合しよう。',
|
|
502
|
+
initialCwd: '/home/dev/repo',
|
|
503
|
+
initialFS: mission5FS,
|
|
504
|
+
objectives: [
|
|
505
|
+
{
|
|
506
|
+
id: 'obj-05-05-01',
|
|
507
|
+
description: 'main ブランチに切り替える',
|
|
508
|
+
checks: [{ type: 'command_executed', command: 'git' }],
|
|
509
|
+
hints: [
|
|
510
|
+
{ level: 1, text: 'ブランチを切り替えるGitコマンドがあります。' },
|
|
511
|
+
{ level: 2, text: 'git checkout コマンドでブランチを切り替えられます。' },
|
|
512
|
+
{ level: 3, text: '「git checkout main」と入力してEnterを押してください。' },
|
|
513
|
+
],
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
id: 'obj-05-05-02',
|
|
517
|
+
description: 'hotfix ブランチをマージする',
|
|
518
|
+
checks: [
|
|
519
|
+
{ type: 'command_executed', command: 'git' },
|
|
520
|
+
{ type: 'output_contains', pattern: 'Merge' },
|
|
521
|
+
],
|
|
522
|
+
hints: [
|
|
523
|
+
{ level: 1, text: '別のブランチの変更を取り込むGitコマンドがあります。' },
|
|
524
|
+
{ level: 2, text: 'git merge コマンドで指定したブランチの変更を現在のブランチに統合できます。' },
|
|
525
|
+
{ level: 3, text: '「git merge hotfix」と入力してEnterを押してください。' },
|
|
526
|
+
],
|
|
527
|
+
},
|
|
528
|
+
],
|
|
529
|
+
},
|
|
530
|
+
],
|
|
531
|
+
unlockRequires: ['story-02'],
|
|
532
|
+
course: 'engineer',
|
|
533
|
+
};
|
|
534
|
+
//# sourceMappingURL=05-git-incident.js.map
|