Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
winstxnhdw authored Sep 3, 2023
2 parents 6014609 + 3d2f4d5 commit 2f4f2dd
Show file tree
Hide file tree
Showing 158 changed files with 3,319 additions and 615 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-plums-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crxjs/vite-plugin": patch
---

WIP: fix HMR singleton issue
6 changes: 6 additions & 0 deletions .changeset/eleven-buttons-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"vite-plugin-docs": patch
"@crxjs/vite-plugin": patch
---

Add tip `type: module` to vue page
5 changes: 5 additions & 0 deletions .changeset/eleven-planes-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crxjs/vite-plugin": patch
---

fix(package): update cjs export path
5 changes: 5 additions & 0 deletions .changeset/fair-eggs-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crxjs/vite-plugin": patch
---

Add newline to generated manifest.json (issue #668)
6 changes: 6 additions & 0 deletions .changeset/kind-donkeys-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"vite-plugin-docs": patch
"@crxjs/vite-plugin": patch
---

fix: add new screenshot and remove the redudant code
5 changes: 5 additions & 0 deletions .changeset/late-paws-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'rollup-plugin-chrome-extension': patch
---

Allows <all_urls> match in manifest.json within rollup package
5 changes: 5 additions & 0 deletions .changeset/moody-ligers-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crxjs/vite-plugin": patch
---

fix: infinite recursion on circular dependency
13 changes: 13 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,32 @@
},
"changesets": [
"beige-snails-kiss",
"breezy-plums-study",
"eleven-buttons-dream",
"eleven-planes-tease",
"fair-eggs-change",
"fluffy-numbers-brake",
"fresh-suns-do",
"gold-spies-occur",
"grumpy-brooms-exist",
"grumpy-comics-explain",
"kind-donkeys-cry",
"late-paws-change",
"long-kangaroos-work",
"lucky-cows-tan",
"moody-ligers-exercise",
"perfect-doors-exercise",
"rotten-snakes-brush",
"six-cobras-flash",
"sixty-mirrors-promise",
"small-phones-beam",
"strong-jobs-try",
"stupid-years-whisper",
"swift-years-kick",
"tidy-shrimps-cross",
"tiny-planes-float",
"wet-hornets-run",
"wicked-moose-listen",
"young-terms-tickle"
]
}
5 changes: 5 additions & 0 deletions .changeset/rotten-snakes-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crxjs/vite-plugin": patch
---

Add inline sourcemap support to content scripts
5 changes: 5 additions & 0 deletions .changeset/six-cobras-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crxjs/vite-plugin": patch
---

Test: infinite recursion on circular dependency
6 changes: 6 additions & 0 deletions .changeset/small-phones-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"vite-plugin-docs": patch
"@crxjs/vite-plugin": patch
---

React v18 ReactDOM.render changes
5 changes: 5 additions & 0 deletions .changeset/strong-jobs-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crxjs/vite-plugin": patch
---

Add content script module API
5 changes: 5 additions & 0 deletions .changeset/wet-hornets-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@crxjs/vite-plugin": patch
---

Fix content scripts hmr
6 changes: 6 additions & 0 deletions .changeset/wicked-moose-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"rollup-plugin-chrome-extension": patch
"@crxjs/vite-plugin": patch
---

fix: schema of input_components
42 changes: 22 additions & 20 deletions .github/workflows/vite-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
run: pnpm install --filter "vite-plugin"

- name: Run e2e tests
uses: GabrielBB/xvfb-action@v1
uses: xvfb-run -a npm test
with:
run: pnpm test:run:e2e
working-directory: "packages/vite-plugin"
Expand All @@ -122,7 +122,7 @@ jobs:
if: failure()
with:
name: image-diff-${{ matrix.type }}
path: ${{ github.workspace }}/tests/**/__image_snapshots__/__diff_output__/*.png
path: ${{ github.workspace }}/packages/vite-plugin/tests/**/__image_snapshots__/__diff_output__/*.png

# Runs unit and output tests
unit:
Expand Down Expand Up @@ -170,21 +170,23 @@ jobs:
- name: Run unit and output tests
run: pnpm test:run:out

- name: Check for diff
id: diff
run: echo "::set-output name=diff::$(git --no-pager diff --name-only)"

- name: Fail if diff
if: ${{ steps.diff.outputs.diff }}
run: exit 1

- name: Git diff
if: failure()
run: git diff > diff.txt

- uses: actions/upload-artifact@v3
if: failure()
with:
name: output-diff-${{ matrix.type }}
path: diff.txt
if-no-files-found: ignore
# Disabling diff check for now, don't think it's doing anything
#
# - name: Check for diff
# id: diff
# run: echo "::set-output name=diff::$(git --no-pager diff --name-only)"

# - name: Fail if diff
# if: ${{ steps.diff.outputs.diff }}
# run: exit 1

# - name: Git diff
# if: failure()
# run: git diff > diff.txt

# - uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: output-diff-${{ matrix.type }}
# path: diff.txt
# if-no-files-found: ignore
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dist
schema
*-lock.*
.github/**/*.yaml
.github/**/*.yml
.github/**/*.yml
packages/vite-plugin/src/client/iife
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@changesets/cli": "^2.22.0",
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"eslint": "8.26.0",
"eslint": "8.43.0",
"eslint-plugin-react": "^7.29.4",
"npm-run-all": "^4.1.5",
"prettier": "^2.6.2",
Expand Down
14 changes: 14 additions & 0 deletions packages/rollup-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# rollup-plugin-chrome-extension

