Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/build-and-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ jobs:
build-and-pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: '14'
node-version: '22'
cache: 'npm'
- run: npm i -g npm@7
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: build
path: build/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 flyhaozi
Copyright (c) 2019 yuhaofe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
[![Chrome Web Store](https://img.shields.io/chrome-web-store/v/fkemipdcgbeknabedhecepcebhlnlhbf)](https://chrome.google.com/webstore/detail/quick-bookmarks-menu/fkemipdcgbeknabedhecepcebhlnlhbf)
[![Chrome Web Store](https://img.shields.io/chrome-web-store/rating/fkemipdcgbeknabedhecepcebhlnlhbf)](https://chrome.google.com/webstore/detail/quick-bookmarks-menu/fkemipdcgbeknabedhecepcebhlnlhbf)
[![Chrome Web Store](https://img.shields.io/chrome-web-store/users/fkemipdcgbeknabedhecepcebhlnlhbf)](https://chrome.google.com/webstore/detail/quick-bookmarks-menu/fkemipdcgbeknabedhecepcebhlnlhbf)
[![Github Actions](https://github.com/flyhaozi/Quick-Bookmarks-Menu/actions/workflows/build-and-pack.yml/badge.svg)](https://github.com/flyhaozi/Quick-Bookmarks-Menu/actions)
[![GitHub](https://img.shields.io/github/license/flyhaozi/Quick-Bookmarks-Menu)](https://github.com/flyhaozi/Quick-Bookmarks-Menu/blob/master/LICENSE)
[![Github Actions](https://github.com/yuhaofe/Quick-Bookmarks-Menu/actions/workflows/build-and-pack.yml/badge.svg)](https://github.com/yuhaofe/Quick-Bookmarks-Menu/actions)
[![GitHub](https://img.shields.io/github/license/yuhaofe/Quick-Bookmarks-Menu)](https://github.com/yuhaofe/Quick-Bookmarks-Menu/blob/master/LICENSE)
[![](https://img.shields.io/badge/dynamic/json?label=edge%20add-on&prefix=v&query=%24.version&url=https%3A%2F%2Fmicrosoftedge.microsoft.com%2Faddons%2Fgetproductdetailsbycrxid%2Fnipmnpfdiiloiegpkodghkbgnhedgmhj)](https://microsoftedge.microsoft.com/addons/detail/quick-bookmarks-menu/nipmnpfdiiloiegpkodghkbgnhedgmhj)
[![](https://img.shields.io/badge/dynamic/json?label=rating&suffix=/5&query=%24.averageRating&url=https%3A%2F%2Fmicrosoftedge.microsoft.com%2Faddons%2Fgetproductdetailsbycrxid%2Fnipmnpfdiiloiegpkodghkbgnhedgmhj)](https://microsoftedge.microsoft.com/addons/detail/quick-bookmarks-menu/nipmnpfdiiloiegpkodghkbgnhedgmhj)
[![](https://img.shields.io/badge/dynamic/json?label=users&query=%24.activeInstallCount&url=https%3A%2F%2Fmicrosoftedge.microsoft.com%2Faddons%2Fgetproductdetailsbycrxid%2Fnipmnpfdiiloiegpkodghkbgnhedgmhj)](https://microsoftedge.microsoft.com/addons/detail/quick-bookmarks-menu/nipmnpfdiiloiegpkodghkbgnhedgmhj)

A chrome extension gives you quick access to your bookmarks.

[<img src="https://flyhaozi.com/icons/chrome-web-store.svg" alt="Install from Chrome Web Store" height="60" />](https://chrome.google.com/webstore/detail/quick-bookmarks-menu/fkemipdcgbeknabedhecepcebhlnlhbf)
[<img src="https://flyhaozi.com/icons/microsoft-store.svg" alt="Install from Chrome Web Store" height="60" />](https://microsoftedge.microsoft.com/addons/detail/quick-bookmarks-menu/nipmnpfdiiloiegpkodghkbgnhedgmhj)
[<img src="https://yuhaofe.com/icons/chrome-web-store.svg" alt="Install from Chrome Web Store" height="60" />](https://chrome.google.com/webstore/detail/quick-bookmarks-menu/fkemipdcgbeknabedhecepcebhlnlhbf)
[<img src="https://yuhaofe.com/icons/microsoft-store.svg" alt="Install from Chrome Web Store" height="60" />](https://microsoftedge.microsoft.com/addons/detail/quick-bookmarks-menu/nipmnpfdiiloiegpkodghkbgnhedgmhj)

## Screenshots
![Light](https://lh3.googleusercontent.com/O-jZF-Bg6TkAfGoNPfIjABI4wdhc4CJ2JbCUC1dHAE60z0D5XMdmhlhWeQnHNlFSvJn9xw5cvJkPpW5W78YLUC3twf8=w640-h400-e365-rj-sc0x00ffffff)
Expand Down
30 changes: 19 additions & 11 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const sass = require('sass');
const esbuild = require('esbuild');
const process = require('process');
import * as sass from 'sass-embedded'
import * as esbuild from 'esbuild'
import * as process from 'process'

const dev = process.env.NODE_ENV === 'development';
const prod = process.env.NODE_ENV === 'production';
Expand All @@ -18,13 +18,13 @@ const scssPlugin = {
}
});

build.onLoad({ filter: /\.scss$/ }, args => {
const { css, stats: { includedFiles } } = sass.renderSync({ file: args.path });
build.onLoad({ filter: /\.scss$/ }, async args => {
const { css, loadedUrls } = await sass.compileAsync(args.path);

return {
contents: css.toString('utf-8'),
loader: 'css',
watchFiles: includedFiles
watchFiles: loadedUrls.map(url => url.pathname)
}
});
}
Expand All @@ -34,32 +34,40 @@ const scssPlugin = {
* @type { esbuild.BuildOptions }
*/
const buildOptions = {
entryPoints: { popup: 'src/Popup.tsx', background: 'src/background.ts' },
entryPoints: {
popup: 'src/Popup.tsx',
service_worker: 'src/service_worker.ts',
off_screen: 'src/off_screen.ts'
},
outdir: 'build',
bundle: true,
minify: true,
keepNames: true,
format: 'esm',
target: 'chrome86',
target: 'chrome88', // above manifest v3
jsxFactory: 'h',
jsxFragment: 'Fragment',
logLevel: 'info',
plugins: [scssPlugin],

// dev options
sourcemap: dev ? 'inline' : false,
watch: dev,

// prod options
metafile: prod
};

async function build() {
const result = await esbuild.build(buildOptions).catch(() => process.exit(1));

const context = await esbuild.context(buildOptions);
const result = await context.rebuild();
if (result.metafile) {
console.log(await esbuild.analyzeMetafile(result.metafile));
}
if (dev) {
await context.watch();
} else {
context.dispose();
}
}

build();
Loading