Compare commits

...

1 Commits
v1.0.2 ... main

8 changed files with 1043 additions and 8 deletions

2
.gitignore vendored
View File

@ -11,6 +11,8 @@ node_modules
dist
dist-ssr
*.local
release
*.env
# Editor directories and files
.vscode/*

View File

@ -20,6 +20,8 @@ This Project is based on a YouTube Video by Tylor Potts (https://www.youtube.com
## Coming next
* [x] script to compress the release
* [ ] script to upload the release
* [ ] (s)ftp based deployment
* [ ] runner based release pipeline
* [ ] release note generator based on the commits

76
compress.js Normal file
View File

@ -0,0 +1,76 @@
import fs from 'fs'
import path from 'path'
import archiver from 'archiver'
import * as tar from 'tar'
// read the package json
const packageJsonPath = path.resolve('./package.json')
// parse the content
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'))
// read the project name
const projectName = packageJson.name.toUpperCase() || 'project'
// read the project version
const version = packageJson.version || '0.0.1'
// define the source dir
const sourceDir = './dist'
// define the target dir
const outputDir = './release'
// create the base output filename
const baseFileName = `${projectName}-${version}`
// create the output filename for the zip file
const zipOutput = path.join(outputDir, `${baseFileName}.zip`)
// create the output filename for the tar zip file
const tarOutput = path.join(outputDir, `${baseFileName}.tar.gz`)
// function to read the content of the source dir and put them in the zip file
async function createZip() {
return new Promise((resolve, reject) => {
// create an output file to stream the zip content into
const output = fs.createWriteStream(zipOutput)
// configure the zip file
const archive = archiver('zip', {
zlib: { level: 9 },
})
// define an async function to print a success message
output.on('close', () => {
console.log(`[√] ZIP created: ${zipOutput} (${archive.pointer()} bytes)`)
resolve()
})
// define an async function to print an error message
archive.on('error', (err) => reject(err))
// pipe the output stream
archive.pipe(output)
// read the content of the source dir
archive.directory(sourceDir, false)
// close the zip stream and finish the file
archive.finalize()
})
}
// function to read the content of the source dir and put them in the tar.gz file
async function createTarGz() {
return tar.c(
{
gzip: true,
file: tarOutput,
cwd: path.dirname(sourceDir),
},
[path.basename(sourceDir)]
).then(() => {
console.log(`[√] tar.gz created: ${tarOutput}`)
})
}
// Ausführung
async function run() {
try {
await fs.promises.mkdir(outputDir, { recursive: true })
console.log(`[!] Using project: "${projectName}", version: "${version}"`)
await createZip()
await createTarGz()
} catch (err) {
console.error('[X] Error during compression:', err)
}
}
run()

961
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "jane",
"private": true,
"version": "1.0.2",
"version": "1.0.3",
"type": "module",
"description": "Just another note editor written in VUE.js for learning purposes.",
"homepage": "https://projects.nisch.codes/nischcodes/JANE#readme",
@ -18,14 +18,18 @@
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
"preview": "vite preview",
"pack-release": "node compress.js",
"upload-release": "echo test"
},
"dependencies": {
"@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.0.14",
"archiver": "^7.0.1",
"dompurify": "^3.2.4",
"marked": "^15.0.7",
"tailwindcss": "^4.0.14",
"tar": "^7.4.3",
"vue": "^3.5.13"
},
"devDependencies": {

View File

@ -63,7 +63,7 @@ Next reference links:
Images:
[![An old rock in the desert](images/testimage-4k.jpg "Shiprock, New Mexico by Beau Rogers")](https://www.flickr.com/photos/beaurogers/31833779864/in/photolist-Qv3rFw-34mt9F-a9Cmfy-5Ha3Zi-9msKdv-o3hgjr-hWpUte-4WMsJ1-KUQ8N-deshUb-vssBD-6CQci6-8AFCiD-zsJWT-nNfsgB-dPDwZJ-bn9JGn-5HtSXY-6CUhAL-a4UTXB-ugPum-KUPSo-fBLNm-6CUmpy-4WMsc9-8a7D3T-83KJev-6CQ2bK-nNusHJ-a78rQH-nw3NvT-7aq2qf-8wwBso-3nNceh-ugSKP-4mh4kh-bbeeqH-a7biME-q3PtTf-brFpgb-cg38zw-bXMZc-nJPELD-f58Lmo-bXMYG-bz8AAi-bxNtNT-bXMYi-bXMY6-bXMYv)
[![An old rock in the desert](images/testimage.jpg "Shiprock, New Mexico by Beau Rogers")](https://www.flickr.com/photos/beaurogers/31833779864/in/photolist-Qv3rFw-34mt9F-a9Cmfy-5Ha3Zi-9msKdv-o3hgjr-hWpUte-4WMsJ1-KUQ8N-deshUb-vssBD-6CQci6-8AFCiD-zsJWT-nNfsgB-dPDwZJ-bn9JGn-5HtSXY-6CUhAL-a4UTXB-ugPum-KUPSo-fBLNm-6CUmpy-4WMsc9-8a7D3T-83KJev-6CQ2bK-nNusHJ-a78rQH-nw3NvT-7aq2qf-8wwBso-3nNceh-ugSKP-4mh4kh-bbeeqH-a7biME-q3PtTf-brFpgb-cg38zw-bXMZc-nJPELD-f58Lmo-bXMYG-bz8AAi-bxNtNT-bXMYi-bXMY6-bXMYv)
---

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 MiB

BIN
public/images/testimage.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB