Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bundle buddy reporter #339

Merged
merged 3 commits into from
Dec 15, 2022
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
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ save-workspace-protocol = true
prefer-workspace-packages = true
save-exact = true
link-workspace-packages = true
strict-peer-dependencies = false
strict-peer-dependencies = false
git-tag-version = false
commit-hooks = false
4 changes: 2 additions & 2 deletions cli/create-plasmo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-plasmo",
"version": "0.60.0-alpha.0",
"version": "0.60.0-lab.1",
"description": "Create Plasmo Framework Browser Extension",
"main": "dist/index.js",
"bin": "bin/index.mjs",
Expand Down Expand Up @@ -45,6 +45,6 @@
"@plasmo/constants": "workspace:*",
"@plasmo/utils": "workspace:*",
"plasmo": "workspace:*",
"typescript": "4.9.3"
"typescript": "4.9.4"
}
}
3 changes: 1 addition & 2 deletions cli/plasmo/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const commonConfig = {
async function main() {
const config = await fse.readJson("package.json")
const define = {
"process.env.APP_VERSION": `"${config.version}"`,
"process.env.LAB": watch
"process.env.APP_VERSION": `"${config.version}"`
}

await build({
Expand Down
12 changes: 6 additions & 6 deletions cli/plasmo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plasmo",
"version": "0.60.0-alpha.0",
"version": "0.60.0-lab.1",
"description": "The Plasmo Platform CLI",
"main": "dist/index.js",
"types": "dist/type.d.ts",
Expand Down Expand Up @@ -35,15 +35,15 @@
],
"dependencies": {
"@expo/spawn-async": "1.7.0",
"@parcel/core": "2.8.1",
"@parcel/fs": "2.8.1",
"@parcel/package-manager": "2.8.1",
"@parcel/core": "2.8.2",
"@parcel/fs": "2.8.2",
"@parcel/package-manager": "2.8.2",
"@parcel/watcher": "2.0.7",
"@plasmohq/init": "workspace:*",
"@plasmohq/parcel-config": "workspace:*",
"archiver": "5.3.1",
"buffer": "6.0.3",
"chalk": "5.1.2",
"chalk": "5.2.0",
"change-case": "4.1.2",
"dotenv": "16.0.3",
"dotenv-expand": "9.0.0",
Expand All @@ -61,7 +61,7 @@
"sharp": "0.31.2",
"tempy": "3.0.0",
"tiny-glob": "0.2.9",
"typescript": "4.9.3",
"typescript": "4.9.4",
"ws": "8.11.0"
},
"devDependencies": {
Expand Down
20 changes: 17 additions & 3 deletions cli/plasmo/src/features/helpers/create-parcel-bundler.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Parcel } from "@parcel/core"
import ParcelFS from "@parcel/fs"
import ParcelPM from "@parcel/package-manager"
import { emptyDir } from "fs-extra"
import { resolve } from "path"
import { emptyDir, readJson, writeJson } from "fs-extra"
import { dirname, join, resolve } from "path"

import { hasFlag } from "@plasmo/utils/flags"

import type { CommonPath } from "~features/extension-devtools/common-path"

Expand Down Expand Up @@ -34,12 +36,24 @@ export const createParcelBuilder = async (
new PackageInstaller()
)

const baseConfig = require.resolve("@plasmohq/parcel-config")

const runConfig = join(dirname(baseConfig), "run.json")

const configJson = await readJson(baseConfig)

if (hasFlag("--bundle-buddy")) {
configJson.reporters = ["...", "@parcel/reporter-bundle-buddy"]
}

await writeJson(runConfig, configJson)

const bundler = new Parcel({
inputFS,
packageManager,
entries: commonPath.entryManifestPath,
cacheDir: resolve(commonPath.cacheDirectory, "parcel"),
config: require.resolve("@plasmohq/parcel-config"),
config: runConfig,
shouldAutoInstall: true,
...options
})
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@
"@types/archiver": "5.3.1",
"@types/fs-extra": "9.0.13",
"@types/inquirer": "9.0.3",
"@types/node": "18.11.9",
"@types/node": "18.11.15",
"@types/node-rsa": "1.1.1",
"@types/react": "18.0.25",
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"@types/semver": "7.3.13",
"@types/sharp": "0.31.0",
"@types/uuid": "8.3.4",
"@types/uuid": "9.0.0",
"@types/ws": "8.5.3",
"esbuild": "0.15.15",
"eslint": "8.28.0",
"esbuild": "0.16.7",
"eslint": "8.29.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-react": "7.31.11",
"fs-extra": "10.1.0",
"prettier": "2.8.0",
"fs-extra": "11.1.0",
"prettier": "2.8.1",
"tsup": "6.5.0",
"turbo": "1.6.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/config
Submodule config updated 1 files
+1 −1 package.json
2 changes: 1 addition & 1 deletion packages/constants
Submodule constants updated 1 files
+1 −1 package.json
2 changes: 1 addition & 1 deletion packages/gcp-refresh-token
2 changes: 1 addition & 1 deletion packages/init/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/init",
"version": "0.5.1",
"version": "0.5.3",
"description": "Plasmo init template files",
"files": [
"entries",
Expand Down
12 changes: 6 additions & 6 deletions packages/messaging/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/messaging",
"version": "0.0.1",
"version": "0.0.2",
"description": "Type-safe, zero-config messaging library for modern browser extensions",
"type": "module",
"module": "./dist/index.js",
Expand Down Expand Up @@ -94,10 +94,10 @@
"@jest/globals": "29.3.1",
"@jest/types": "29.3.1",
"@testing-library/react": "13.4.0",
"@types/chrome": "0.0.202",
"@types/node": "18.11.9",
"@types/react": "18.0.25",
"@types/webextension-polyfill": "0.9.1",
"@types/chrome": "0.0.204",
"@types/node": "18.11.15",
"@types/react": "18.0.26",
"@types/webextension-polyfill": "0.9.2",
"cross-env": "7.0.3",
"jest": "29.3.1",
"jest-environment-jsdom": "29.3.1",
Expand All @@ -106,7 +106,7 @@
"rimraf": "3.0.2",
"ts-jest": "29.0.3",
"tsup": "6.5.0",
"typescript": "4.9.3"
"typescript": "4.9.4"
},
"dependencies": {
"webextension-polyfill": "0.10.0"
Expand Down
16 changes: 8 additions & 8 deletions packages/parcel-bundler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-bundler",
"version": "0.4.3",
"version": "0.4.4",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -18,16 +18,16 @@
"parcel": ">= 2.7.0"
},
"dependencies": {
"@parcel/core": "2.8.1",
"@parcel/diagnostic": "2.8.1",
"@parcel/graph": "2.8.1",
"@parcel/hash": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/utils": "2.8.1",
"@parcel/core": "2.8.2",
"@parcel/diagnostic": "2.8.2",
"@parcel/graph": "2.8.2",
"@parcel/hash": "2.8.2",
"@parcel/plugin": "2.8.2",
"@parcel/utils": "2.8.2",
"nullthrows": "1.1.1"
},
"devDependencies": {
"@parcel/types": "2.8.1",
"@parcel/types": "2.8.2",
"@plasmo/config": "workspace:*",
"@plasmo/utils": "workspace:*",
"tsup": "6.5.0"
Expand Down
1 change: 1 addition & 0 deletions packages/parcel-config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run.json
29 changes: 15 additions & 14 deletions packages/parcel-config/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"name": "@plasmohq/parcel-config",
"version": "0.26.0",
"version": "0.26.1",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/PlasmoHQ/plasmo.git"
},
"main": "index.json",
"dependencies": {
"@parcel/config-default": "2.8.1",
"@parcel/core": "2.8.1",
"@parcel/optimizer-data-url": "2.8.1",
"@parcel/runtime-js": "2.8.1",
"@parcel/runtime-service-worker": "2.8.1",
"@parcel/config-default": "2.8.2",
"@parcel/core": "2.8.2",
"@parcel/optimizer-data-url": "2.8.2",
"@parcel/reporter-bundle-buddy": "2.8.2",
"@parcel/runtime-js": "2.8.2",
"@parcel/runtime-service-worker": "2.8.2",
"@parcel/source-map": "2.1.1",
"@parcel/transformer-css": "2.8.1",
"@parcel/transformer-graphql": "2.8.1",
"@parcel/transformer-inline-string": "2.8.1",
"@parcel/transformer-less": "2.8.1",
"@parcel/transformer-postcss": "2.8.1",
"@parcel/transformer-raw": "2.8.1",
"@parcel/transformer-sass": "2.8.1",
"@parcel/transformer-worklet": "2.8.1",
"@parcel/transformer-css": "2.8.2",
"@parcel/transformer-graphql": "2.8.2",
"@parcel/transformer-inline-string": "2.8.2",
"@parcel/transformer-less": "2.8.2",
"@parcel/transformer-postcss": "2.8.2",
"@parcel/transformer-raw": "2.8.2",
"@parcel/transformer-sass": "2.8.2",
"@parcel/transformer-worklet": "2.8.2",
"@plasmohq/parcel-bundler": "workspace:*",
"@plasmohq/parcel-namer-manifest": "workspace:*",
"@plasmohq/parcel-packager": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions packages/parcel-namer-manifest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-namer-manifest",
"version": "0.3.1",
"version": "0.3.2",
"description": "Plasmo Parcel Namer for Extension Manifest",
"files": [
"dist"
Expand All @@ -26,9 +26,9 @@
"tsup": "6.5.0"
},
"dependencies": {
"@parcel/core": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/types": "2.8.1",
"@parcel/utils": "2.8.1"
"@parcel/core": "2.8.2",
"@parcel/plugin": "2.8.2",
"@parcel/types": "2.8.2",
"@parcel/utils": "2.8.2"
}
}
10 changes: 5 additions & 5 deletions packages/parcel-packager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-packager",
"version": "0.6.2",
"version": "0.6.3",
"description": "Plasmo Parcel Packager for Web Extension Manifest",
"files": [
"dist"
Expand Down Expand Up @@ -28,10 +28,10 @@
"tsup": "6.5.0"
},
"dependencies": {
"@parcel/core": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/types": "2.8.1",
"@parcel/utils": "2.8.1",
"@parcel/core": "2.8.2",
"@parcel/plugin": "2.8.2",
"@parcel/types": "2.8.2",
"@parcel/utils": "2.8.2",
"nullthrows": "1.1.1"
}
}
14 changes: 7 additions & 7 deletions packages/parcel-resolver-post/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-resolver-post",
"version": "0.1.1",
"version": "0.1.3",
"description": "Plasmo Parcel Resolver Post-processing",
"files": [
"dist"
Expand All @@ -26,12 +26,12 @@
"@plasmo/utils": "workspace:*"
},
"dependencies": {
"@parcel/core": "2.8.1",
"@parcel/hash": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/types": "2.8.1",
"@parcel/utils": "2.8.1",
"@parcel/core": "2.8.2",
"@parcel/hash": "2.8.2",
"@parcel/plugin": "2.8.2",
"@parcel/types": "2.8.2",
"@parcel/utils": "2.8.2",
"tsup": "6.5.0",
"typescript": "4.9.3"
"typescript": "4.9.4"
}
}
10 changes: 5 additions & 5 deletions packages/parcel-resolver/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-resolver",
"version": "0.8.2",
"version": "0.8.3",
"description": "Plasmo Parcel Resolver",
"files": [
"dist"
Expand Down Expand Up @@ -50,10 +50,10 @@
"vm-browserify": "1.1.2"
},
"dependencies": {
"@parcel/core": "2.8.1",
"@parcel/hash": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/types": "2.8.1",
"@parcel/core": "2.8.2",
"@parcel/hash": "2.8.2",
"@parcel/plugin": "2.8.2",
"@parcel/types": "2.8.2",
"got": "12.5.3"
}
}
8 changes: 4 additions & 4 deletions packages/parcel-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-runtime",
"version": "0.14.0",
"version": "0.14.1",
"description": "Plasmo Parcel Runtime",
"files": [
"dist"
Expand All @@ -24,12 +24,12 @@
"devDependencies": {
"@plasmo/config": "workspace:*",
"@plasmo/utils": "workspace:*",
"@types/chrome": "0.0.202",
"@types/chrome": "0.0.204",
"tsup": "6.5.0"
},
"dependencies": {
"@parcel/core": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/core": "2.8.2",
"@parcel/plugin": "2.8.2",
"react-refresh": "0.14.0"
}
}
Loading