Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai committed Sep 14, 2023
1 parent 97d2f17 commit 02d2dea
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 66 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/utils/modify-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export async function modifyConfigFile(detectedBuildTool: BuildTool) {
*/
if (detectedModuleType === 'cjs') {
// 1.
const importStatement = `const million = require('million/compiler')\n`;
const importStatement = `const million = require('million/compiler');\n`;
configFileContent = importStatement + configFileContent;

// 2.
Expand Down Expand Up @@ -59,7 +59,7 @@ export async function modifyConfigFile(detectedBuildTool: BuildTool) {
}
} else if (detectedModuleType === 'esm') {
// 1.
const importStatement = `import million from 'million/compiler'\n`;
const importStatement = `import million from 'million/compiler';\n`;
configFileContent = importStatement + configFileContent;

// 2.
Expand Down Expand Up @@ -226,6 +226,6 @@ async function handleNextCase(oldExportExpression: string): Promise<string> {
return `million.next(
${oldExportExpression}, { auto: ${
nextRouter === 'app' ? '{ rsc: true }' : 'true'
}}
} }
)`;
}
41 changes: 41 additions & 0 deletions packages/kitchen-sink/src/examples/repro.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { block } from 'million/react';

const AUTO_ARCHIVE_OPTIONS = [
3 * 86400, // 3 days
7 * 86400, // 7 days
14 * 86400, // 2 weeks
28 * 86400, // 4 weeks
90 * 86400, // 3 months
365 * 86400, // 1 year
];

const ArchiveAllPrefGroup = block(() => {
const onChange = () => {};
return (
<div className="prefs-group">
<div className="label-wrapper">
<label>
<div>
<div>
Auto archive
<select onChange={onChange}>
<option value="all">all</option>
<option value="unread">unread</option>
</select>
threads older than
</div>
<select onChange={onChange}>
{AUTO_ARCHIVE_OPTIONS.map((seconds) => (
<option key={seconds} value={String(seconds)}>
{String(seconds * 1000)}
</option>
))}
</select>
</div>
</label>
</div>
</div>
);
});

export default ArchiveAllPrefGroup;
69 changes: 7 additions & 62 deletions pnpm-lock.yaml

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

5 changes: 4 additions & 1 deletion website/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import million from 'million/compiler'
import nextra from 'nextra';

const withNextra = nextra({
Expand All @@ -14,4 +15,6 @@ const nextConfig = {
};

// eslint-disable-next-line import/no-default-export
export default withNextra(nextConfig);
export default million.next(
withNextra(nextConfig), { auto: true}
);

2 comments on commit 02d2dea

@vercel
Copy link

@vercel vercel bot commented on 02d2dea Sep 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

million-kitchen-sink – ./packages/kitchen-sink

million-kitchen-sink.vercel.app
million-kitchen-sink-git-main-millionjs.vercel.app
million-kitchen-sink-millionjs.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 02d2dea Sep 14, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

sink – ./packages/kitchen-sink

million-kitchen-sink-atit.vercel.app
sink-git-main-millionjs.vercel.app
sink.million.dev
sink-millionjs.vercel.app

Please sign in to comment.