From 7277b2a1585db87c15cb2c7eafdc827e475dabb6 Mon Sep 17 00:00:00 2001 From: b1ek Date: Wed, 22 Mar 2023 22:23:59 +1000 Subject: [PATCH] finally get it all to work --- .gitignore | 2 -- .build.config => .parcelrc | 0 build.py | 13 ++++++------- package.json | 40 +++++++++++++++++++++++++++++++++++++- 4 files changed, 45 insertions(+), 10 deletions(-) rename .build.config => .parcelrc (100%) diff --git a/.gitignore b/.gitignore index 9926def..5e24053 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,6 @@ yarn.lock package-lock.json dist -.parcelrc - *.log *.tmp diff --git a/.build.config b/.parcelrc similarity index 100% rename from .build.config rename to .parcelrc diff --git a/build.py b/build.py index 46df6b5..abf8d53 100755 --- a/build.py +++ b/build.py @@ -4,16 +4,15 @@ import json, os package = {} -with open('package.json', 'tr', encoding='utf-8') as f: +with open('package.json', 'r+', encoding='utf-8') as f: package = json.loads(f.read()); - -package['source'] = 'src/resume.js'; - -with open('package.json', 'tw', encoding='utf-8') as f: - f.write(json.dumps(package)); + f.seek(0); + package['source'] = 'src/resume.js'; + f.truncate(0); + f.write(json.dumps(package, indent=2) + '\n'); os.system('parcel build'); with open('package.json', 'w+', encoding='utf-8') as f: package['source'] = 'src/resume.html'; - f.write(json.dumps(package)); \ No newline at end of file + f.write(json.dumps(package, indent=2) + '\n'); \ No newline at end of file diff --git a/package.json b/package.json index 9410e73..7e14a41 100644 --- a/package.json +++ b/package.json @@ -1 +1,39 @@ -{"name": "resume", "version": "1.0.0", "source": "src/resume.html", "author": "blek", "license": "MIT", "devDependencies": {"assert": "^2.0.0", "buffer": "^5.5.0", "crypto-browserify": "^3.12.0", "events": "^3.1.0", "parcel": "^2.8.3", "parcel-namer-without-hash": "^0.0.1", "path-browserify": "^1.0.0", "process": "^0.11.10", "punycode": "^1.4.1", "querystring-es3": "^0.2.1", "stream-browserify": "^3.0.0", "url": "^0.11.0", "util": "^0.12.3"}, "dependencies": {"@parcel/fs": "^2.8.3", "copy-to-clipboard": "^3.3.3", "file-saver": "^2.0.5", "memfs": "^3.4.13", "react": "^18.2.0", "react-dom": "^18.2.0", "unionfs": "^4.4.0", "xterm": "^5.1.0", "xterm-for-react": "^1.0.4", "xterm-js-shell": "^1.1.3"}, "scripts": {"prestart": "rm -f parcelrc", "start": "parcel", "build": "./build.py"}} \ No newline at end of file +{ + "name": "resume", + "version": "1.0.0", + "source": "src/resume.html", + "author": "blek", + "license": "MIT", + "devDependencies": { + "assert": "^2.0.0", + "buffer": "^5.5.0", + "crypto-browserify": "^3.12.0", + "events": "^3.1.0", + "parcel": "^2.8.3", + "parcel-namer-without-hash": "^0.0.1", + "path-browserify": "^1.0.0", + "process": "^0.11.10", + "punycode": "^1.4.1", + "querystring-es3": "^0.2.1", + "stream-browserify": "^3.0.0", + "url": "^0.11.0", + "util": "^0.12.3" + }, + "dependencies": { + "@parcel/fs": "^2.8.3", + "copy-to-clipboard": "^3.3.3", + "file-saver": "^2.0.5", + "memfs": "^3.4.13", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "unionfs": "^4.4.0", + "xterm": "^5.1.0", + "xterm-for-react": "^1.0.4", + "xterm-js-shell": "^1.1.3" + }, + "scripts": { + "prestart": "rm -f parcelrc", + "start": "parcel", + "build": "./build.py" + } +}