Add documentation for using Milkdown with various frameworks

- Created a new document for using components in Milkdown.
- Added a guide for using plugins in Milkdown, including toggling plugins programmatically and listing official plugins.
- Introduced a recipe for integrating Milkdown with Angular, including installation steps and component creation.
- Added a recipe for using Milkdown with Next.js, detailing installation and component setup.
- Created a guide for integrating Milkdown with NuxtJS, including installation and component creation.
- Added a comprehensive guide for using Milkdown with React, covering both Crepe and core Milkdown usage.
- Introduced a recipe for SolidJS integration with Milkdown, including installation and component creation.
- Added a guide for using Milkdown with Svelte, detailing installation and component setup.
- Created a comprehensive guide for integrating Milkdown with Vue, covering both Crepe and core Milkdown usage.
- Added a recipe for using Milkdown with Vue2, including installation and component creation.
This commit is contained in:
2026-01-17 14:18:08 +08:00
parent 4de3dfdd8d
commit d9ab341223
381 changed files with 125356 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { promises as fs } from 'fs';
import * as os from 'os';
import * as path from 'path';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import { runTests } from '@vscode/test-electron';
async function main() {
const tempdir = await fs.mkdtemp(os.tmpdir() + '/copilot-extension-test-');
let exitCode;
try {
// The folder containing the Extension Manifest package.json
// Passed to `--extensionDevelopmentPath`
const extensionDevelopmentPath = path.resolve(__dirname, '../..');
// The path to the extension test script (must be javascript)
// Passed to --extensionTestsPath
const extensionTestsPath = path.resolve(__dirname, './run');
const launchArgs = [];
// Disable other extensions while testing,
launchArgs.push('--disable-extensions');
// use a temporary folder so we can run multiple instances of the same VS Code together
// see https://github.com/microsoft/vscode/issues/137678
launchArgs.push('--user-data-dir', tempdir);
const argv = await yargs(hideBin(process.argv))
.options({
stable: {
type: 'boolean',
default: false,
},
grep: {
alias: 'g',
type: 'string',
default: '',
},
})
.parse();
const version = argv.stable ? 'stable' : 'insiders';
const extensionTestsEnv: typeof process.env = {};
// Pass arguments to mocha by environment variables
if (argv.grep) { extensionTestsEnv.MOCHA_GREP = argv.grep; }
if (argv._.length > 0) { extensionTestsEnv.MOCHA_FILES = argv._.join('\n'); }
if (!process.stdout.isTTY) { extensionTestsEnv.NO_COLOR = 'true'; }
const workspaceFolder = await fs.mkdtemp(path.join(os.tmpdir(), 'copilot-extension-test-'));
launchArgs.push(workspaceFolder);
extensionTestsEnv.CORETEST = 'true';
//@dbaeumer This can be removed as soon as we have the cache handle CORETEST
extensionTestsEnv.VITEST = 'true';
// Download VS Code, unzip it and run the integration test
exitCode = await runTests({
version,
extensionDevelopmentPath,
extensionTestsPath,
launchArgs,
extensionTestsEnv,
});
} catch (err) {
console.error('Failed to run tests', err);
exitCode = 1;
} finally {
await fs.rm(tempdir, { recursive: true });
}
process.exit(exitCode);
}
void main();