Skip to content

Commit 4ea0699

Browse files
committed
Merge branch 'main' of github.com:codedex-io/projects
2 parents e2c6eba + 1191136 commit 4ea0699

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
run: cd publish && npm install
2222
- name: publish
2323
run: npm run publish
24-
2524
env:
25+
NODE_ENV: production
2626
CLIENT_ID: ${{ secrets.CLIENT_ID }}
2727
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
2828
CLIENT_EMAIL: ${{ secrets.CLIENT_EMAIL }}

publish/src/domain/mdx-processor.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ export class MDXProcessor {
120120
try {
121121
const { data, content: rawContent } = matter(content);
122122

123+
// next-mdx-remote ignores mdxOptions.development and uses process.env.NODE_ENV.
124+
// Force production so compiled output uses jsx/jsxs (not jsxDEV) and works on the site.
125+
const prevNodeEnv = process.env.NODE_ENV;
126+
process.env.NODE_ENV = "production";
127+
123128
const source = await serialize(rawContent, {
124129
mdxOptions: {
125130
remarkPlugins: this.remarkPlugins as any,
@@ -129,6 +134,8 @@ export class MDXProcessor {
129134
blockJS: false,
130135
});
131136

137+
process.env.NODE_ENV = prevNodeEnv;
138+
132139
return {
133140
frontmatter: data as ProjectFrontmatter,
134141
source,

publish/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ProjectPublisher } from "./domain/project-publisher.js";
77

88
async function main() {
99
console.log("🚀 Starting Codédex Projects Publisher\n");
10+
console.log("NODE_ENV:", process.env.NODE_ENV ?? "(undefined)");
1011

1112
try {
1213
// Validate configuration

0 commit comments

Comments
 (0)