diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..94366eb --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,65 @@ +name: Build plugin + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - "*" # Push events to matching any tag format, i.e. 1.0, 20.15.10 + +env: + PLUGIN_NAME: logseq-scroll-past-bottom + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup bun + uses: oven-sh/setup-bun@v1 + + - name: Build + id: build + run: | + bun i && bun run build + mkdir ${{ env.PLUGIN_NAME }} + cp README.md package.json icon.png ${{ env.PLUGIN_NAME }} + mv dist ${{ env.PLUGIN_NAME }} + zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }} + ls + echo "tag_name=$(git tag --sort version:refname | tail -n 1)" >> $GITHUB_OUTPUT + + - name: Create Release + uses: ncipollo/release-action@v1 + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ github.ref }} + with: + allowUpdates: true + draft: false + prerelease: false + + - name: Upload zip file + id: upload_zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./${{ env.PLUGIN_NAME }}.zip + asset_name: ${{ env.PLUGIN_NAME }}-${{ steps.build.outputs.tag_name }}.zip + asset_content_type: application/zip + + - name: Upload package.json + id: upload_metadata + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./package.json + asset_name: package.json + asset_content_type: application/json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..827cc00 --- /dev/null +++ b/.gitignore @@ -0,0 +1,120 @@ +.DS_Store +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test +.env.production + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test +.vscode + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ee442ac --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 RubenSmn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..52d27bc --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# logseq-copy-url + +A simple plugin that allows you to easily copy the URL of a link by right-clicking, enhancing workflow efficiency. + +## License + +[MIT](./LICENSE) diff --git a/build.ts b/build.ts new file mode 100644 index 0000000..5c5c62b --- /dev/null +++ b/build.ts @@ -0,0 +1,8 @@ +import html from "bun-plugin-html"; + +await Bun.build({ + entrypoints: ["./src/index.html", "./src/index.ts"], + outdir: "./dist", + plugins: [html()], + minify: true, +}); diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..57a4b14 Binary files /dev/null and b/bun.lockb differ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..456e234 Binary files /dev/null and b/icon.png differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..be813b4 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "logseq-copy-url", + "version": "1.0.0", + "description": "A simple plugin that allows you to easily copy the URL of a link, enhancing workflow efficiency.", + "main": "dist/index.html", + "targets": { + "main": false + }, + "scripts": { + "build": "bun run ./build.ts" + }, + "logseq": { + "id": "logseq-copy-url", + "title": "Copy URL", + "icon": "./icon.png" + }, + "keywords": [], + "author": "RubenSmn", + "license": "MIT", + "dependencies": { + "@logseq/libs": "^0.0.15" + }, + "devDependencies": { + "bun-plugin-html": "^1.2.0" + } +} diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..b193e7c --- /dev/null +++ b/src/index.html @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..4ce0b9b --- /dev/null +++ b/src/index.ts @@ -0,0 +1,7 @@ +import "@logseq/libs"; + +const main = () => { + console.log("Working"); +}; + +logseq.ready(main).catch(console.error); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..7556e1d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "lib": ["ESNext"], + "module": "esnext", + "target": "esnext", + "moduleResolution": "bundler", + "moduleDetection": "force", + "allowImportingTsExtensions": true, + "noEmit": true, + "composite": true, + "strict": true, + "downlevelIteration": true, + "skipLibCheck": true, + "jsx": "react-jsx", + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "allowJs": true, + "types": [ + "bun-types" // add Bun global + ] + } +}