## 3.6.13-beta.0

### Patch Changes

- bbc4d33: fix: schema of input_components

## 3.6.11

## 3.6.11-beta.0

### Patch Changes

- 2fd88aa: Allows <all_urls> match in manifest.json within rollup package

## 3.6.10

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Use `manifest.json` as the input. Every file in the manifest will be bundled or
copied to the output folder.

RPCE simplifies project config and supports many of Vite's features in the
Chrome Extension evironment, including HMR.
Chrome Extension environment, including HMR.

## [Documentation](https://www.extend-chrome.dev/rollup-plugin)

Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-plugin/__tests__/e2e__mv3-basic-js.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test('bundles assets', async () => {
expect(assets.length).toBe(2)
})

test('entries in manifest match entriess in output', async () => {
test('entries in manifest match entries in output', async () => {
const { output } = await outputPromise

const assets = output.filter(isAsset)
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-plugin/jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jest.spyOn(console, 'log')
jest.spyOn(console, 'error')
jest.spyOn(console, 'warn')

/* ---------- DONT LET ROLLUP PLUGINS WARN --------- */
/* ---------- DON'T LET ROLLUP PLUGINS WARN --------- */

beforeAll(() => {
// eslint-disable-next-line
Expand Down
8 changes: 4 additions & 4 deletions packages/rollup-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-chrome-extension",
"version": "3.6.10",
"version": "3.6.13-beta.0",
"description": "Build Chrome Extensions with this Rollup plugin.",
"keywords": [
"rollup-plugin",
Expand Down Expand Up @@ -56,7 +56,7 @@
"localforage": "^1.9.0",
"lodash": "^4.17.21",
"mem": "^6.0.1",
"playwright-chromium": "1.27.1",
"playwright-chromium": "1.33.0",
"rollup": "^2.72.1",
"slash": "^3.0.0",
"webextension-polyfill": "^0.9.0"
Expand All @@ -78,7 +78,7 @@
"@testing-library/dom": "^6.12.2",
"@testing-library/jest-dom": "^5.1.1",
"@types/cheerio": "0.22.22",
"@types/chrome": "0.0.209",
"@types/chrome": "0.0.237",
"@types/fs-extra": "^8.0.1",
"@types/glob": "^8.0.0",
"@types/jest": "^27.0.0",
Expand All @@ -87,7 +87,7 @@
"@types/lodash.flatten": "^4.4.6",
"@types/lodash.get": "^4.4.6",
"@types/node": "^13.7.0",
"@types/prettier": "^1.19.0",
"@types/prettier": "^2.0.0",
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
"jest": "^27.5.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/rollup-plugin/schema/manifest-v3.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,22 +472,22 @@
"items": {
"additionalProperties": false,
"properties": {
"description": {
"name": {
"type": "string"
},
"id": {
"type": "string"
},
"language": {
"type": "string"
"type": ["string", "array"]
},
"layouts": {
"type": "array"
"type": ["string", "array"]
},
"name": {
"input_view": {
"type": "string"
},
"type": {
"options_page": {
"type": "string"
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const convertMatchPatterns = (m: string): string => {
if (m === ('<all_urls>')) return m
// Use URL to parse match pattern
// URL must have valid url scheme
const [scheme, rest] = m.split('://')
Expand All @@ -16,7 +17,7 @@ export const convertMatchPatterns = (m: string): string => {
const [x, y] = base.split(':3333')
const final = isWildPort ? [x, port, y].join('') : base

// URL escapes asterixes
// URL escapes asterisks
// Need to unescape them
return unescape(`${scheme}://${final}/*`)
}
13 changes: 13 additions & 0 deletions packages/vite-plugin-docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# vite-plugin-docs

## 0.0.3-beta.2

### Patch Changes

- 00be1a1: fix: add new screenshot and remove the redudant code
- 42baebb: React v18 ReactDOM.render changes

## 0.0.3-beta.1

### Patch Changes

- 3dea230: Add tip `type: module` to vue page

## 0.0.3-beta.0

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,20 @@ import Installing from '../\_install-extension.md';

<Installing/>

![Chrome Extension icon context menu](./assets/start-context-menu-inspect.png)
## Opening the extension

<Opening/>

![image](https://user-images.githubusercontent.com/33419526/227034773-c8b065eb-a3b4-4ab2-a31e-86a29bec7894.png)

## Profit with Vite HMR

Once you've found the extension icon, right-click it and choose "Inspect popup
window". This will open the popup and the popup dev tools window. We need to
inspect the popup to keep it open while making changes.

![Popup without min-width](./assets/start-starter-narrow.png)

That popup is pretty tiny; let's add some CSS to make it wider.

```css title=App.css
.App {
text-align: center;
// highlight-next-line
min-width: 350px;
}
```
![Chrome Extension icon context menu](./assets/start-context-menu-inspect.png)

And boom! HMR magic at work.

![Popup with min-width](./assets/start-starter-wide.png)
![image](https://user-images.githubusercontent.com/33419526/227035247-c1956251-847a-4361-8e2f-dd323c9d7c67.png)
Loading

0 comments on commit 2f4f2dd

Please sign in to comment.