Skip to content

Commit

Permalink
fix: Assets was skipped or not found (#320)
Browse files Browse the repository at this point in the history
* add more vlog

* bump canary

* do not copy entry files for wars

* bump canary

* Bump all the bunlder limit up

* Bump packages version

* Update example

* bump canary

* try parcel nightly

* Bump canary

* bump deps version

Signed-off-by: L <6723574+louisgv@users.noreply.github.com>
  • Loading branch information
louisgv committed Dec 10, 2022
1 parent 0c57dcf commit 8a22e1a
Show file tree
Hide file tree
Showing 22 changed files with 658 additions and 591 deletions.
2 changes: 1 addition & 1 deletion cli/create-plasmo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-plasmo",
"version": "0.59.3",
"version": "0.59.4-alpha.1",
"description": "Create Plasmo Framework Browser Extension",
"main": "dist/index.js",
"bin": "bin/index.mjs",
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.59.3",
"version": "0.59.4-alpha.1",
"description": "The Plasmo Platform CLI",
"main": "dist/index.js",
"types": "dist/type.d.ts",
Expand Down Expand Up @@ -35,9 +35,9 @@
],
"dependencies": {
"@expo/spawn-async": "1.7.0",
"@parcel/core": "2.8.0",
"@parcel/fs": "2.8.0",
"@parcel/package-manager": "2.8.0",
"@parcel/core": "2.8.1",
"@parcel/fs": "2.8.1",
"@parcel/package-manager": "2.8.1",
"@parcel/watcher": "2.0.7",
"@plasmohq/init": "workspace:*",
"@plasmohq/parcel-config": "workspace:*",
Expand All @@ -53,7 +53,6 @@
"got": "12.5.3",
"inquirer": "9.1.4",
"is-path-inside": "4.0.0",
"ws": "8.11.0",
"mnemonic-id": "3.2.7",
"node-object-hash": "2.3.10",
"package-json": "8.1.0",
Expand All @@ -62,7 +61,8 @@
"sharp": "0.31.2",
"tempy": "3.0.0",
"tiny-glob": "0.2.9",
"typescript": "4.9.3"
"typescript": "4.9.3",
"ws": "8.11.0"
},
"devDependencies": {
"@plasmo/config": "workspace:*",
Expand Down
16 changes: 16 additions & 0 deletions cli/plasmo/src/features/extension-devtools/project-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ export const getProjectPath = (

const knownPathSet = new Set(Object.keys(watchPathReasonMap))

const entryFileSet = new Set([
...backgroundIndexList,
...contentIndexList,
...sandboxIndexList,
...popupIndexList,
...optionsIndexList,
...devtoolsIndexList,
...newtabIndexList
])

const isEntryPath = (path: string) =>
entryFileSet.has(path) ||
watchDirectoryEntries.some(([_, dir]) => path.startsWith(dir))

return {
popupIndexList,
popupHtmlList,
Expand All @@ -149,6 +163,8 @@ export const getProjectPath = (

watchPathReasonMap,
watchDirectoryEntries,

isEntryPath,
knownPathSet
}
}
Expand Down
11 changes: 6 additions & 5 deletions cli/plasmo/src/features/manifest-factory/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,9 @@ export abstract class BaseFactory<T extends ExtensionManifest = any> {
(p) => `@plasmohq/${p}` in (this.packageData.dependencies || {})
)

await Promise.all([
(this.overideManifest = await this.#getOverrideManifest()),
await this.#cacheUiLibrary()
])
await this.#cacheUiLibrary()

this.overideManifest = await this.#getOverrideManifest()
}

#cacheUiLibrary = async () => {
Expand Down Expand Up @@ -517,7 +516,9 @@ export abstract class BaseFactory<T extends ExtensionManifest = any> {
? inputFilePath
: resolve(this.commonPath.projectDirectory, inputFilePath)

const canCopy = await pathExists(resourceFilePath)
const canCopy =
!this.projectPath.isEntryPath(resourceFilePath) &&
(await pathExists(resourceFilePath))

if (!canCopy) {
return inputFilePath
Expand Down
17 changes: 9 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.0",
"version": "0.4.3",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -18,17 +18,18 @@
"parcel": ">= 2.7.0"
},
"dependencies": {
"@parcel/core": "2.8.0",
"@parcel/graph": "2.8.0",
"@parcel/diagnostic": "2.8.0",
"@parcel/hash": "2.8.0",
"@parcel/plugin": "2.8.0",
"@parcel/utils": "2.8.0",
"@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",
"nullthrows": "1.1.1"
},
"devDependencies": {
"@parcel/types": "2.8.0",
"@parcel/types": "2.8.1",
"@plasmo/config": "workspace:*",
"@plasmo/utils": "workspace:*",
"tsup": "6.5.0"
}
}
7 changes: 5 additions & 2 deletions packages/parcel-bundler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@

import { Bundler } from "@parcel/plugin"

import { vLog } from "@plasmo/utils/logging"

import { createIdealGraph } from "./create-ideal-graph"
import { decorateLegacyGraph } from "./decorate-legacy-graph"
import { getEntryByTarget } from "./get-entry-by-target"

const EXTENSION_OPTIONS = {
minBundles: 10000000,
minBundleSize: 3000,
minBundles: 1_000_000_000,
minBundleSize: 1_000_000,
maxParallelRequests: 20
}

Expand All @@ -39,6 +41,7 @@ export default new Bundler({
},

bundle({ bundleGraph, config }) {
vLog("@plasmohq/parcel-bundler")
let targetMap = getEntryByTarget(bundleGraph) // Organize entries by target output folder/ distDir

let graphs = []
Expand Down
28 changes: 14 additions & 14 deletions packages/parcel-config/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"name": "@plasmohq/parcel-config",
"version": "0.25.0",
"version": "0.25.2",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/PlasmoHQ/plasmo.git"
},
"main": "index.json",
"dependencies": {
"@parcel/config-default": "2.8.0",
"@parcel/core": "2.8.0",
"@parcel/optimizer-data-url": "2.8.0",
"@parcel/runtime-js": "2.8.0",
"@parcel/runtime-service-worker": "2.8.0",
"@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/source-map": "2.1.1",
"@parcel/transformer-css": "2.8.0",
"@parcel/transformer-graphql": "2.8.0",
"@parcel/transformer-inline-string": "2.8.0",
"@parcel/transformer-less": "2.8.0",
"@parcel/transformer-postcss": "2.8.0",
"@parcel/transformer-raw": "2.8.0",
"@parcel/transformer-sass": "2.8.0",
"@parcel/transformer-worklet": "2.8.0",
"@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",
"@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.0",
"version": "0.3.1",
"description": "Plasmo Parcel Namer for Extension Manifest",
"files": [
"dist"
Expand All @@ -26,9 +26,9 @@
"tsup": "6.5.0"
},
"dependencies": {
"@parcel/core": "2.8.0",
"@parcel/plugin": "2.8.0",
"@parcel/types": "2.8.0",
"@parcel/utils": "2.8.0"
"@parcel/core": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/types": "2.8.1",
"@parcel/utils": "2.8.1"
}
}
11 changes: 6 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.0",
"version": "0.6.2",
"description": "Plasmo Parcel Packager for Web Extension Manifest",
"files": [
"dist"
Expand All @@ -24,13 +24,14 @@
"devDependencies": {
"@plasmo/config": "workspace:*",
"@plasmo/constants": "workspace:*",
"@plasmo/utils": "workspace:*",
"tsup": "6.5.0"
},
"dependencies": {
"@parcel/core": "2.8.0",
"@parcel/plugin": "2.8.0",
"@parcel/types": "2.8.0",
"@parcel/utils": "2.8.0",
"@parcel/core": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/types": "2.8.1",
"@parcel/utils": "2.8.1",
"nullthrows": "1.1.1"
}
}
2 changes: 2 additions & 0 deletions packages/parcel-packager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { replaceURLReferences } from "@parcel/utils"
import assert from "assert"

import type { ExtensionManifest } from "@plasmo/constants"
import { vLog } from "@plasmo/utils/logging"

import {
appendMv2Wars,
Expand All @@ -20,6 +21,7 @@ import {

export default new Packager({
async package({ bundle, bundleGraph, options }) {
vLog("@plasmohq/parcel-packager")
const assets: Asset[] = []
bundle.traverseAssets((asset) => {
assets.push(asset)
Expand Down
12 changes: 6 additions & 6 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.0",
"version": "0.1.1",
"description": "Plasmo Parcel Resolver Post-processing",
"files": [
"dist"
Expand All @@ -26,11 +26,11 @@
"@plasmo/utils": "workspace:*"
},
"dependencies": {
"@parcel/core": "2.8.0",
"@parcel/hash": "2.8.0",
"@parcel/plugin": "2.8.0",
"@parcel/types": "2.8.0",
"@parcel/utils": "2.8.0",
"@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",
"tsup": "6.5.0",
"typescript": "4.9.3"
}
Expand Down
18 changes: 9 additions & 9 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.1",
"version": "0.8.2",
"description": "Plasmo Parcel Resolver",
"files": [
"dist"
Expand Down Expand Up @@ -42,18 +42,18 @@
"stream-http": "3.2.0",
"string_decoder": "1.3.0",
"timers": "0.1.1",
"url": "0.11.0",
"tty-browserify": "0.0.1",
"timers-browserify": "2.0.12",
"tsup": "6.5.0",
"tty-browserify": "0.0.1",
"url": "0.11.0",
"util": "0.12.5",
"vm-browserify": "1.1.2",
"tsup": "6.5.0"
"vm-browserify": "1.1.2"
},
"dependencies": {
"@parcel/core": "2.8.0",
"@parcel/hash": "2.8.0",
"@parcel/plugin": "2.8.0",
"@parcel/types": "2.8.0",
"@parcel/core": "2.8.1",
"@parcel/hash": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/types": "2.8.1",
"got": "12.5.3"
}
}
6 changes: 3 additions & 3 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.13.0",
"version": "0.13.1",
"description": "Plasmo Parcel Runtime",
"files": [
"dist"
Expand Down Expand Up @@ -28,8 +28,8 @@
"tsup": "6.5.0"
},
"dependencies": {
"@parcel/core": "2.8.0",
"@parcel/plugin": "2.8.0",
"@parcel/core": "2.8.1",
"@parcel/plugin": "2.8.1",
"react-refresh": "0.14.0"
}
}
8 changes: 4 additions & 4 deletions packages/parcel-transformer-inject-env/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-transformer-inject-env",
"version": "0.2.0",
"version": "0.2.1",
"description": "Plasmo Parcel Transformer to inject environment variables",
"files": [
"dist"
Expand All @@ -27,8 +27,8 @@
"tsup": "6.5.0"
},
"dependencies": {
"@parcel/core": "2.8.0",
"@parcel/plugin": "2.8.0",
"@parcel/types": "2.8.0"
"@parcel/core": "2.8.1",
"@parcel/plugin": "2.8.1",
"@parcel/types": "2.8.1"
}
}
8 changes: 4 additions & 4 deletions packages/parcel-transformer-inline-css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plasmohq/parcel-transformer-inline-css",
"version": "0.2.0",
"version": "0.2.1",
"description": "Plasmo Parcel Transformer for inline CSS",
"files": [
"dist"
Expand All @@ -26,9 +26,9 @@
"tsup": "6.5.0"
},
"dependencies": {
"@parcel/core": "2.8.0",
"@parcel/core": "2.8.1",
"@parcel/css": "1.14.0",
"@parcel/plugin": "2.8.0",
"@parcel/utils": "2.8.0"
"@parcel/plugin": "2.8.1",
"@parcel/utils": "2.8.1"
}
}

0 comments on commit 8a22e1a

Please sign in to comment.