Skip to content

Commit

Permalink
fix: type-only import (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgv authored Apr 17, 2023
1 parent 521b4a2 commit f2d82a4
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi
available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct/][version]

[homepage]: http://contributor-covenant.org
[version]: https://www.contributor-covenant.org/version/2/1
[version]: https://www.contributor-covenant.org/version/2/1
2 changes: 1 addition & 1 deletion cli/plasmo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
English | <a href="/cli/plasmo/i18n/README.zh-CN.md">简体中文</a> | <a href="/cli/plasmo/i18n/README.vi-VN.md">Tiếng Việt</a> | <a href="/cli/plasmo/i18n/README.de-DE.md">Deutsch</a> | <a href="/cli/plasmo/i18n/README.fr-FR.md">French</a> | <a href="/cli/plasmo/i18n/README.id-ID.md">Indonesian</a> | <a href="/cli/plasmo/i18n/README.ru-RU.md">Русский</a> | <a href="/cli/plasmo/i18n/README.tr-TR.md">Turkish</a>
</p>

**Production Cloud:** We've built a cloud offering for browser extensions called [Itero](https://itero.plasmo.com). Check it out if you want instant beta testing and more awesome features.
**Production Cloud:** We've built a cloud offering for browser extensions called [Itero](https://itero.plasmo.com). Check it out if you want instant beta testing and more awesome features.

# Plasmo Framework

