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(app,docs): latest version caching issue #113

Merged
merged 2 commits into from
Feb 25, 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 apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"prepare": "panda codegen"
},
"dependencies": {
"@flows/js": "0.0.38",
"@flows/js": "0.0.39",
"@marsidev/react-turnstile": "^0.5.2",
"@monaco-editor/react": "^4.6.0",
"@radix-ui/react-slot": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Props = {
};

const CDNSnippet: FC<Props> = async ({ projectId }) => {
const latestPackageJson = await fetch("https://cdn.jsdelivr.net/npm/@flows/js/package.json").then(
const latestPackageJson = await fetch("https://www.unpkg.com/@flows/js@latest/package.json").then(
(res) => res.json() as Promise<{ version?: string } | undefined>,
);
const latestVersion = latestPackageJson?.version;
Expand All @@ -35,7 +35,7 @@ const CDNSnippet: FC<Props> = async ({ projectId }) => {
<CodeHighlight className={css({ margin: "0!", width: "100%" })}>
<pre>
<code className="index.html">{`<script>
window.FlowsJS.init({
FlowsJS.init({
projectId: "${projectId}",
// Optionally define local flows.
flows: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const TemplatePreview: FC = () => {
useEffect(() => {
if (firstRender) return;
void init({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- internal option
// @ts-expect-error
validate: false,
rootElement: "#template-preview-root",
flows: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export const StepsPreview: FC<Props> = ({ steps }) => {
useEffect(() => {
if (!steps) return;
void init({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- internal option
// @ts-expect-error
validate: false,
flows: [{ id: "flow", steps: prepareSteps(steps) }],
rootElement: "#preview-root",
}).then(() => {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"prepare": "panda codegen"
},
"dependencies": {
"@flows/js": "0.0.38",
"@flows/js": "0.0.39",
"next": "14.1.0",
"next-sitemap": "^4.2.3",
"nextra": "^2.13.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/getting-started/install-flows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useData } from "nextra/data";
import { Tabs, Pre, Code } from "nextra/components";

export const getServerSideProps = () => {
return fetch("https://cdn.jsdelivr.net/npm/@flows/js/package.json")
return fetch("https://www.unpkg.com/@flows/js@latest/package.json")
.then((res) => res.json())
.then((pkgJson) => ({
props: {
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.