diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 0a1e25f..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index 9c3d931..a8881f1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ node_modules build dist -.DS_Store +**/.DS_Store .dccache \ No newline at end of file diff --git a/README.md b/README.md index 99a8aca..fcbada6 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,11 @@ ![Nebula screenshot](screenshots/nebula-new-tab-screenshot.png) +## Building +1. Clone this repository +2. Run `npm install` +3. Run `npm run build:extension` +4. Install the extension with the generated ZIP file + ## Installation TBA \ No newline at end of file diff --git a/assets/.DS_Store b/assets/.DS_Store deleted file mode 100644 index 0ed415b..0000000 Binary files a/assets/.DS_Store and /dev/null differ diff --git a/assets/icons/.DS_Store b/assets/icons/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/assets/icons/.DS_Store and /dev/null differ diff --git a/package-lock.json b/package-lock.json index 156209d..7cfe14f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nebula-new-tab", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nebula-new-tab", - "version": "1.0.0-alpha.1", + "version": "1.0.0-alpha.2", "license": "GPLV3", "devDependencies": { "@open-wc/building-rollup": "^1.10.0", @@ -21,6 +21,7 @@ "rollup-plugin-copy": "^3.4.0", "rollup-plugin-execute": "^1.1.1", "rollup-plugin-postcss": "^4.0.1", + "rollup-plugin-terser": "^7.0.2", "tailwindcss": "^2.2.16", "typescript": "^4.4.3", "web-ext": "^6.4.0", diff --git a/package.json b/package.json index f06a1b1..94726b1 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,11 @@ "scripts": { "dev:firefox": "web-ext run --source-dir dist", "dev:chromium": "web-ext run --source-dir dist --target chromium", - "build": "rimraf dist && tsc && rollup -c rollup.config.js", - "build:watch": "onchange 'template.html' 'index.ts' 'manifest.json' -- npm run build", + "build": "rimraf dist build && mkdir build && tsc && rollup -c rollup.config.js", + "build:watch": "onchange 'src/*' -- npm run build", "build:extension": "npm run build; web-ext build --source-dir dist", "test": "echo \"Error: no test specified\" && exit 1" }, - "keywords": [ - "new tab" - ], "author": "H. Kamran", "license": "GPLV3", "devDependencies": { @@ -33,6 +30,7 @@ "rollup-plugin-copy": "^3.4.0", "rollup-plugin-execute": "^1.1.1", "rollup-plugin-postcss": "^4.0.1", + "rollup-plugin-terser": "^7.0.2", "tailwindcss": "^2.2.16", "typescript": "^4.4.3", "web-ext": "^6.4.0", diff --git a/rollup.config.js b/rollup.config.js index 416eac7..e002399 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,11 +4,12 @@ import html from "rollup-plugin-bundle-html-thomzz"; import copy from "rollup-plugin-copy"; import postcss from "rollup-plugin-postcss"; import execute from "rollup-plugin-execute"; +import { terser } from "rollup-plugin-terser"; const baseConfig = createBasicConfig(); export default merge(baseConfig, { - input: "./build/index.js", + input: "./build/src/index.js", output: { dir: "dist", format: "cjs", @@ -20,7 +21,7 @@ export default merge(baseConfig, { }), copy({ targets: [ - { src: "manifest.json", dest: "dist" }, + { src: "src/manifest.json", dest: "dist" }, { src: "./node_modules/webextension-polyfill/dist/browser-polyfill.min.js", dest: "dist", @@ -33,7 +34,7 @@ export default merge(baseConfig, { ], }), html({ - template: "template.html", + template: "src/template.html", dest: "dist", filename: "index.html", externals: [ @@ -41,6 +42,10 @@ export default merge(baseConfig, { ], absolute: true, }), - execute(["npx tailwindcss -i ./newtab.css -o ./dist/newtab.css"]), + terser(), + execute([ + "npx tailwindcss -i ./src/newtab.css -o ./dist/newtab.css", + "zip -r build/nebula-new-tab.zip dist", + ]), ], }); diff --git a/index.ts b/src/index.ts similarity index 97% rename from index.ts rename to src/index.ts index dba1ed2..c2f1433 100644 --- a/index.ts +++ b/src/index.ts @@ -10,7 +10,9 @@ browser.runtime.onInstalled.addListener(async () => { hourStatus: "12", }); - await browser.tabs.create({ url: browser.runtime.getURL("index.html") }); + console.debug(browser.runtime.getURL("/index.html")); + + await browser.tabs.create({ url: browser.runtime.getURL("/index.html") }); }); // Background Image Initialization diff --git a/manifest.json b/src/manifest.json similarity index 83% rename from manifest.json rename to src/manifest.json index 6618879..243b186 100644 --- a/manifest.json +++ b/src/manifest.json @@ -18,9 +18,5 @@ "chrome_url_overrides": { "newtab": "index.html" }, - "chrome_settings_overrides": { - "homepage": "index.html", - "startup_pages": ["index.html"] - }, "permissions": ["storage"] } diff --git a/newtab.css b/src/newtab.css similarity index 100% rename from newtab.css rename to src/newtab.css diff --git a/template.html b/src/template.html similarity index 96% rename from template.html rename to src/template.html index d8a14ea..8c8c292 100644 --- a/template.html +++ b/src/template.html @@ -7,7 +7,7 @@ name="description" content="Welcome to Nebula, your new tab page!" /> - +
@@ -33,7 +33,7 @@ text-8xl text-white " > - 16:30 + 00:00