-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into john/region
- Loading branch information
Showing
223 changed files
with
10,469 additions
and
2,881 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
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
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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
export default { | ||
async paths() { | ||
return [ | ||
{ params: { id: 'foo' }, content: `# Foo` }, | ||
{ params: { id: 'bar' }, content: `# Bar` } | ||
] | ||
import { defineRoutes } from 'vitepress' | ||
import paths from './paths' | ||
|
||
export default defineRoutes({ | ||
async paths(watchedFiles: string[]) { | ||
// console.log('watchedFiles', watchedFiles) | ||
return paths | ||
}, | ||
watch: ['**/data-loading/**/*.json'], | ||
async transformPageData(pageData) { | ||
// console.log('transformPageData', pageData.filePath) | ||
pageData.title += ' - transformed' | ||
} | ||
} | ||
}) |
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 @@ | ||
export default [ | ||
{ params: { id: 'foo' }, content: `# Foo` }, | ||
{ params: { id: 'bar' }, content: `# Bar` } | ||
] |
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,72 @@ | ||
import { ModuleGraph } from 'node/utils/moduleGraph' | ||
|
||
describe('node/utils/moduleGraph', () => { | ||
let graph: ModuleGraph | ||
|
||
beforeEach(() => { | ||
graph = new ModuleGraph() | ||
}) | ||
|
||
it('should correctly delete a module and its dependents', () => { | ||
graph.add('A', ['B', 'C']) | ||
graph.add('B', ['D']) | ||
graph.add('C', []) | ||
graph.add('D', []) | ||
|
||
expect(graph.delete('D')).toEqual(new Set(['D', 'B', 'A'])) | ||
}) | ||
|
||
it('should handle shared dependencies correctly', () => { | ||
graph.add('A', ['B', 'C']) | ||
graph.add('B', ['D']) | ||
graph.add('C', ['D']) // Shared dependency | ||
graph.add('D', []) | ||
|
||
expect(graph.delete('D')).toEqual(new Set(['A', 'B', 'C', 'D'])) | ||
}) | ||
|
||
it('merges dependencies correctly', () => { | ||
// Add module A with dependency B | ||
graph.add('A', ['B']) | ||
// Merge new dependency C into module A (B should remain) | ||
graph.add('A', ['C']) | ||
|
||
// Deleting B should remove A as well, since A depends on B. | ||
expect(graph.delete('B')).toEqual(new Set(['B', 'A'])) | ||
}) | ||
|
||
it('handles cycles gracefully', () => { | ||
// Create a cycle: A -> B, B -> C, C -> A. | ||
graph.add('A', ['B']) | ||
graph.add('B', ['C']) | ||
graph.add('C', ['A']) | ||
|
||
// Deleting any module in the cycle should delete all modules in the cycle. | ||
expect(graph.delete('A')).toEqual(new Set(['A', 'B', 'C'])) | ||
}) | ||
|
||
it('cleans up dependencies when deletion', () => { | ||
// Setup A -> B relationship. | ||
graph.add('A', ['B']) | ||
graph.add('B', []) | ||
|
||
// Deleting B should remove both B and A from the graph. | ||
expect(graph.delete('B')).toEqual(new Set(['B', 'A'])) | ||
|
||
// After deletion, add modules again. | ||
graph.add('C', []) | ||
graph.add('A', ['C']) // Now A depends only on C. | ||
|
||
expect(graph.delete('C')).toEqual(new Set(['C', 'A'])) | ||
}) | ||
|
||
it('handles independent modules', () => { | ||
// Modules with no dependencies. | ||
graph.add('X', []) | ||
graph.add('Y', []) | ||
|
||
// Deletion of one should only remove that module. | ||
expect(graph.delete('X')).toEqual(new Set(['X'])) | ||
expect(graph.delete('Y')).toEqual(new Set(['Y'])) | ||
}) | ||
}) |
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,8 @@ | ||
{ | ||
"plugins": { | ||
"postcss-rtlcss": { | ||
"ltrPrefix": ":where([dir=\"ltr\"])", | ||
"rtlPrefix": ":where([dir=\"rtl\"])" | ||
} | ||
} | ||
} |
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.