Expand Down
2 changes: 1 addition & 1 deletion cli/plasmo/i18n/README.id-ID.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Terima kasih banyak untuk semua yang luar biasa [kontributor](https://github.com

Jangan ragu untuk ikut bersenang-senang dan mengirim PR!

### Framework Plasmo
### Framework Plasmo

<a href="https://github.com/PlasmoHQ/plasmo/graphs/contributors">
<img src="https://contrib.rocks/image?repo=PlasmoHQ/plasmo" />
Expand Down
4 changes: 2 additions & 2 deletions cli/plasmo/i18n/README.ru-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
![CLI Demo](https://www.plasmo.com/assets/plasmo-cli-demo.gif)

## Главные особенности
## Главные особенности

- Первоклассная поддержка [React](https://reactjs.org/) + [Typescript](https://www.typescriptlang.org/)
- [Декларативная настройка "manifest.json" (MV3)](https://docs.plasmo.com/framework#where-is-the-manifestjson-file)
Expand Down Expand Up @@ -106,7 +106,7 @@ pnpm dev
...
```

Наконец, вы также можете избежать размещения исходного кода в вашем корневом каталоге, поместив их в подкаталог `src`, [следуя этому руководству](https://docs.plasmo.com/framework/customization/src). Обратите внимание что `assets` и другие конфигурационные файлы по-прежнему должны находиться в корневом каталоге.
Наконец, вы также можете избежать размещения исходного кода в вашем корневом каталоге, поместив их в подкаталог `src`, [следуя этому руководству](https://docs.plasmo.com/framework/customization/src). Обратите внимание что `assets` и другие конфигурационные файлы по-прежнему должны находиться в корневом каталоге.

## Поддерживаемые браузеры

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { relative, resolve } from "path"
import { vLog } from "@plasmo/utils/logging"
import { toPosix } from "@plasmo/utils/path"

import type { PlasmoManifest } from "~features/manifest-factory/base"
import { type PlasmoManifest } from "~features/manifest-factory/base"

export const createBgswEntry = async (
{ indexFilePath = "", withMessaging = false, withMainWorldScript = false },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { relative, resolve } from "path"
import { vLog } from "@plasmo/utils/logging"
import { toPosix } from "@plasmo/utils/path"

import type { PlasmoManifest } from "~features/manifest-factory/base"
import { type PlasmoManifest } from "~features/manifest-factory/base"

export const createBgswMainWorldInjector = async (
plasmoManifest: PlasmoManifest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
outputMessagingDeclaration
} from "~features/background-service-worker/bgsw-messaging-declaration"
import { getMd5RevHash } from "~features/helpers/crypto"
import type { PlasmoManifest } from "~features/manifest-factory/base"
import { type PlasmoManifest } from "~features/manifest-factory/base"

const state = {
md5Hash: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isAccessible } from "@plasmo/utils/fs"
import { createBgswEntry } from "~features/background-service-worker/bgsw-entry"
import { createBgswMainWorldInjector } from "~features/background-service-worker/bgsw-main-world-script"
import { createBgswMessaging } from "~features/background-service-worker/bgsw-messaging"
import type { PlasmoManifest } from "~features/manifest-factory/base"
import { type PlasmoManifest } from "~features/manifest-factory/base"

export const updateBgswEntry = async (plasmoManifest: PlasmoManifest) => {
const [bgswIndexFilePath, withMessaging, withMainWorldScript] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { hasFlag } from "@plasmo/utils/flags"
import { iLog, vLog, wLog } from "@plasmo/utils/logging"

import { updateBgswEntry } from "~features/background-service-worker/update-bgsw-entry"
import type { PlasmoManifest } from "~features/manifest-factory/base"
import { type PlasmoManifest } from "~features/manifest-factory/base"

import { generateIcons } from "./generate-icons"
import { WatchReason } from "./project-path"
Expand Down
2 changes: 1 addition & 1 deletion cli/plasmo/src/features/helpers/create-parcel-bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { dirname, join, resolve } from "path"

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

import { Parcel, ParcelOptions } from "@plasmohq/parcel-core"
import { Parcel, type ParcelOptions } from "@plasmohq/parcel-core"

import type { PlasmoManifest } from "~features/manifest-factory/base"

Expand Down
13 changes: 9 additions & 4 deletions cli/plasmo/src/features/manifest-factory/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ import { isReadable } from "@plasmo/utils/fs"
import { vLog } from "@plasmo/utils/logging"
import { getSubExt, toPosix } from "@plasmo/utils/path"

import { EnvConfig, loadEnvConfig } from "~features/env/env-config"
import { type EnvConfig, loadEnvConfig } from "~features/env/env-config"
import { outputEnvDeclaration } from "~features/env/env-declaration"
import {
CommonPath,
type CommonPath,
getCommonPath
} from "~features/extension-devtools/common-path"
import { extractContentScriptConfig } from "~features/extension-devtools/content-script-config"
import { generateIcons } from "~features/extension-devtools/generate-icons"
import type { PlasmoBundleConfig } from "~features/extension-devtools/get-bundle-config"
import type { PackageJSON } from "~features/extension-devtools/package-file"
import {
ProjectPath,
type ProjectPath,
getProjectPath
} from "~features/extension-devtools/project-path"
import { getTemplatePath } from "~features/extension-devtools/template-path"
Expand All @@ -56,7 +56,12 @@ import { updateVersionFile } from "~features/framework-update/version-tracker"
import { definedTraverse } from "~features/helpers/traverse"

import { Scaffolder } from "./scaffolder"
import { UiExtMap, UiLibrary, getUiExtMap, getUiLibrary } from "./ui-library"
import {
type UiExtMap,
type UiLibrary,
getUiExtMap,
getUiLibrary
} from "./ui-library"

export const iconMap = {
"16": "./gen-assets/icon16.plasmo.png",
Expand Down
4 changes: 2 additions & 2 deletions cli/plasmo/src/features/manifest-factory/scaffolder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { copy, ensureDir } from "fs-extra"
import { readFile, writeFile } from "fs/promises"
import { ParsedPath, join, relative, resolve } from "path"
import { type ParsedPath, join, relative, resolve } from "path"

import { find } from "@plasmo/utils/array"
import { isAccessible, isFile } from "@plasmo/utils/fs"
Expand All @@ -9,7 +9,7 @@ import { toPosix } from "@plasmo/utils/path"

import { getMd5RevHash } from "~features/helpers/crypto"

import type { PlasmoManifest } from "./base"
import { type PlasmoManifest } from "./base"
import { isSupportedUiExt } from "./ui-library"

type ExtensionUIPage = "popup" | "options" | "devtools" | "newtab"
Expand Down
2 changes: 1 addition & 1 deletion cli/plasmo/src/features/manifest-factory/ui-library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import semver from "semver"
import { assertUnreachable } from "@plasmo/utils/assert"
import { isAccessible } from "@plasmo/utils/fs"

import type { PlasmoManifest } from "./base"
import { type PlasmoManifest } from "./base"

const supportedUiLibraries = ["react", "svelte", "vue", "vanilla"] as const

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Unzipped, strFromU8, unzipSync } from "fflate"
import { type Unzipped, strFromU8, unzipSync } from "fflate"
import { readJson } from "fs-extra"
import { readFile } from "fs/promises"
import { extname } from "path"
Expand All @@ -13,7 +13,7 @@ import { vLog } from "@plasmo/utils/logging"

import type { CommonPath } from "~features/extension-devtools/common-path"
import {
PackageJSON,
type PackageJSON,
generatePackage
} from "~features/extension-devtools/package-file"
import type { PackageManagerInfo } from "~features/helpers/package-manager"
Expand Down
2 changes: 1 addition & 1 deletion cli/plasmo/src/features/project-creator/git-init.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import spawnAsync, { SpawnOptions } from "@expo/spawn-async"
import spawnAsync, { type SpawnOptions } from "@expo/spawn-async"

import { isAccessible } from "@plasmo/utils/fs"
import { iLog, vLog, wLog } from "@plasmo/utils/logging"
Expand Down
2 changes: 1 addition & 1 deletion cli/plasmo/src/features/project-creator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { iLog, vLog } from "@plasmo/utils/logging"
import type { CommonPath } from "~features/extension-devtools/common-path"
import { generateGitIgnore } from "~features/extension-devtools/git-ignore"
import {
PackageJSON,
type PackageJSON,
generatePackage,
resolveWorkspaceToLatestSemver
} from "~features/extension-devtools/package-file"
Expand Down
2 changes: 1 addition & 1 deletion cli/plasmo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { verbose } from "@plasmo/utils/flags"
import { eLog, vLog } from "@plasmo/utils/logging"
import { exitCountDown } from "@plasmo/utils/wait"

import { ValidCommand, runMap, validCommandSet } from "~commands"
import { type ValidCommand, runMap, validCommandSet } from "~commands"
import { printHeader, printHelp } from "~features/helpers/print"

async function defaultMode() {
Expand Down
2 changes: 1 addition & 1 deletion cli/plasmo/src/type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// See https://www.plasmo.com/engineering/log/2022.04#update-2022.04.23
import type { ManifestContentScript } from "@plasmo/constants/manifest/content-script"

// See https://www.plasmo.com/engineering/log/2022.04#update-2022.04.23
export type PlasmoCSConfig = Omit<Partial<ManifestContentScript>, "js">

/**
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"publish:cli": "pnpm --filter \"./cli/*\" publish",
"publish:cli:lab": "pnpm --filter \"./cli/*\" publish --no-git-checks --tag lab",
"publish:lab": "run-s publish:packages publish:cli:lab",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"### version script usage example": "pnpm v:cli patch",
"v:packages": "pnpm --filter \"./packages/**\" --parallel -r exec pnpm version --commit-hooks false --git-tag-version false --workspaces-update",
"v:parcel": "pnpm --filter \"./packages/parcel-*\" --parallel -r exec pnpm version --commit-hooks false --git-tag-version false --workspaces-update",
Expand Down
2 changes: 1 addition & 1 deletion packages/constants
Submodule constants updated 1 files
+2 −2 misc.ts
2 changes: 1 addition & 1 deletion packages/utils
Submodule utils updated 1 files
+1 −1 platform.ts

0 comments on commit f2d82a4

Please sign in to comment.