From bf0981bcc6294b54a3cf32cc41b513bb25924f58 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 7 Jan 2022 16:18:07 +0100 Subject: [PATCH] chore: cleanup build setup and webpack requirements (#265) --- .drone.yml | 7 +++---- package.json | 6 +++--- src/js/app.js | 6 +++--- src/js/darkmode.js | 4 ++-- src/js/mermaid.js | 5 ++--- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4777514..b4b572d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,7 +28,7 @@ steps: - name: testbuild image: thegeeklab/hugo:0.91.0 commands: - - mkdir exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekdoc + - mkdir -p exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekdoc - hugo -s exampleSite/ -b http://localhost/ - name: html-validation @@ -111,7 +111,6 @@ steps: - name: package image: thegeeklab/alpine-tools commands: - - mkdir dist/ - echo "${DRONE_TAG:-latest}" > VERSION - tar -zcvf dist/hugo-geekdoc.tar.gz -X .tarignore . @@ -195,7 +194,7 @@ steps: - npm install > /dev/null - npm run build - npm run svg-sprite-list - - mkdir exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekdoc + - mkdir -p exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekdoc environment: FORCE_COLOR: true NPM_CONFIG_LOGLEVEL: error @@ -285,6 +284,6 @@ depends_on: --- kind: signature -hmac: e715545ce951b15ce1ab5f7d7f107e2ab37aa08e94a681f27646a543d1e6ac3c +hmac: d45186c01b7b530fc615420c88bd6a375ac6979758cb6e12d45412cd78fc5642 ... diff --git a/package.json b/package.json index cf09d3e..183d7b4 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,10 @@ "start:hugo": "hugo server -D -F -s exampleSite/", "svg": "run-s svg:*", "svg:sprite": "svg-sprite -C svgsprite.config.json 'src/icons/*.svg'", - "svg:font": "svgtofont --sources build/icons --output build/fonts", + "svg:font": "svgtofont --sources build/icons/ --output build/fonts/", "prep:clean": "shx rm -rf build/ static/", - "prep:clean-all": "shx rm -rf build/ static/ data/ assets/sprites/ exampleSite/data/sprites", - "prep:make": "mkdir -p build/icons build/fonts", + "prep:clean-all": "shx rm -rf build/ dist/ static/ data/ assets/sprites/ exampleSite/data/sprites/", + "prep:make": "mkdir -p build/icons/ build/fonts/ dist/", "svg-sprite-list": "run-s prep:make svg ; mkdir -p exampleSite/data/sprites/ ; cp build/fonts/GeekdocIcons.json exampleSite/data/sprites/geekdoc.json", "lint": "eslint src/js/ --color" }, diff --git a/src/js/app.js b/src/js/app.js index 4be79ae..e2ae7fc 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1,7 +1,7 @@ -import { applyTheme } from "./darkmode" -import { createCopyButton } from "./copycode.js" +const { applyTheme } = require("./darkmode") +const { createCopyButton } = require("./copycode.js") +const Clipboard = require("clipboard") -import Clipboard from "clipboard" ;(() => { applyTheme() })() diff --git a/src/js/darkmode.js b/src/js/darkmode.js index 6ceef97..6cd75e4 100644 --- a/src/js/darkmode.js +++ b/src/js/darkmode.js @@ -1,6 +1,6 @@ -import Storage from "store2" +const Storage = require("store2") -import { TOGGLE_MODES, THEME, AUTO_MODE } from "./config.js" +const { TOGGLE_MODES, THEME, AUTO_MODE } = require("./config.js") document.addEventListener("DOMContentLoaded", (event) => { const darkModeToggle = document.getElementById("gdoc-dark-mode") diff --git a/src/js/mermaid.js b/src/js/mermaid.js index 755bb0c..a5f4f5c 100644 --- a/src/js/mermaid.js +++ b/src/js/mermaid.js @@ -1,6 +1,5 @@ -import Storage from "store2" - -import { DARK_MODE, THEME, AUTO_MODE } from "./config.js" +const Storage = require("store2") +const { DARK_MODE, THEME, AUTO_MODE } = require("./config.js") document.addEventListener("DOMContentLoaded", function (event) { let lstore = Storage.namespace(THEME)