Skip to content

Commit

Permalink
feat(@lexical/devtools): Publish pipeline added
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleT committed Apr 18, 2024
1 parent efbae3e commit c38bb93
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/devtools-extension-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish DevTools extension to stores

on:
workflow_dispatch:

jobs:
release:
if: github.repository_owner == 'facebook'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Configure Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
cache: 'npm'

- uses: actions/cache@v3
id: cache
with:
path: |
node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-v${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- name: Zip & submit to stores
run: npm run publish-extension
env:
EDGE_ACCESS_TOKEN_URL: ${{ secrets.EXTENSION_EDGE_ACCESS_TOKEN_URL }}
EDGE_CLIENT_SECRET: ${{ secrets.EXTENSION_EDGE_CLIENT_SECRET }}
EDGE_PRODUCT_ID: ${{ secrets.EXTENSION_EDGE_PRODUCT_ID }}
EDGE_CLIENT_ID: ${{ secrets.EXTENSION_EDGE_CLIENT_ID }}
FIREFOX_EXTENSION_ID: ${{ secrets.EXTENSION_FIREFOX_EXTENSION_ID }}
FIREFOX_JWT_ISSUER: ${{ secrets.EXTENSION_FIREFOX_JWT_ISSUER }}
FIREFOX_JWT_SECRET: ${{ secrets.EXTENSION_FIREFOX_JWT_SECRET }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ npm
e2e-screenshots
test-results
playwright-report
/SOURCE_CODE_REVIEW.md

npm-debug.log*

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"update-changelog": "node ./scripts/npm/update-changelog",
"update-version": "node ./scripts/updateVersion",
"postversion": "git checkout -b ${npm_package_version}__release && npm install && npm run update-version && npm run update-changelog && git add -A && git commit -m v${npm_package_version} && git tag -a v${npm_package_version} -m v${npm_package_version}",
"publish-extension": "npm run zip -w @lexical/devtools && npm run publish -w @lexical/devtools",
"release": "npm run prepare-release && node ./scripts/npm/release.js",
"size": "npm run build-prod && size-limit"
},
Expand Down
1 change: 1 addition & 0 deletions packages/lexical-devtools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ stats.html
stats-*.json
.wxt
web-ext.config.ts
.env.secrets

# Editor directories and files
.vscode/*
Expand Down
7 changes: 7 additions & 0 deletions packages/lexical-devtools/SOURCE_CODE_REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Lexical Developer Tools review instructions:

1. Install latest LTS version of Node.js & Chrome
2. Use local copy of the source code or obtain one from https://github.com/facebook/lexical
3. Run `npm i`
4. Navigate to `/packages/lexical-devtools`
5. Run `npm run dev`
12 changes: 9 additions & 3 deletions packages/lexical-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
"dev": "wxt",
"dev:firefox": "wxt -b firefox",
"dev:edge": "wxt -b edge",
"build": "wxt build",
"build": "npm-run-all build:chrome build:firefox build:edge",
"build:chrome": "wxt build -b chrome",
"build:firefox": "wxt build -b firefox",
"zip": "wxt zip",
"zip:firefox": "wxt zip -b firefox",
"build:edge": "wxt build -b edge",
"zip": "npm-run-all zip:chrome zip:firefox zip:edge",
"zip:chrome": "wxt zip -b firefox",
"zip:firefox": "cp ./SOURCE_CODE_REVIEW.md ../.. && wxt zip -b firefox",
"zip:edge": "wxt zip -b edge",
"publish": "wxt submit --edge-zip .output/*-edge.zip --firefox-zip .output/*-firefox.zip --firefox-sources-zip .output/*-sources.zip",
"bundle-analyzer:open": "wxt build --analyze --analyze-open",
"compile": "tsc --noEmit",
"postinstall": "wxt prepare"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions packages/lexical-devtools/wxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ import moduleResolution from '../shared/viteModuleResolution';
export default defineConfig({
debug: !!process.env.DEBUG_WXT,
manifest: (configEnv) => {
const browserName =
configEnv.browser.charAt(0).toUpperCase() + configEnv.browser.slice(1);

const manifestConf: UserManifest = {
author: 'Lexical',
description: `Adds Lexical debugging tools to the ${browserName} Developer Tools.`,
homepage_url: 'https://lexical.dev/',
icons: {
128: '/icon/128.png',
16: '/icon/16.png',
32: '/icon/32.png',
48: '/icon/48.png',
},
name: 'Lexical Developer Tools',
permissions: ['scripting', 'storage'],
web_accessible_resources: [
{
Expand Down Expand Up @@ -111,4 +118,7 @@ export default defineConfig({
],
},
}),
zip: {
sourcesRoot: path.resolve('../..'),
},
});

0 comments on commit c38bb93

Please sign in to comment.