From b8bc395e9f491a650623602ae5c4c4c5ef38f0af Mon Sep 17 00:00:00 2001 From: rie-oki-agn Date: Mon, 27 Jun 2022 19:40:36 +0900 Subject: [PATCH 01/24] woking on the tutorial --- pages/tutorial.vue | 180 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 pages/tutorial.vue diff --git a/pages/tutorial.vue b/pages/tutorial.vue new file mode 100644 index 0000000..759ffbd --- /dev/null +++ b/pages/tutorial.vue @@ -0,0 +1,180 @@ + + + \ No newline at end of file From 584863511845f3d70b4c54f8f25c0b8a4c9434b2 Mon Sep 17 00:00:00 2001 From: rie-oki-agn Date: Mon, 27 Jun 2022 20:03:07 +0900 Subject: [PATCH 02/24] failed installing preline --- pages/tutorial.vue | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pages/tutorial.vue b/pages/tutorial.vue index 759ffbd..3430777 100644 --- a/pages/tutorial.vue +++ b/pages/tutorial.vue @@ -46,7 +46,6 @@ const doSwitch = () => { } - const clone = ref(false) const doClone = () => { @@ -85,20 +84,6 @@ onMounted(() => { class="inline-flex items-center gap-1.5 py-1.5 px-3 rounded-full text-xs font-medium bg-yellow-500 text-white" > -
- -
- From 9f8a9ea405960dc5050cf157d96063b6260adf4b Mon Sep 17 00:00:00 2001 From: rie-oki-agn Date: Tue, 28 Jun 2022 00:20:24 +0900 Subject: [PATCH 03/24] done: add, commit, switch, switch -c --- pages/tutorial.vue | 85 +++++++++++++++++++++++++++++++++------------- tailwind.config.js | 4 ++- 2 files changed, 65 insertions(+), 24 deletions(-) diff --git a/pages/tutorial.vue b/pages/tutorial.vue index 3430777..bbc56bd 100644 --- a/pages/tutorial.vue +++ b/pages/tutorial.vue @@ -1,24 +1,24 @@ @@ -69,20 +83,39 @@ onMounted(() => {
-
{{branch.name}}
+
{{branch.name}}
+ +
-
+
+ +
+ +
+
@@ -139,19 +172,25 @@ onMounted(() => { - -
diff --git a/tailwind.config.js b/tailwind.config.js index 174fcde..b71f714 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -5,7 +5,9 @@ module.exports = { plugins: [ require('@tailwindcss/typography'), ], - content: ['content/**/*.{md,yml,json,json5,csv}'], + content: [ + 'content/**/*.{md,yml,json,json5,csv}', + ], theme: { extend: { colors: { From 8d283ba4e025b75f3c8f854dd4953dcf84d6c37b Mon Sep 17 00:00:00 2001 From: rie-oki-agn Date: Tue, 28 Jun 2022 13:47:40 +0900 Subject: [PATCH 04/24] pushing bug --- pages/tutorial.vue | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pages/tutorial.vue b/pages/tutorial.vue index bbc56bd..f5accb0 100644 --- a/pages/tutorial.vue +++ b/pages/tutorial.vue @@ -39,7 +39,9 @@ const doCommit = () => { } const doPush = () => { - + const branchSnap = toRaw(repositories.value.local[currentBranch.value]) + branchSnap.name = 'origin/' + branchSnap.name + repositories.value.origin.push(branchSnap) } const doSwitchBranch = () => { @@ -83,13 +85,13 @@ onMounted(() => {
@@ -104,7 +106,7 @@ onMounted(() => {
@@ -113,7 +115,7 @@ onMounted(() => { v-for="(commit, index) in branch.commits" :key="index" :id="commit" - class="mr-4 w-8 h-8 bg-yellow-500 rounded-full" + class="mr-2 w-4 h-4 bg-yellow-500 rounded-full" >
@@ -172,6 +174,7 @@ onMounted(() => {
+
Date: Tue, 28 Jun 2022 16:00:48 +0900 Subject: [PATCH 08/24] chore: tailwind.config --- pages/tutorial.vue | 2 +- tailwind.config.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pages/tutorial.vue b/pages/tutorial.vue index e8e58bc..fd95ba5 100644 --- a/pages/tutorial.vue +++ b/pages/tutorial.vue @@ -48,7 +48,7 @@ const doPush = () => { const snapCurrentBranch = toRaw(currentBranch.value) const copiedBranch = toRaw(snapLocalBranch[snapCurrentBranch]) copiedBranch.name = 'origin/' + copiedBranch.name - origin.value.push({ name: 'test', commits: copiedBranch.commits, spacer: copiedBranch.spacer }) + origin.value.push({ name: 'test', co1mmits: copiedBranch.commits, spacer: copiedBranch.spacer }) } const doSwitchBranch = () => { diff --git a/tailwind.config.js b/tailwind.config.js index b71f714..fe7e4de 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -5,9 +5,7 @@ module.exports = { plugins: [ require('@tailwindcss/typography'), ], - content: [ - 'content/**/*.{md,yml,json,json5,csv}', - ], + content: ['content/**/*.{md,yml,json,json5,csv}'], theme: { extend: { colors: { @@ -16,4 +14,4 @@ module.exports = { }, }, }, -} +} \ No newline at end of file From 5c0c3b0fc1f62c49b4d0be8f5b2f6fb5d312efe2 Mon Sep 17 00:00:00 2001 From: rie-oki-agn Date: Tue, 28 Jun 2022 19:06:54 +0900 Subject: [PATCH 09/24] fix: origin branch -> array to object --- pages/tutorial.vue | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/pages/tutorial.vue b/pages/tutorial.vue index fd95ba5..7b95d50 100644 --- a/pages/tutorial.vue +++ b/pages/tutorial.vue @@ -1,11 +1,11 @@ @@ -182,7 +189,7 @@ onMounted(() => { + +
From 626e7fc3b22574f2ed6c8cb30d9e84281a9fa8e4 Mon Sep 17 00:00:00 2001 From: rie-oki-agn Date: Wed, 29 Jun 2022 01:40:36 +0900 Subject: [PATCH 15/24] modify: add 'can' to every state --- pages/tutorial.vue | 47 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/pages/tutorial.vue b/pages/tutorial.vue index 1c22b07..eacbfad 100644 --- a/pages/tutorial.vue +++ b/pages/tutorial.vue @@ -26,48 +26,47 @@ const createKey = () => { const currentBranch = ref(0) const currentCommit = ref(null) -const edit = ref(false) +const edited = ref(false) const doEdit = () => { - edit.value = true + edited.value = true } -const add = ref(false) +const canAdd = ref(true) const doAdd = () => { - add.value = true + canAdd.value = false } -const commitAble = computed(() => edit.value && add.value ? true : false ) +const canCommit = computed(() => edited.value && !canAdd.value ? true : false ) const doCommit = () => { const randomKey = createKey() local.value[currentBranch.value].commits.push(randomKey) - edit.value = false + edited.value = false } -const push = ref(true) +const snapBranch = computed(() => local.value[currentBranch.value]) +const targetBranchName = computed(() => snapBranch.value.name) +const targetBranch = computed(() => origin.value[targetBranchName.value]) + +const canPush = computed(() => targetBranchName.value ? true : false ) const doPush = () => { - const snapBranch = local.value[currentBranch.value] - const targetBranchName = snapBranch.name - const targetBranch = origin.value[targetBranchName] const newCommitsArr = [] - snapBranch.commits.forEach(commit => newCommitsArr.push(commit)) + snapBranch.value.commits.forEach(commit => newCommitsArr.push(commit)) - targetBranch.commits = newCommitsArr + targetBranch.value.commits = newCommitsArr } const doPushUpStream = () => { - const snapBranch = local.value[currentBranch.value] - const newCommitsArr = [] - snapBranch.commits.forEach(commit => newCommitsArr.push(commit)) + snapBranch.value.commits.forEach(commit => newCommitsArr.push(commit)) - const newName = 'origin/' + snapBranch.name + const newName = 'origin/' + snapBranch.value.name - origin.value[snapBranch.name] = { + origin.value[snapBranch.value.name] = { name: newName, commits: newCommitsArr, - spacer: snapBranch.spacer + spacer: snapBranch.value.spacer } } @@ -87,7 +86,7 @@ const doCreateBranch = () => { spacer: commitsLength + (spacer ? spacer : 0) } currentBranch.value = count - add.value = false + canAdd.value = true } const clone = ref(false) @@ -106,6 +105,8 @@ onMounted(() => {