-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Astro experiment #3503
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
Draft
DanielRosenwasser
wants to merge
8
commits into
v2
Choose a base branch
from
astro
base: v2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Astro experiment #3503
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1cf2ae9
Add `.astro` to `.gitignore`.
DanielRosenwasser 5e03f6c
[WIP] migrate to Astro
DanielRosenwasser e22b496
Fixed build.
DanielRosenwasser 088c2f0
Clean build
DanielRosenwasser 228b11e
Remove (hopefully?) unused gatsby-specific directory
DanielRosenwasser 2b2342a
Update paths.
DanielRosenwasser 4e9c872
Fixed landing page code sample styles hopefully.
DanielRosenwasser 08edab8
Fix more stuff.
DanielRosenwasser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,55 @@ | ||
| import { defineConfig } from 'astro/config'; | ||
| import react from '@astrojs/react'; | ||
| import sitemap from '@astrojs/sitemap'; | ||
| import { DOMParser } from 'xmldom'; | ||
|
|
||
| // Polyfill DOMParser for SSR so react-intl can format rich text messages | ||
| // (equivalent to the old gatsby-ssr.js polyfill) | ||
| globalThis.DOMParser = DOMParser; | ||
|
|
||
| export default defineConfig({ | ||
| site: 'https://www.typescriptlang.org', | ||
| integrations: [ | ||
| react(), | ||
| sitemap({ | ||
| filter: (page) => | ||
| !page.includes('/glossary') && !page.includes('/vo/'), | ||
| }), | ||
| ], | ||
| build: { | ||
| format: 'file', | ||
| }, | ||
| trailingSlash: 'ignore', | ||
| redirects: { | ||
| '/Tutorial': '/docs', | ||
| '/Handbook': '/docs', | ||
| '/samples': '/docs', | ||
| '/docs/home.html': '/docs', | ||
| '/playground': '/play/', | ||
| '/docs/home': '/docs', | ||
| '/docs/handbook/writing-declaration-files': '/docs/handbook/declaration-files/introduction.html', | ||
| '/docs/handbook/writing-declaration-files.html': '/docs/handbook/declaration-files/introduction.html', | ||
| '/docs/handbook/writing-definition-files': '/docs/handbook/declaration-files/introduction.html', | ||
| '/docs/handbook/typings-for-npm-packages': '/docs/handbook/declaration-files/publishing.html', | ||
| '/docs/tutorial.html': '/docs/', | ||
| '/docs/handbook/release-notes': '/docs/', | ||
| '/docs/handbook/release-notes/overview': '/docs/', | ||
| '/docs/handbook/release-notes/overview.html': '/docs', | ||
| '/docs/handbook/react-&-webpack.html': 'https://webpack.js.org/guides/typescript/', | ||
| '/docs/bootstrap': '/docs/', | ||
| '/docs/handbook/esm-node': '/docs/handbook/modules/reference.html#node16-node18-node20-nodenext', | ||
| '/docs/handbook/esm-node.html': '/docs/handbook/modules/reference.html#node16-node18-node20-nodenext', | ||
| '/docs/handbook/modules': '/docs/handbook/modules/introduction.html', | ||
| '/docs/handbook/modules.html': '/docs/handbook/modules/introduction.html', | ||
| '/docs/handbook/module-resolution': '/docs/handbook/modules/theory.html#module-resolution', | ||
| '/docs/handbook/module-resolution.html': '/docs/handbook/modules/theory.html#module-resolution', | ||
| }, | ||
| vite: { | ||
| resolve: { | ||
| dedupe: ['react', 'react-dom'], | ||
| }, | ||
| ssr: { | ||
| noExternal: ['react-intl', 'intl-format-cache', 'intl-messageformat', 'intl-messageformat-parser', '@formatjs/intl-utils'], | ||
| }, | ||
| }, | ||
| }); |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
57 changes: 0 additions & 57 deletions
57
packages/typescriptlang-org/lib/bootup/ingestion/createGlossaryPages.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Shell command built from environment values Medium
Copilot Autofix
AI 2 days ago
In general, the fix is to avoid passing dynamically constructed command strings through a shell. Instead, call the underlying program directly and pass any dynamic values (like paths) as separate arguments, or better, use Node’s own filesystem operations when possible.
For this specific case, the best fix without changing observable functionality is to replace the
execSync("mkdir -p ...")invocation with code that creates the directory using Node APIs. Sincemkdir -p’s behavior is “create this directory and any missing parents, and don’t error if it already exists,” the direct analogue isfs.mkdirSync(outDir, { recursive: true }), or, sincefs-extrais already imported asfse,fse.ensureDirSync(outDir). Usingfs-extrakeeps the code consistent with the rest of the file.Concretely:
packages/playground-examples/scripts/copyFiles.js, on line 12, replaceif (!existsSync(outDir)) execSync(\mkdir -p ${outDir}`);with a call tofse.ensureDirSync(outDir);`.fseis already required fromfs-extra.