From 018aad203ed11e977536a0d767f3c567b3f091f5 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Fri, 11 Oct 2024 00:40:31 +0700 Subject: [PATCH] chore: initial commit --- .github/workflows/release.yml | 56 +++++++++++ .gitignore | 175 ++++++++++++++++++++++++++++++++++ README.md | 20 ++++ build.ts | 17 ++++ bun.lockb | Bin 0 -> 13774 bytes index.js | 6 ++ package.json | 14 +++ tsconfig.json | 6 ++ 8 files changed, 294 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 build.ts create mode 100644 bun.lockb create mode 100644 index.js create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d4875a4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: Build and release +on: + workflow_dispatch: + inputs: + tag: + description: 'Tag for this release' + required: true + type: string + +jobs: + build: + name: Build and release + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Build + run: bun run build + + - name: Create draft release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.inputs.tag }} + release_name: React DevTools Core ${{ github.event.inputs.tag }} + draft: true + prerelease: false + + - name: Upload dist + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./dist/index.js + asset_name: rdtc.js + asset_content_type: text/javascript + + - name: Publish release + uses: eregon/publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.create_release.outputs.id }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b1ee42 --- /dev/null +++ b/.gitignore @@ -0,0 +1,175 @@ +# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore + +# Logs + +logs +_.log +npm-debug.log_ +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Caches + +.cache + +# 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 + +# Optional stylelint cache + +.stylelintcache + +# 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 variable files + +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) + +.parcel-cache + +# Next.js build output + +.next +out + +# Nuxt.js build / generate output + +.nuxt +dist + +# Gatsby files + +# 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 + +# vuepress v2.x temp and cache directory + +.temp + +# Docusaurus cache and generated files + +.docusaurus + +# 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 + +# yarn v2 + +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +# IntelliJ based IDEs +.idea + +# Finder (MacOS) folder config +.DS_Store diff --git a/README.md b/README.md new file mode 100644 index 0000000..f620360 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# @revenge-mod/react-devtools-core + +## Build + +Install dependencies: + +```bash +bun install +``` + +Build bundle: + +```bash +# File will be placed at dist/index.js +bun run build +``` + +## Usage + +Load the given file before React. You can access exports thru `window.__reactDevToolsCore.exports`. diff --git a/build.ts b/build.ts new file mode 100644 index 0000000..46427a9 --- /dev/null +++ b/build.ts @@ -0,0 +1,17 @@ +import { buildSync } from 'esbuild' +import { dependencies } from './package.json' with { type: 'json' } + +buildSync({ + entryPoints: ['index.js'], + outfile: 'dist/index.js', + bundle: true, + format: 'iife', + minify: true, + minifyIdentifiers: false, + define: { + __RDTC_VERSION: `"${dependencies['react-devtools-core']}"` + }, + banner: { + js: "var window=globalThis,self=globalThis,console=new Proxy({},{get:()=>()=>void 0});" + } +}) \ No newline at end of file diff --git a/bun.lockb b/bun.lockb new file mode 100644 index 0000000000000000000000000000000000000000..e8a0b13925718f28e081e34427e27d52df04ba29 GIT binary patch literal 13774 zcmeHO3pi9;`yXr}M^r=#LnW7HTxLvep`yDkic_L;8H~mZGvijt=tdV2C8s(SMRims zr&H-dbP*NOMW>rCl$@lJgo^)KGkeYK>uuIsfPRzUS+Go;~kg>s{|}zw6y=ul26w zHO$Z=lFzg7XK^f;oG7w?B&RR9C~R)P;vg2ANeSZe!u$l3D9gU`Boc{zRPAwL&fqocv%}Y5S7U!l8_GW1_HhX za8(mo1rlihs3!vs+x-BzCg7dGELi^xa9F+u_#nUw0f+7KaQRkT zo`B24@Uj=++Mt~aUQYoW>J7%_N`OQBw{l|q2Y^HT%Yegn#{ky?JPVhv$K}y@nF%=5 zHv`@23%CRLQ2{&&aM;fZz<&Td9Fo)|w5!Ln(t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