-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #426 from AppQuality/develop
Update to vite and zendesk 8.76
- Loading branch information
Showing
128 changed files
with
4,722 additions
and
9,967 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import {addons} from '@storybook/addons'; | ||
import unguessTheme from './unguessTheme'; | ||
import { addons } from "@storybook/manager-api"; | ||
import unguessTheme from "./unguessTheme"; | ||
|
||
addons.setConfig({ | ||
theme: unguessTheme, | ||
}); | ||
theme: unguessTheme, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { readFileSync } from "fs"; | ||
import { loadEnv } from "vite"; | ||
|
||
export function setEnv(mode: string) { | ||
Object.assign( | ||
process.env, | ||
loadEnv(mode, ".", ["REACT_APP_", "NODE_ENV", "PUBLIC_URL"]) | ||
); | ||
process.env.NODE_ENV ||= mode; | ||
const { homepage } = JSON.parse(readFileSync("package.json", "utf-8")); | ||
process.env.PUBLIC_URL ||= homepage | ||
? `${ | ||
homepage.startsWith("http") || homepage.startsWith("/") | ||
? homepage | ||
: `/${homepage}` | ||
}`.replace(/\/$/, "") | ||
: ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { readFileSync } from "node:fs"; | ||
|
||
import { Plugin, createFilter, transformWithEsbuild } from "vite"; | ||
|
||
// In Create React App, SVGs can be imported directly as React components. This is achieved by svgr libraries. | ||
// https://create-react-app.dev/docs/adding-images-fonts-and-files/#adding-svgs | ||
export function svgrPlugin(): Plugin { | ||
const filter = createFilter("**/*.svg"); | ||
const postfixRE = /[?#].*$/s; | ||
|
||
return { | ||
name: "svgr-plugin", | ||
async transform(code, id) { | ||
if (filter(id)) { | ||
const { transform } = await import("@svgr/core"); | ||
const { default: jsx } = await import("@svgr/plugin-jsx"); | ||
|
||
const filePath = id.replace(postfixRE, ""); | ||
const svgCode = readFileSync(filePath, "utf8"); | ||
|
||
const componentCode = await transform(svgCode, undefined, { | ||
filePath, | ||
caller: { | ||
previousExport: code, | ||
defaultPlugins: [jsx], | ||
}, | ||
}); | ||
|
||
const res = await transformWithEsbuild(componentCode, id, { | ||
loader: "jsx", | ||
}); | ||
|
||
return { | ||
code: res.code, | ||
map: null, | ||
}; | ||
} | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.