Skip to content

Commit dd8975a

Browse files
fix: cleanup shipjs config ✨
Signed-off-by: Vinayak Kulkarni <[email protected]>
1 parent 4445a03 commit dd8975a

File tree

2 files changed

+4
-46
lines changed

2 files changed

+4
-46
lines changed

components/common/ui/VFooter.vue

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@
1818
<div>app:</div>
1919
v{{ state.appVersion }}
2020
</div>
21-
<div
22-
v-if="state.buildVersion"
23-
class="w-full flex justify-between text-xs"
24-
>
25-
<div>build:</div>
26-
{{ state.buildVersion }}
27-
</div>
2821
</div>
2922
<!-- GitHub -->
3023
<a
@@ -120,10 +113,9 @@
120113
</template>
121114

122115
<script setup lang="ts">
123-
const { $config } = useNuxtApp();
116+
const config = useRuntimeConfig();
124117
const state = reactive({
125118
date: new Date().getFullYear(),
126-
appVersion: $config.public.appVersion.split('+')[0],
127-
buildVersion: $config.public.appVersion.split('+')[1],
119+
appVersion: config.public.appVersion,
128120
});
129121
</script>

ship.config.cjs

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,6 @@
1-
/* eslint-disable security/detect-non-literal-fs-filename */
2-
const { resolve } = require('path');
3-
const { readFileSync, writeFileSync } = require('fs');
4-
const simpleGit = require('simple-git');
5-
6-
const options = {
7-
baseDir: process.cwd(),
8-
binary: 'git',
9-
maxConcurrentProcesses: 6,
10-
trimmed: false,
11-
};
12-
13-
// when setting all options in a single object
14-
const git = simpleGit(options);
15-
16-
// Get the latest commit hash of the current branch
17-
const getCurrentCommitHash = async () => {
18-
try {
19-
const logSummary = await git.log();
20-
// get first 7 characters of the hash
21-
const commitHash = logSummary.latest.hash.slice(0, 7);
22-
console.log(`Current commit hash: ${commitHash}`);
23-
return commitHash;
24-
} catch (error) {
25-
console.error('Error occurred:', error);
26-
}
27-
};
28-
291
module.exports = {
302
installCommand: () => 'npm i --prefer-offline --no-audit',
313
buildCommand: () => null,
32-
versionUpdated: async ({ version, dir }) => {
33-
const commitHash = await getCurrentCommitHash();
34-
const packageJsonPath = resolve(dir, 'package.json');
35-
const packageJson = JSON.parse(readFileSync(packageJsonPath).toString());
36-
packageJson.version = `${version}+${commitHash}`;
37-
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
38-
},
39-
publishCommand: ({ tag }) => `echo "Releasing ${tag} version of the app"`,
4+
publishCommand: ({ tag }) =>
5+
`echo "Releasing ${tag} version of frontend webapp"`,
406
};

0 commit comments

Comments
 (0)