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

fix: Rebrand Remix plugin to include Vite #142

Merged
merged 6 commits into from
Jun 14, 2024
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
2 changes: 1 addition & 1 deletion .changeset/big-socks-impress.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"@codecov/sveltekit-plugin": patch
"@codecov/remix-plugin": patch
"@codecov/remix-vite-plugin": patch
"@codecov/bundler-plugin-core": patch
"@codecov/nuxt-plugin": patch
"@codecov/rollup-plugin": patch
Expand Down
4 changes: 2 additions & 2 deletions .changeset/shy-turtles-shout.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
"@codecov/sveltekit-plugin": patch
"@codecov/remix-plugin": patch
"@codecov/remix-vite-plugin": patch
"@codecov/bundler-plugin-core": patch
"@codecov/nuxt-plugin": patch
"@codecov/rollup-plugin": patch
"@codecov/vite-plugin": patch
"@codecov/webpack-plugin": patch
---

Add in new Remix plugin
Add in new Remix Vite plugin
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const config = {
"./integration-tests/tsconfig.json",
"./packages/bundler-plugin-core/tsconfig.json",
"./packages/nuxt-plugin/tsconfig.json",
"./packages/remix-plugin/tsconfig.json",
"./packages/remix-vite-plugin/tsconfig.json",
"./packages/rollup-plugin/tsconfig.json",
"./packages/sveltekit-plugin/tsconfig.json",
"./packages/vite-plugin/tsconfig.json",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ jobs:
[
"bundler-plugin-core",
"nuxt-plugin",
"remix-plugin",
"remix-vite-plugin",
"rollup-plugin",
"sveltekit-plugin",
"vite-plugin",
Expand Down Expand Up @@ -489,7 +489,7 @@ jobs:
[
"bundler-plugin-core",
"nuxt-plugin",
"remix-plugin",
"remix-vite-plugin",
"rollup-plugin",
"sveltekit-plugin",
"vite-plugin",
Expand Down
2 changes: 1 addition & 1 deletion examples/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@codecov/remix-plugin": "workspace:^",
"@codecov/remix-vite-plugin": "workspace:^",
"@remix-run/dev": "^2.9.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
Expand Down
4 changes: 2 additions & 2 deletions examples/remix/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { codecovRemixPlugin } from "@codecov/remix-plugin";
import { codecovRemixVitePlugin } from "@codecov/remix-vite-plugin";

export default defineConfig({
plugins: [
Expand All @@ -13,7 +13,7 @@ export default defineConfig({
},
}),
tsconfigPaths(),
codecovRemixPlugin({
codecovRemixVitePlugin({
enableBundleAnalysis: true,
bundleName: "@codecov/example-remix-app",
uploadToken: process.env.REMIX_UPLOAD_TOKEN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports[`Generating remix stats 2 {"format":"esm","expected":"esm"} matches the
"modules": ExpectArrayContaining {},
"outputPath": StringContaining "build",
"plugin": {
"name": StringMatching "@codecov/remix-plugin",
"name": StringMatching "@codecov/remix-vite-plugin",
"version": "0.0.1-beta.9",
},
"version": "1",
Expand All @@ -35,7 +35,7 @@ exports[`Generating remix stats 2 {"format":"esm","expected":"esm"} matches the
"modules": ExpectArrayContaining {},
"outputPath": StringContaining "build",
"plugin": {
"name": StringMatching "@codecov/remix-plugin",
"name": StringMatching "@codecov/remix-vite-plugin",
"version": "0.0.1-beta.9",
},
"version": "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe("Generating remix stats", () => {
`test-remix-v${version}-client-${expected}`,
),
plugin: {
name: expect.stringMatching("@codecov/remix-plugin"),
name: expect.stringMatching("@codecov/remix-vite-plugin"),
},
assets: expect.arrayContaining([
{
Expand Down Expand Up @@ -108,7 +108,7 @@ describe("Generating remix stats", () => {
`test-remix-v${version}-server-${expected}`,
),
plugin: {
name: expect.stringMatching("@codecov/remix-plugin"),
name: expect.stringMatching("@codecov/remix-vite-plugin"),
},
assets: expect.arrayContaining([
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "viteV5";
import tsconfigPaths from "vite-tsconfig-paths";
import { codecovRemixPlugin } from "@codecov/remix-plugin";
import { codecovRemixVitePlugin } from "@codecov/remix-vite-plugin";

export default defineConfig({
plugins: [
Expand All @@ -13,7 +13,7 @@ export default defineConfig({
},
}),
tsconfigPaths(),
codecovRemixPlugin({
codecovRemixVitePlugin({
enableBundleAnalysis: true,
bundleName: "test-remix-v2",
uploadToken: "test-token",
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@codecov/bundler-plugin-core": "workspace:^",
"@codecov/nuxt-plugin": "workspace:^",
"@codecov/remix-plugin": "workspace:^",
"@codecov/remix-vite-plugin": "workspace:^",
"@codecov/rollup-plugin": "workspace:^",
"@codecov/sveltekit-plugin": "workspace:^",
"@codecov/vite-plugin": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/test-apps/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@codecov/remix-plugin": "workspace:^",
"@codecov/remix-vite-plugin": "workspace:^",
"@remix-run/dev": "^2.9.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
Using npm:

```bash
npm install @codecov/remix-plugin --save-dev
npm install @codecov/remix-vite-plugin --save-dev
```

Using yarn:

```bash
yarn add @codecov/remix-plugin --dev
yarn add @codecov/remix-vite-plugin --dev
```

Using pnpm:

```bash
pnpm add @codecov/remix-plugin --save-dev
pnpm add @codecov/remix-vite-plugin --save-dev
```

## Example
Expand All @@ -43,7 +43,7 @@ pnpm add @codecov/remix-plugin --save-dev
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { codecovRemixPlugin } from "@codecov/remix-plugin";
import { codecovRemixPlugin } from "@codecov/remix-vite-plugin";

export default defineConfig({
plugins: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@codecov/remix-plugin",
"name": "@codecov/remix-vite-plugin",
"version": "0.0.1-beta.9",
"description": "Official Codecov Remix plugin",
"author": "Codecov",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import { remixBundleAnalysisPlugin } from "./remix-bundle-analysis/remixBundleAnalysisPlugin";

const codecovRemixPluginFactory = createVitePlugin<Options, true>(
const codecovRemixVitePluginFactory = createVitePlugin<Options, true>(

Check warning on line 18 in packages/remix-vite-plugin/src/index.ts

View check run for this annotation

Codecov Notifications / codecov/patch

packages/remix-vite-plugin/src/index.ts#L18

Added line #L18 was not covered by tests
(userOptions, unpluginMetaContext) => {
if (checkNodeVersion(unpluginMetaContext)) {
return [];
Expand Down Expand Up @@ -50,27 +50,27 @@
*
* @example
* ```typescript
// vite.config.ts
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { codecovRemixPlugin } from "@codecov/remix-plugin";

export default defineConfig({
plugins: [
remix(),
tsconfigPaths()
// Put the Codecov SvelteKit plugin after all other plugins
codecovRemixPlugin({
enableBundleAnalysis: true,
bundleName: "example-remix-bundle",
uploadToken: process.env.CODECOV_TOKEN,
}),
],
* // vite.config.ts
* import { vitePlugin as remix } from "@remix-run/dev";
* import { defineConfig } from "vite";
* import tsconfigPaths from "vite-tsconfig-paths";
* import { codecovRemixVitePlugin } from "@codecov/remix-vite-plugin";
*
* export default defineConfig({
* plugins: [
* remix(),
* tsconfigPaths()
* // Put the Codecov SvelteKit plugin after all other plugins
* codecovRemixVitePlugin({
* enableBundleAnalysis: true,
* bundleName: "example-remix-bundle",
* uploadToken: process.env.CODECOV_TOKEN,
* }),
* ],

Check warning on line 69 in packages/remix-vite-plugin/src/index.ts

View check run for this annotation

Codecov Notifications / codecov/patch

packages/remix-vite-plugin/src/index.ts#L53-L69

Added lines #L53 - L69 were not covered by tests
* });
* ```
*
* @see {@link @codecov/bundler-plugin-core!Options | Options} for list of options.
*/
export const codecovRemixPlugin: (options: Options) => VitePlugin<any>[] =
codecovRemixPluginFactory;
export const codecovRemixVitePlugin: (options: Options) => VitePlugin<any>[] =
codecovRemixVitePluginFactory;

Check warning on line 76 in packages/remix-vite-plugin/src/index.ts

View check run for this annotation

Codecov Notifications / codecov/patch

packages/remix-vite-plugin/src/index.ts#L75-L76

Added lines #L75 - L76 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`remixBundleAnalysisPlugin > when called > returns a plugin object 1`] = `
{
"name": "@codecov/remix-plugin",
"name": "@codecov/remix-vite-plugin",
"pluginVersion": "0.0.1-beta.9",
"version": "1",
"vite": {
Expand Down
Loading
Loading