Skip to content
Draft
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 .github/semantic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ types:
- types
- wip
- release
- deps
- deps
30 changes: 12 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]
paths-ignore:
- "*.md"

pull_request:
branches: [main]
paths-ignore:
Expand All @@ -20,29 +20,23 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set node version to 17.x
uses: actions/setup-node@v3
with:
node-version: 17.x
uses: actions/checkout@v6
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the latest versions


- name: Cache pnpm modules
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think caching is needed

uses: actions/cache@v2
- name: Set node version to 20.x
uses: actions/setup-node@v6
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
node-version: 20

- uses: pnpm/action-setup@v2
with:
version: 6
- uses: pnpm/action-setup@v4

- name: Install deps
run: |
pnpm install
npx playwright install-deps chromium
pnpm --dir docs exec playwright install chromium

- name: Oxfmt
run: |
pnpm format:check

- name: Run tests
- name: Test
run: pnpm test
54 changes: 27 additions & 27 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: "CodeQL"

on:
schedule:
- cron: '39 18 * * 6'
- cron: "39 18 * * 6"

jobs:
analyze:
Expand All @@ -27,39 +27,39 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
language: ["javascript"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
21 changes: 21 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"sortPackageJson": false,
Comment on lines +3 to +4
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can enable singleQuote and trailingComma in the next PR.

"ignorePatterns": [
"node_modules",
"/coverage",
"/.next/",
"/out/",
"/build",
".DS_Store",
".env*",
".husky",
"npm-debug.log*",
"yarn-debug.log*",
"yarn-error.log*",
"/public",
".prettierignore",
"yarn.lock"
]
}
29 changes: 0 additions & 29 deletions .prettierignore

This file was deleted.

Empty file removed .prettierrc
Empty file.
2 changes: 1 addition & 1 deletion docs/components/MDXPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const Playground = ({
filename = "App.jsx";
} else {
throw new Error(
`Code block is missing a filename: ${props.children}`
`Code block is missing a filename: ${props.children}`,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not look like lint_staged formatted files correctly in the past

);
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/components/use-init-monaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const useInitMonaco = () => {
allTypes.map(([path, content]) => {
return monaco.languages.typescript.typescriptDefaults.addExtraLib(
content,
path
path,
);
});

Expand Down
2 changes: 1 addition & 1 deletion docs/lib/posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function getPostsData() {
id,
fileName,
};
})
}),
);
// Sort posts by date
return allPostsData;
Expand Down
6 changes: 3 additions & 3 deletions docs/lib/rehype-shiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const rehypeShiki = () => async (tree) => {
node.tagName === "pre" &&
node.children?.[0]?.tagName === "code" &&
node.children?.[0]?.properties?.className?.[0].startsWith(
"language-"
"language-",
) &&
node.children?.[0]?.children?.[0]?.type === "text"
)
Expand All @@ -26,7 +26,7 @@ export const rehypeShiki = () => async (tree) => {

const code = node.children[0].children[0].value;
const lang = node.children[0].properties.className[0].slice(
"language-".length
"language-".length,
);

parent.children.splice(
Expand All @@ -41,7 +41,7 @@ export const rehypeShiki = () => async (tree) => {
// @ts-expect-error ???
n.children[0].properties.className.push(theme);
return n;
})
}),
);
});
};
8 changes: 4 additions & 4 deletions docs/lib/remote-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const fs = require("fs");
const entryFilePattern = /^index\..*\.[tj]sx?/;
const demosBaseDir = path.resolve(
process.cwd(),
"./lib/remote-source-examples"
"./lib/remote-source-examples",
);
// const demosBaseDir = path.resolve(process.cwd(), './pages/demos');

Expand All @@ -30,7 +30,7 @@ async function getRemoteEntries(pathOrDir) {
paths.map(async (p) => {
const fullPath = path.join(pathOrDir, p);
return getRemoteEntries(fullPath);
})
}),
);
return results.flat();
}
Expand Down Expand Up @@ -60,15 +60,15 @@ async function getRemoteSourceFiles(entryDir) {
filenames.map(async (filename) => {
const content = await fsp.readFile(
path.join(demosBaseDir, entryDir, filename),
"utf8"
"utf8",
);
// Strip off page extension
const newFilename = filename.replace(".page", "");
return {
code: content,
filename: newFilename,
};
})
}),
);

return inputFiles;
Expand Down
10 changes: 5 additions & 5 deletions docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ module.exports = async () => {
publicLibDir,
`esbuild-wasm`,
esbuildWasmVersion,
`esbuild.wasm`
`esbuild.wasm`,
),
},
{
from: path.join(
path.dirname(require.resolve("monaco-editor/package.json")),
"min"
"min",
),
to: path.join(
publicLibDir,
`monaco-editor`,
monacoEditorVersion,
`min`
`min`,
),
},

Expand All @@ -85,7 +85,7 @@ module.exports = async () => {
to({ context, absoluteFilename }) {
return path.join(
publicTypesDir,
path.relative(context, absoluteFilename)
path.relative(context, absoluteFilename),
);
},
context: "node_modules/@types",
Expand All @@ -97,7 +97,7 @@ module.exports = async () => {
to: path.join(publicTypesDir, `demo-lib`),
},
],
})
}),
);
return config;
},
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/api/remote-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NextApiRequest, NextApiResponse } from "next";

export default async function handler(
req: NextApiRequest,
res: NextApiResponse
res: NextApiResponse,
) {
const { src } = req.query;
if (Array.isArray(src) || !src) {
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/remote-source.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function useRemoteSources(src?: string) {
}
const { files } = await res.json();
setFiles(files);
}
},
);
return () => {
cancelled = true;
Expand Down
4 changes: 4 additions & 0 deletions docs/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { PlaywrightTestConfig, devices } from "@playwright/test";
const config: PlaywrightTestConfig = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
timeout: 60_000,
expect: {
timeout: 30_000,
},
use: {
trace: "on-first-retry",
baseURL: "http://localhost:3000/",
Expand Down
8 changes: 4 additions & 4 deletions docs/posts/how-it-works.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ var __toESM = (module2, isNodeMode) => {
"default",
!isNodeMode && module2 && module2.__esModule
? { get: () => module2.default, enumerable: true }
: { value: module2, enumerable: true }
)
: { value: module2, enumerable: true },
),
),
module2
module2,
);
};
var __toCommonJS = /* @__PURE__ */ ((cache) => {
Expand Down Expand Up @@ -183,7 +183,7 @@ function Demo() {
return /* @__PURE__ */ React.createElement(
import_private_button_lib.Button,
null,
"Button"
"Button",
);
}
module.exports = __toCommonJS(App_exports);
Expand Down
Loading
Loading