-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rari): use rari as default (#12322)
* feat(rari): use rari as default BREAKING CHANGE: rari is used by default use :legacy commands for yari
- Loading branch information
Showing
18 changed files
with
183 additions
and
617 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ cloud-function/**/*.js | |
filecheck/*.js | ||
mdn/content/ | ||
tool/*.js | ||
bins/*.mjs |
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
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
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,4 @@ | ||
server: yarn start:rari-server | ||
type-check: cd client && tsc --noEmit --watch | ||
web: yarn start:client | ||
ssr: yarn watch:ssr |
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,16 @@ | ||
#!/usr/bin/env node | ||
import { rariBin } from "@mdn/rari"; | ||
import { spawn } from "cross-spawn"; | ||
import { config } from "dotenv"; | ||
import path from "node:path"; | ||
import { cwd } from "node:process"; | ||
|
||
import { BUILD_OUT_ROOT } from "../libs/env/index.js"; | ||
|
||
config({ | ||
path: path.join(cwd(), process.env.ENV_FILE || ".env"), | ||
}); | ||
|
||
process.env.BUILD_OUT_ROOT = process.env.BUILD_OUT_ROOT || BUILD_OUT_ROOT; | ||
|
||
spawn(rariBin, ["build", ...process.argv.slice(2)], { stdio: "inherit" }); |
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,52 @@ | ||
#!/usr/bin/env node | ||
import { concurrently } from "concurrently"; | ||
import { rariBin } from "@mdn/rari"; | ||
import { filename } from "../server/filename.js"; | ||
import { config } from "dotenv"; | ||
import path from "node:path"; | ||
import { cwd } from "node:process"; | ||
|
||
config({ | ||
path: path.join(cwd(), process.env.ENV_FILE || ".env"), | ||
}); | ||
|
||
const { commands, result } = concurrently( | ||
[ | ||
{ | ||
command: `node ${filename}`, | ||
name: "server", | ||
env: { | ||
RARI: true, | ||
}, | ||
prefixColor: "red", | ||
}, | ||
{ | ||
command: `${rariBin} serve -vv`, | ||
name: "rari", | ||
prefixColor: "blue", | ||
env: { | ||
...process.env, | ||
}, | ||
}, | ||
], | ||
{ | ||
killOthers: ["failure", "success"], | ||
restartTries: 0, | ||
handleInput: true, | ||
inputStream: process.stdin, | ||
} | ||
); | ||
|
||
const stop = new Promise((resolve, reject) => { | ||
process.on("SIGINT", () => { | ||
commands.forEach((cmd) => cmd.kill()); // Terminate all concurrently-run processes | ||
reject(); | ||
}); | ||
result.finally(() => resolve(null)); | ||
}); | ||
try { | ||
await stop; | ||
console.log("All tasks completed successfully."); | ||
} catch { | ||
console.log("Killed ☠️"); | ||
} |
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,17 @@ | ||
#!/usr/bin/env node | ||
import { rariBin } from "@mdn/rari"; | ||
import { spawn } from "cross-spawn"; | ||
|
||
import { config } from "dotenv"; | ||
import path from "node:path"; | ||
import { cwd } from "node:process"; | ||
|
||
import { BUILD_OUT_ROOT } from "../libs/env/index.js"; | ||
|
||
config({ | ||
path: path.join(cwd(), process.env.ENV_FILE || ".env"), | ||
}); | ||
|
||
process.env.BUILD_OUT_ROOT = process.env.BUILD_OUT_ROOT || BUILD_OUT_ROOT; | ||
|
||
spawn(rariBin, ["content", ...process.argv.slice(2)], { stdio: "inherit" }); |
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
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
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.