mirror of
https://github.com/microsoft/monaco-editor.git
synced 2024-11-25 16:35:44 +08:00
Restructures out and release folders.
out/amd -> out/languages/amd-tsc out/release -> out/languages/bundled release -> out/monaco-editor
This commit is contained in:
parent
fb0d6bada1
commit
5ccfdf7c02
@ -42,7 +42,7 @@ extends:
|
|||||||
publishRequiresApproval: false
|
publishRequiresApproval: false
|
||||||
|
|
||||||
- name: monaco-editor
|
- name: monaco-editor
|
||||||
workingDirectory: $(Build.SourcesDirectory)/release
|
workingDirectory: $(Build.SourcesDirectory)/out/monaco-editor
|
||||||
testPlatforms: []
|
testPlatforms: []
|
||||||
buildSteps:
|
buildSteps:
|
||||||
- script: npm ci
|
- script: npm ci
|
||||||
|
@ -44,7 +44,7 @@ extends:
|
|||||||
publishRequiresApproval: false
|
publishRequiresApproval: false
|
||||||
|
|
||||||
- name: monaco-editor
|
- name: monaco-editor
|
||||||
workingDirectory: $(Build.SourcesDirectory)/release
|
workingDirectory: $(Build.SourcesDirectory)/out/monaco-editor
|
||||||
testPlatforms: []
|
testPlatforms: []
|
||||||
buildSteps:
|
buildSteps:
|
||||||
- script: npm ci
|
- script: npm ci
|
||||||
|
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
|||||||
run: npm run prettier-check
|
run: npm run prettier-check
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run release
|
run: npm run build-monaco-editor
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: npm test
|
run: npm test
|
||||||
|
2
.github/workflows/website.yml
vendored
2
.github/workflows/website.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
|||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run release
|
run: npm run build-monaco-editor
|
||||||
|
|
||||||
- name: Install website node modules
|
- name: Install website node modules
|
||||||
working-directory: website
|
working-directory: website
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,9 +1,8 @@
|
|||||||
**/node_modules/
|
**/node_modules/
|
||||||
**/out/
|
|
||||||
**/release/
|
|
||||||
**/dependencies/
|
**/dependencies/
|
||||||
/test/manual/generated/**
|
/test/manual/generated/**
|
||||||
/test/smoke/vite/dist/**
|
/test/smoke/vite/dist/**
|
||||||
/test/smoke/parcel/dist/**
|
/test/smoke/parcel/dist/**
|
||||||
/test/smoke/parcel/.cache/**
|
/test/smoke/parcel/.cache/**
|
||||||
**/dist/
|
**/dist/
|
||||||
|
**/out/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
**/node_modules/
|
**/node_modules/
|
||||||
|
**/dist/
|
||||||
**/out/
|
**/out/
|
||||||
**/release/
|
|
||||||
/samples/browser-esm-parcel/.parcel-cache/
|
/samples/browser-esm-parcel/.parcel-cache/
|
||||||
/samples/browser-esm-parcel/dist/
|
/samples/browser-esm-parcel/dist/
|
||||||
/samples/browser-esm-vite-react/dist/**/*.js
|
/samples/browser-esm-vite-react/dist/**/*.js
|
||||||
|
22
.vscode/launch.json
vendored
22
.vscode/launch.json
vendored
@ -8,7 +8,7 @@
|
|||||||
"name": "Monaco Editor Playground",
|
"name": "Monaco Editor Playground",
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"url": "https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fout%2Famd",
|
"url": "https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fdist%2Flanguages%2Famd-tsc",
|
||||||
"preLaunchTask": "Launch Http Server",
|
"preLaunchTask": "Launch Http Server",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"group": "monaco",
|
"group": "monaco",
|
||||||
@ -22,7 +22,7 @@
|
|||||||
"name": "Monaco Editor Playground (Load From VS Code Http Server)",
|
"name": "Monaco Editor Playground (Load From VS Code Http Server)",
|
||||||
"type": "chrome",
|
"type": "chrome",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"url": "https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fout%2Famd&source=http%3A%2F%2Flocalhost%3A5001%2Fout%2Fvs",
|
"url": "https://microsoft.github.io/monaco-editor/playground.html?sourceLanguages=http%3A%2F%2Flocalhost%3A5002%2Fdist%2Flanguages%2Famd-tsc&source=http%3A%2F%2Flocalhost%3A5001%2Fout%2Fvs",
|
||||||
"preLaunchTask": "Launch Http Server",
|
"preLaunchTask": "Launch Http Server",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"group": "monaco",
|
"group": "monaco",
|
||||||
@ -38,24 +38,6 @@
|
|||||||
"args": ["-r", "test/unit/all.js"],
|
"args": ["-r", "test/unit/all.js"],
|
||||||
"outFiles": ["${workspaceFolder}/**/*.js"]
|
"outFiles": ["${workspaceFolder}/**/*.js"]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "release",
|
|
||||||
"skipFiles": ["<node_internals>/**"],
|
|
||||||
"program": "${workspaceFolder}/build/release.js",
|
|
||||||
"args": [],
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "website",
|
|
||||||
"skipFiles": ["<node_internals>/**"],
|
|
||||||
"program": "${workspaceFolder}/build/website.js",
|
|
||||||
"args": [],
|
|
||||||
"cwd": "${workspaceFolder}"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -6,7 +6,7 @@
|
|||||||
"files.trimTrailingWhitespace": true,
|
"files.trimTrailingWhitespace": true,
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"**/node_modules": true,
|
"**/node_modules": true,
|
||||||
"**/release": true,
|
"**/dist": true,
|
||||||
"**/out": true
|
"**/out": true
|
||||||
},
|
},
|
||||||
"typescript.tsdk": "./node_modules/typescript/lib",
|
"typescript.tsdk": "./node_modules/typescript/lib",
|
||||||
|
@ -27,77 +27,30 @@ import './{myLang}/{myLang}.contribution';
|
|||||||
|
|
||||||
## Debugging / Developing The Core Editor
|
## Debugging / Developing The Core Editor
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
## Debugging / Developing Language Support
|
## Debugging / Developing Language Support
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
## Running the editor from source
|
## Running the editor from source
|
||||||
|
|
||||||
You need to have all the build setup of VS Code to be able to build the Monaco Editor.
|
TODO
|
||||||
|
|
||||||
- Install all the [prerequisites](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# clone vscode-loc repository for localized string resources
|
|
||||||
/src> git clone https://github.com/microsoft/vscode-loc
|
|
||||||
# clone VS Code repository
|
|
||||||
/src> git clone https://github.com/microsoft/vscode
|
|
||||||
/src> cd vscode
|
|
||||||
# install npm deps for vscode
|
|
||||||
/src/vscode> yarn
|
|
||||||
# start the compiler in the background
|
|
||||||
/src/vscode> yarn watch
|
|
||||||
```
|
|
||||||
|
|
||||||
- For the monaco editor test pages:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# clone monaco-editor (note the folders must be siblings!)
|
|
||||||
/src> git clone https://github.com/microsoft/monaco-editor
|
|
||||||
|
|
||||||
# install npm deps for monaco-editor
|
|
||||||
/src/monaco-editor> npm install .
|
|
||||||
|
|
||||||
# compile and bundle all plugins
|
|
||||||
/src/monaco-editor> npm run release
|
|
||||||
|
|
||||||
# start a local http server in the background
|
|
||||||
/src/monaco-editor> npm run simpleserver
|
|
||||||
```
|
|
||||||
|
|
||||||
Open [http://localhost:8080/monaco-editor/test/manual/?editor=src](http://localhost:8080/monaco-editor/test/manual/?editor=src) to run.
|
|
||||||
|
|
||||||
## Running the editor tests
|
## Running the editor tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# create a local release
|
> npm run build-monaco-editor
|
||||||
/src/monaco-editor> npm run release
|
> npm run test
|
||||||
|
> npm run compile --prefix webpack-plugin
|
||||||
|
|
||||||
# run unit tests
|
> npm run package-for-smoketest-webpack
|
||||||
/src/monaco-editor> npm run test
|
> npm run package-for-smoketest-esbuild
|
||||||
|
> npm run package-for-smoketest-vite
|
||||||
# compile the webpack plugin
|
> npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
||||||
/src/monaco-editor> npm run compile --prefix webpack-plugin
|
> npm run smoketest-debug
|
||||||
|
|
||||||
# package using the webpack plugin
|
|
||||||
/src/monaco-editor> npm run package-for-smoketest-webpack
|
|
||||||
|
|
||||||
# package using esbuild
|
|
||||||
/src/monaco-editor> npm run package-for-smoketest-esbuild
|
|
||||||
|
|
||||||
# package using vite
|
|
||||||
/src/monaco-editor> npm run package-for-smoketest-vite
|
|
||||||
|
|
||||||
# package using parcel
|
|
||||||
/src/monaco-editor> npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
|
||||||
|
|
||||||
# run the smoketest
|
|
||||||
/src/monaco-editor> npm run smoketest-debug
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> Tip: All folders must be cloned as siblings.
|
|
||||||
|
|
||||||
> Tip: When running the test pages, use the control panel in the top right corner to switch between running from source, running from npm or running from the local release:
|
|
||||||
> ![image](https://cloud.githubusercontent.com/assets/5047891/19599080/eb0d7622-979e-11e6-96ce-dde98cd95dc1.png)
|
|
||||||
|
|
||||||
## Running the website locally
|
## Running the website locally
|
||||||
|
|
||||||
TOD
|
TOD
|
||||||
|
@ -4,33 +4,33 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import glob from 'glob';
|
import glob from 'glob';
|
||||||
import { tsc, dts, buildESM, buildAMD } from './utils';
|
import { runTsc, massageAndCopyDts, buildESM, buildAMD } from './utils';
|
||||||
import { copyFile, removeDir } from './fs';
|
import { copyFile, removeDir } from './fs';
|
||||||
|
|
||||||
removeDir(`out`);
|
removeDir(`out/languages`);
|
||||||
|
|
||||||
tsc(`src/tsconfig.json`);
|
runTsc(`src/tsconfig.json`);
|
||||||
|
|
||||||
//#region Type Defintion
|
//#region Type Defintion
|
||||||
|
|
||||||
dts(
|
massageAndCopyDts(
|
||||||
`out/amd/language/css/monaco.contribution.d.ts`,
|
`out/languages/amd-tsc/language/css/monaco.contribution.d.ts`,
|
||||||
`out/release/css.d.ts`,
|
`out/languages/bundled/css.d.ts`,
|
||||||
'monaco.languages.css'
|
'monaco.languages.css'
|
||||||
);
|
);
|
||||||
dts(
|
massageAndCopyDts(
|
||||||
`out/amd/language/html/monaco.contribution.d.ts`,
|
`out/languages/amd-tsc/language/html/monaco.contribution.d.ts`,
|
||||||
`out/release/html.d.ts`,
|
`out/languages/bundled/html.d.ts`,
|
||||||
'monaco.languages.html'
|
'monaco.languages.html'
|
||||||
);
|
);
|
||||||
dts(
|
massageAndCopyDts(
|
||||||
`out/amd/language/json/monaco.contribution.d.ts`,
|
`out/languages/amd-tsc/language/json/monaco.contribution.d.ts`,
|
||||||
`out/release/json.d.ts`,
|
`out/languages/bundled/json.d.ts`,
|
||||||
'monaco.languages.json'
|
'monaco.languages.json'
|
||||||
);
|
);
|
||||||
dts(
|
massageAndCopyDts(
|
||||||
`out/amd/language/typescript/monaco.contribution.d.ts`,
|
`out/languages/amd-tsc/language/typescript/monaco.contribution.d.ts`,
|
||||||
`out/release/typescript.d.ts`,
|
`out/languages/bundled/typescript.d.ts`,
|
||||||
'monaco.languages.typescript'
|
'monaco.languages.typescript'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ buildAMD({
|
|||||||
|
|
||||||
copyFile(
|
copyFile(
|
||||||
`src/language/typescript/lib/typescriptServices-amd.js`,
|
`src/language/typescript/lib/typescriptServices-amd.js`,
|
||||||
`out/amd/language/typescript/lib/typescriptServices.js`
|
`out/languages/amd-tsc/language/typescript/lib/typescriptServices.js`
|
||||||
);
|
);
|
||||||
|
|
||||||
buildESM({
|
buildESM({
|
@ -10,7 +10,7 @@ import { removeDir } from '../build/fs';
|
|||||||
import ts = require('typescript');
|
import ts = require('typescript');
|
||||||
import { generateMetadata } from './releaseMetadata';
|
import { generateMetadata } from './releaseMetadata';
|
||||||
|
|
||||||
removeDir(`release`);
|
removeDir(`out/monaco-editor`);
|
||||||
|
|
||||||
// dev folder
|
// dev folder
|
||||||
AMD_releaseOne('dev');
|
AMD_releaseOne('dev');
|
||||||
@ -39,7 +39,7 @@ generateMetadata();
|
|||||||
delete json.scripts['postinstall'];
|
delete json.scripts['postinstall'];
|
||||||
|
|
||||||
packageJSON.contents = Buffer.from(JSON.stringify(json, null, ' '));
|
packageJSON.contents = Buffer.from(JSON.stringify(json, null, ' '));
|
||||||
writeFiles([packageJSON], `release`);
|
writeFiles([packageJSON], `out/monaco-editor`);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
@ -59,7 +59,7 @@ generateMetadata();
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
writeFiles(otherFiles, `release`);
|
writeFiles(otherFiles, `out/monaco-editor`);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,13 +70,13 @@ function AMD_releaseOne(type: 'dev' | 'min') {
|
|||||||
base: `node_modules/monaco-editor-core/${type}`
|
base: `node_modules/monaco-editor-core/${type}`
|
||||||
});
|
});
|
||||||
AMD_addPluginContribs(type, coreFiles);
|
AMD_addPluginContribs(type, coreFiles);
|
||||||
writeFiles(coreFiles, `release/${type}`);
|
writeFiles(coreFiles, `out/monaco-editor/${type}`);
|
||||||
|
|
||||||
const pluginFiles = readFiles(`out/release/${type}/**/*`, {
|
const pluginFiles = readFiles(`out/languages/bundled/amd-${type}/**/*`, {
|
||||||
base: `out/release/${type}`,
|
base: `out/languages/bundled/amd-${type}`,
|
||||||
ignore: ['**/monaco.contribution.js']
|
ignore: ['**/monaco.contribution.js']
|
||||||
});
|
});
|
||||||
writeFiles(pluginFiles, `release/${type}`);
|
writeFiles(pluginFiles, `out/monaco-editor/${type}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -96,8 +96,8 @@ function AMD_addPluginContribs(type: 'dev' | 'min', files: IFile[]) {
|
|||||||
// Rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
|
// Rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
|
||||||
contents = contents.replace(/"vs\/editor\/editor\.main\"/, '"vs/editor/edcore.main"');
|
contents = contents.replace(/"vs\/editor\/editor\.main\"/, '"vs/editor/edcore.main"');
|
||||||
|
|
||||||
const pluginFiles = readFiles(`out/release/${type}/**/monaco.contribution.js`, {
|
const pluginFiles = readFiles(`out/languages/bundled/amd-${type}/**/monaco.contribution.js`, {
|
||||||
base: `out/release/${type}`
|
base: `out/languages/bundled/amd-${type}`
|
||||||
});
|
});
|
||||||
|
|
||||||
const extraContent = pluginFiles.map((file) => {
|
const extraContent = pluginFiles.map((file) => {
|
||||||
@ -141,7 +141,7 @@ function ESM_release() {
|
|||||||
});
|
});
|
||||||
ESM_addImportSuffix(coreFiles);
|
ESM_addImportSuffix(coreFiles);
|
||||||
ESM_addPluginContribs(coreFiles);
|
ESM_addPluginContribs(coreFiles);
|
||||||
writeFiles(coreFiles, `release/esm`);
|
writeFiles(coreFiles, `out/monaco-editor/esm`);
|
||||||
|
|
||||||
ESM_releasePlugins();
|
ESM_releasePlugins();
|
||||||
}
|
}
|
||||||
@ -152,7 +152,7 @@ function ESM_release() {
|
|||||||
* Rewrites imports for 'monaco-editor-core/**'
|
* Rewrites imports for 'monaco-editor-core/**'
|
||||||
*/
|
*/
|
||||||
function ESM_releasePlugins() {
|
function ESM_releasePlugins() {
|
||||||
const files = readFiles(`out/release/esm/**/*`, { base: 'out/release/esm/' });
|
const files = readFiles(`out/languages/bundled/esm/**/*`, { base: 'out/languages/bundled/esm/' });
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
if (!/(\.js$)|(\.ts$)/.test(file.path)) {
|
if (!/(\.js$)|(\.ts$)/.test(file.path)) {
|
||||||
@ -210,7 +210,7 @@ function ESM_releasePlugins() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ESM_addImportSuffix(files);
|
ESM_addImportSuffix(files);
|
||||||
writeFiles(files, `release/esm`);
|
writeFiles(files, `out/monaco-editor/esm`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -256,8 +256,8 @@ function ESM_addPluginContribs(files: IFile[]) {
|
|||||||
|
|
||||||
const mainFileDestPath = 'vs/editor/editor.main.js';
|
const mainFileDestPath = 'vs/editor/editor.main.js';
|
||||||
|
|
||||||
const mainFileImports = readFiles(`out/release/esm/**/monaco.contribution.js`, {
|
const mainFileImports = readFiles(`out/languages/bundled/esm/**/monaco.contribution.js`, {
|
||||||
base: `out/release/esm`
|
base: `out/languages/bundled/esm`
|
||||||
}).map((file) => {
|
}).map((file) => {
|
||||||
let relativePath = path
|
let relativePath = path
|
||||||
.relative(path.dirname(mainFileDestPath), file.path)
|
.relative(path.dirname(mainFileDestPath), file.path)
|
||||||
@ -292,8 +292,8 @@ function releaseDTS() {
|
|||||||
|
|
||||||
let contents = monacodts.contents.toString();
|
let contents = monacodts.contents.toString();
|
||||||
|
|
||||||
const extraContent = readFiles('out/release/*.d.ts', {
|
const extraContent = readFiles('out/languages/bundled/*.d.ts', {
|
||||||
base: 'out/release/'
|
base: 'out/languages/bundled/'
|
||||||
}).map((file) => {
|
}).map((file) => {
|
||||||
return file.contents.toString().replace(/\/\/\/ <reference.*\n/m, '');
|
return file.contents.toString().replace(/\/\/\/ <reference.*\n/m, '');
|
||||||
});
|
});
|
||||||
@ -321,7 +321,7 @@ function releaseDTS() {
|
|||||||
contents: Buffer.from(toExternalDTS(contents))
|
contents: Buffer.from(toExternalDTS(contents))
|
||||||
};
|
};
|
||||||
|
|
||||||
writeFiles([monacodts, editorapidts], `release`);
|
writeFiles([monacodts, editorapidts], `out/monaco-editor`);
|
||||||
|
|
||||||
// fs.writeFileSync('website/typedoc/monaco.d.ts', contents);
|
// fs.writeFileSync('website/typedoc/monaco.d.ts', contents);
|
||||||
}
|
}
|
||||||
@ -422,5 +422,5 @@ function releaseThirdPartyNotices() {
|
|||||||
contents += '\n' + thirdPartyNoticeContent;
|
contents += '\n' + thirdPartyNoticeContent;
|
||||||
tpn.contents = Buffer.from(contents);
|
tpn.contents = Buffer.from(contents);
|
||||||
|
|
||||||
writeFiles([tpn], `release`);
|
writeFiles([tpn], `out/monaco-editor`);
|
||||||
}
|
}
|
@ -37,7 +37,7 @@ export const typescriptVersion = "${typeScriptDependencyVersion}";\n`
|
|||||||
|
|
||||||
let tsServices = fs.readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescript.js')).toString();
|
let tsServices = fs.readFileSync(path.join(TYPESCRIPT_LIB_SOURCE, 'typescript.js')).toString();
|
||||||
|
|
||||||
// The output from this build will only be accessible via AMD or ESM; rather than removing
|
// The output from this build will only be accessible via ESM; rather than removing
|
||||||
// references to require/module, define them as dummy variables that bundlers will ignore.
|
// references to require/module, define them as dummy variables that bundlers will ignore.
|
||||||
// The TS code can figure out that it's not running under Node even with these defined.
|
// The TS code can figure out that it's not running under Node even with these defined.
|
||||||
tsServices =
|
tsServices =
|
||||||
@ -48,21 +48,6 @@ var module = { exports: {} };
|
|||||||
/* END MONACOCHANGE */
|
/* END MONACOCHANGE */
|
||||||
` + tsServices;
|
` + tsServices;
|
||||||
|
|
||||||
const tsServices_amd =
|
|
||||||
generatedNote +
|
|
||||||
tsServices +
|
|
||||||
`
|
|
||||||
// MONACOCHANGE
|
|
||||||
// Defining the entire module name because r.js has an issue and cannot bundle this file
|
|
||||||
// correctly with an anonymous define call
|
|
||||||
define("vs/language/typescript/lib/typescriptServices", [], function() { return ts; });
|
|
||||||
// END MONACOCHANGE
|
|
||||||
`;
|
|
||||||
fs.writeFileSync(
|
|
||||||
path.join(TYPESCRIPT_LIB_DESTINATION, 'typescriptServices-amd.js'),
|
|
||||||
stripSourceMaps(tsServices_amd)
|
|
||||||
);
|
|
||||||
|
|
||||||
const tsServices_esm =
|
const tsServices_esm =
|
||||||
generatedNote +
|
generatedNote +
|
||||||
tsServices +
|
tsServices +
|
||||||
|
@ -12,7 +12,7 @@ import { REPO_ROOT } from '../utils';
|
|||||||
|
|
||||||
const files = glob.sync('**/package.json', {
|
const files = glob.sync('**/package.json', {
|
||||||
cwd: REPO_ROOT,
|
cwd: REPO_ROOT,
|
||||||
ignore: ['**/node_modules/**', '**/out/**', '**/release/**']
|
ignore: ['**/node_modules/**', '**/dist/**', '**/out/**']
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
|
@ -10,7 +10,7 @@ import { REPO_ROOT } from '../utils';
|
|||||||
|
|
||||||
const files = glob.sync('**/package-lock.json', {
|
const files = glob.sync('**/package-lock.json', {
|
||||||
cwd: REPO_ROOT,
|
cwd: REPO_ROOT,
|
||||||
ignore: ['**/node_modules/**', '**/out/**', '**/release/**']
|
ignore: ['**/node_modules/**', '**/out/**']
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
|
@ -26,7 +26,7 @@ const customFeatureLabels = {
|
|||||||
function getBasicLanguages(): Promise<{ label: string; entry: string }[]> {
|
function getBasicLanguages(): Promise<{ label: string; entry: string }[]> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
glob(
|
glob(
|
||||||
'./release/esm/vs/basic-languages/*/*.contribution.js',
|
'./out/monaco-editor/esm/vs/basic-languages/*/*.contribution.js',
|
||||||
{ cwd: path.dirname(__dirname) },
|
{ cwd: path.dirname(__dirname) },
|
||||||
(err, files) => {
|
(err, files) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -36,7 +36,7 @@ function getBasicLanguages(): Promise<{ label: string; entry: string }[]> {
|
|||||||
|
|
||||||
resolve(
|
resolve(
|
||||||
files.map((file) => {
|
files.map((file) => {
|
||||||
const entry = file.substring('./release/esm/'.length).replace(/\.js$/, '');
|
const entry = file.substring('./out/monaco-editor/esm/'.length).replace(/\.js$/, '');
|
||||||
const label = path.basename(file).replace(/\.contribution\.js$/, '');
|
const label = path.basename(file).replace(/\.contribution\.js$/, '');
|
||||||
return {
|
return {
|
||||||
label: label,
|
label: label,
|
||||||
@ -52,7 +52,7 @@ function getBasicLanguages(): Promise<{ label: string; entry: string }[]> {
|
|||||||
function readAdvancedLanguages(): Promise<string[]> {
|
function readAdvancedLanguages(): Promise<string[]> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
glob(
|
glob(
|
||||||
'./release/esm/vs/language/*/monaco.contribution.js',
|
'./out/monaco-editor/esm/vs/language/*/monaco.contribution.js',
|
||||||
{ cwd: path.dirname(__dirname) },
|
{ cwd: path.dirname(__dirname) },
|
||||||
(err, files) => {
|
(err, files) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -62,7 +62,7 @@ function readAdvancedLanguages(): Promise<string[]> {
|
|||||||
|
|
||||||
resolve(
|
resolve(
|
||||||
files
|
files
|
||||||
.map((file) => file.substring('./release/esm/vs/language/'.length))
|
.map((file) => file.substring('./out/monaco-editor/esm/vs/language/'.length))
|
||||||
.map((file) => file.substring(0, file.length - '/monaco.contribution.js'.length))
|
.map((file) => file.substring(0, file.length - '/monaco.contribution.js'.length))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ function getAdvancedLanguages(): Promise<
|
|||||||
});
|
});
|
||||||
|
|
||||||
function checkFileExists(moduleName) {
|
function checkFileExists(moduleName) {
|
||||||
const filePath = path.join(REPO_ROOT, 'release/esm', `${moduleName}.js`);
|
const filePath = path.join(REPO_ROOT, 'out/monaco-editor/esm', `${moduleName}.js`);
|
||||||
if (!fs.existsSync(filePath)) {
|
if (!fs.existsSync(filePath)) {
|
||||||
console.error(`Could not find ${filePath}.`);
|
console.error(`Could not find ${filePath}.`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@ -174,7 +174,7 @@ export type EditorFeature = ${features.map((el) => `'${el.label}'`).join(' | ')}
|
|||||||
export type NegatedEditorFeature = ${features.map((el) => `'!${el.label}'`).join(' | ')};
|
export type NegatedEditorFeature = ${features.map((el) => `'!${el.label}'`).join(' | ')};
|
||||||
|
|
||||||
`;
|
`;
|
||||||
const dtsDestination = path.join(REPO_ROOT, 'release/esm/metadata.d.ts');
|
const dtsDestination = path.join(REPO_ROOT, 'out/monaco-editor/esm/metadata.d.ts');
|
||||||
ensureDir(path.dirname(dtsDestination));
|
ensureDir(path.dirname(dtsDestination));
|
||||||
fs.writeFileSync(dtsDestination, dtsContents.replace(/\r\n/g, '\n'));
|
fs.writeFileSync(dtsDestination, dtsContents.replace(/\r\n/g, '\n'));
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ export type NegatedEditorFeature = ${features.map((el) => `'!${el.label}'`).join
|
|||||||
exports.features = ${JSON.stringify(features, null, ' ')};
|
exports.features = ${JSON.stringify(features, null, ' ')};
|
||||||
exports.languages = ${JSON.stringify(languages, null, ' ')};
|
exports.languages = ${JSON.stringify(languages, null, ' ')};
|
||||||
`;
|
`;
|
||||||
const jsDestination = path.join(REPO_ROOT, 'release/esm/metadata.js');
|
const jsDestination = path.join(REPO_ROOT, 'out/monaco-editor/esm/metadata.js');
|
||||||
ensureDir(path.dirname(jsDestination));
|
ensureDir(path.dirname(jsDestination));
|
||||||
fs.writeFileSync(jsDestination, jsContents.replace(/\r\n/g, '\n'));
|
fs.writeFileSync(jsDestination, jsContents.replace(/\r\n/g, '\n'));
|
||||||
}
|
}
|
||||||
@ -213,8 +213,12 @@ function getFeatures(): { label: string; entry: string | string[] }[] {
|
|||||||
|
|
||||||
let features: string[] = [];
|
let features: string[] = [];
|
||||||
const files =
|
const files =
|
||||||
fs.readFileSync(path.join(REPO_ROOT, 'release/esm/vs/editor/edcore.main.js')).toString() +
|
fs
|
||||||
fs.readFileSync(path.join(REPO_ROOT, 'release/esm/vs/editor/editor.all.js')).toString();
|
.readFileSync(path.join(REPO_ROOT, 'out/monaco-editor/esm/vs/editor/edcore.main.js'))
|
||||||
|
.toString() +
|
||||||
|
fs
|
||||||
|
.readFileSync(path.join(REPO_ROOT, 'out/monaco-editor/esm/vs/editor/editor.all.js'))
|
||||||
|
.toString();
|
||||||
files.split(/\r\n|\n/).forEach((line) => {
|
files.split(/\r\n|\n/).forEach((line) => {
|
||||||
const m = line.match(/import '([^']+)'/);
|
const m = line.match(/import '([^']+)'/);
|
||||||
if (m) {
|
if (m) {
|
||||||
|
@ -16,7 +16,7 @@ export const REPO_ROOT = path.join(__dirname, '../');
|
|||||||
/**
|
/**
|
||||||
* Launch the typescript compiler synchronously over a project.
|
* Launch the typescript compiler synchronously over a project.
|
||||||
*/
|
*/
|
||||||
export function tsc(_projectPath: string) {
|
export function runTsc(_projectPath: string) {
|
||||||
const projectPath = path.join(REPO_ROOT, _projectPath);
|
const projectPath = path.join(REPO_ROOT, _projectPath);
|
||||||
console.log(`Launching compiler at ${_projectPath}...`);
|
console.log(`Launching compiler at ${_projectPath}...`);
|
||||||
const res = cp.spawnSync(
|
const res = cp.spawnSync(
|
||||||
@ -47,12 +47,12 @@ export function prettier(_filePath: string) {
|
|||||||
/**
|
/**
|
||||||
* Transform an external .d.ts file to an internal .d.ts file
|
* Transform an external .d.ts file to an internal .d.ts file
|
||||||
*/
|
*/
|
||||||
export function dts(_source: string, _destination: string, namespace: string) {
|
export function massageAndCopyDts(source: string, destination: string, namespace: string) {
|
||||||
const source = path.join(REPO_ROOT, _source);
|
const absoluteSource = path.join(REPO_ROOT, source);
|
||||||
const destination = path.join(REPO_ROOT, _destination);
|
const absoluteDestination = path.join(REPO_ROOT, destination);
|
||||||
|
|
||||||
const lines = fs
|
const lines = fs
|
||||||
.readFileSync(source)
|
.readFileSync(absoluteSource)
|
||||||
.toString()
|
.toString()
|
||||||
.split(/\r\n|\r|\n/);
|
.split(/\r\n|\r|\n/);
|
||||||
|
|
||||||
@ -81,10 +81,10 @@ export function dts(_source: string, _destination: string, namespace: string) {
|
|||||||
result.push(`}`);
|
result.push(`}`);
|
||||||
result.push(``);
|
result.push(``);
|
||||||
|
|
||||||
ensureDir(path.dirname(destination));
|
ensureDir(path.dirname(absoluteDestination));
|
||||||
fs.writeFileSync(destination, result.join('\n'));
|
fs.writeFileSync(absoluteDestination, result.join('\n'));
|
||||||
|
|
||||||
prettier(_destination);
|
prettier(destination);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function build(options: import('esbuild').BuildOptions) {
|
export function build(options: import('esbuild').BuildOptions) {
|
||||||
@ -113,7 +113,7 @@ export function buildESM(options: { base: string; entryPoints: string[]; externa
|
|||||||
},
|
},
|
||||||
external: options.external,
|
external: options.external,
|
||||||
outbase: `src/${options.base}`,
|
outbase: `src/${options.base}`,
|
||||||
outdir: `out/release/esm/vs/${options.base}/`,
|
outdir: `out/languages/bundled/esm/vs/${options.base}/`,
|
||||||
plugins: [
|
plugins: [
|
||||||
alias({
|
alias({
|
||||||
'vscode-nls': path.join(__dirname, 'fillers/vscode-nls.ts')
|
'vscode-nls': path.join(__dirname, 'fillers/vscode-nls.ts')
|
||||||
@ -156,7 +156,7 @@ function buildOneAMD(
|
|||||||
js: 'return moduleExports;\n});'
|
js: 'return moduleExports;\n});'
|
||||||
},
|
},
|
||||||
outbase: `src/${options.base}`,
|
outbase: `src/${options.base}`,
|
||||||
outdir: `out/release/${type}/vs/${options.base}/`,
|
outdir: `out/languages/bundled/amd-${type}/vs/${options.base}/`,
|
||||||
plugins: [
|
plugins: [
|
||||||
alias({
|
alias({
|
||||||
'vscode-nls': path.join(__dirname, '../build/fillers/vscode-nls.ts'),
|
'vscode-nls': path.join(__dirname, '../build/fillers/vscode-nls.ts'),
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
"prettier-check": "prettier --check .",
|
"prettier-check": "prettier --check .",
|
||||||
"prettier": "prettier --write .",
|
"prettier": "prettier --write .",
|
||||||
"pretty-quick": "pretty-quick --staged",
|
"pretty-quick": "pretty-quick --staged",
|
||||||
"release": "ts-node ./build/build && ts-node ./build/release",
|
|
||||||
"simpleserver": "ts-node ./build/simpleserver",
|
"simpleserver": "ts-node ./build/simpleserver",
|
||||||
"package-for-smoketest-webpack": "ts-node ./test/smoke/package-webpack",
|
"package-for-smoketest-webpack": "ts-node ./test/smoke/package-webpack",
|
||||||
"package-for-smoketest-webpack-cross-origin": "ts-node ./test/smoke/package-webpack --cross-origin",
|
"package-for-smoketest-webpack-cross-origin": "ts-node ./test/smoke/package-webpack --cross-origin",
|
||||||
@ -26,8 +25,10 @@
|
|||||||
"test": "mocha test/unit/all.js && ts-node ./build/check-samples",
|
"test": "mocha test/unit/all.js && ts-node ./build/check-samples",
|
||||||
"deps-all-remove": "ts-node ./build/npm/removeAll",
|
"deps-all-remove": "ts-node ./build/npm/removeAll",
|
||||||
"deps-all-install": "ts-node ./build/npm/installAll",
|
"deps-all-install": "ts-node ./build/npm/installAll",
|
||||||
|
"update-actions": "pin-github-action ./.github/workflows/website.yml",
|
||||||
"watch": "tsc -w -p ./src",
|
"watch": "tsc -w -p ./src",
|
||||||
"update-actions": "pin-github-action ./.github/workflows/website.yml"
|
"build": "ts-node ./build/build-languages",
|
||||||
|
"build-monaco-editor": "npm run build && ts-node ./build/build-monaco-editor"
|
||||||
},
|
},
|
||||||
"typings": "./esm/vs/editor/editor.api.d.ts",
|
"typings": "./esm/vs/editor/editor.api.d.ts",
|
||||||
"module": "./esm/vs/editor/editor.main.js",
|
"module": "./esm/vs/editor/editor.main.js",
|
||||||
|
@ -30,7 +30,7 @@ async function prepareMonacoEditorReleaseStableOrNightly() {
|
|||||||
|
|
||||||
await prepareMonacoEditorRelease(version);
|
await prepareMonacoEditorRelease(version);
|
||||||
|
|
||||||
// npm package is now in ./release, ready to be published
|
// npm package is now in ./out/monaco-editor, ready to be published
|
||||||
}
|
}
|
||||||
|
|
||||||
async function prepareMonacoEditorRelease(monacoEditorCoreVersion: string) {
|
async function prepareMonacoEditorRelease(monacoEditorCoreVersion: string) {
|
||||||
|
@ -6,7 +6,7 @@ sudo npm run playwright-install-deps
|
|||||||
# Check prettier
|
# Check prettier
|
||||||
npm run prettier-check
|
npm run prettier-check
|
||||||
# Build
|
# Build
|
||||||
npm run release
|
npm run build-monaco-editor
|
||||||
|
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
npm test
|
npm test
|
||||||
@ -25,4 +25,4 @@ npm run package-for-smoketest-parcel --prefix test/smoke/parcel
|
|||||||
# Run smoke test
|
# Run smoke test
|
||||||
npm run smoketest
|
npm run smoketest
|
||||||
|
|
||||||
# npm package is now ready to be published in ./release
|
# npm package is now ready to be published in ./out/monaco-editor
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"lib": ["dom", "es5", "es2015.collection", "es2015.promise", "es2015.iterable"],
|
"lib": ["dom", "es5", "es2015.collection", "es2015.promise", "es2015.iterable"],
|
||||||
"module": "amd",
|
"module": "amd",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "../out/amd",
|
"outDir": "../out/languages/amd-tsc",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="editor-container" style="position: absolute; width: 500px; height: 400px"></div>
|
<div id="editor-container" style="position: absolute; width: 500px; height: 400px"></div>
|
||||||
<script src="../../../release/dev/vs/loader.js"></script>
|
<script src="../../../out/monaco-editor/dev/vs/loader.js"></script>
|
||||||
<script>
|
<script>
|
||||||
require.config({
|
require.config({
|
||||||
paths: {
|
paths: {
|
||||||
vs: '../../../release/dev/vs'
|
vs: '../../../out/monaco-editor/dev/vs'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
require(['vs/editor/editor.main'], () => {
|
require(['vs/editor/editor.main'], () => {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as monaco from '../../../release/esm/vs/editor/editor.main.js';
|
import * as monaco from '../../../out/monaco-editor/esm/vs/editor/editor.main.js';
|
||||||
|
|
||||||
self.MonacoEnvironment = {
|
self.MonacoEnvironment = {
|
||||||
getWorkerUrl: function (moduleId, label) {
|
getWorkerUrl: function (moduleId, label) {
|
||||||
|
@ -18,11 +18,13 @@ const workerEntryPoints = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
build({
|
build({
|
||||||
entryPoints: workerEntryPoints.map((entry) => path.join(__dirname, `../../release/esm/${entry}`)),
|
entryPoints: workerEntryPoints.map((entry) =>
|
||||||
|
path.join(__dirname, `../../out/monaco-editor/esm/${entry}`)
|
||||||
|
),
|
||||||
bundle: true,
|
bundle: true,
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
logLevel: 'silent',
|
logLevel: 'silent',
|
||||||
outbase: path.join(__dirname, '../../release/esm/'),
|
outbase: path.join(__dirname, '../../out/monaco-editor/esm/'),
|
||||||
outdir: path.join(__dirname, 'esbuild/out')
|
outdir: path.join(__dirname, 'esbuild/out')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ webpack(
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'monaco-editor': path.resolve(REPO_ROOT, 'release')
|
'monaco-editor': path.resolve(REPO_ROOT, 'out/monaco-editor')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
@ -40,7 +40,7 @@ webpack(
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [<any>new MonacoWebpackPlugin({
|
plugins: [<any>new MonacoWebpackPlugin({
|
||||||
monacoEditorPath: path.resolve(REPO_ROOT, 'release')
|
monacoEditorPath: path.resolve(REPO_ROOT, 'out/monaco-editor')
|
||||||
})]
|
})]
|
||||||
},
|
},
|
||||||
(err: Error | undefined, stats: webpack.Stats | undefined) => {
|
(err: Error | undefined, stats: webpack.Stats | undefined) => {
|
||||||
|
@ -1,34 +1,40 @@
|
|||||||
import * as monaco from '../../../release/esm/vs/editor/editor.main.js';
|
import * as monaco from '../../../out/monaco-editor/esm/vs/editor/editor.main.js';
|
||||||
|
|
||||||
self.MonacoEnvironment = {
|
self.MonacoEnvironment = {
|
||||||
getWorker: function (moduleId, label) {
|
getWorker: function (moduleId, label) {
|
||||||
if (label === 'json') {
|
if (label === 'json') {
|
||||||
return new Worker(
|
return new Worker(
|
||||||
new URL('../../../release/esm/vs/language/json/json.worker.js', import.meta.url),
|
new URL('../../../out/monaco-editor/esm/vs/language/json/json.worker.js', import.meta.url),
|
||||||
{ type: 'module' }
|
{ type: 'module' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (label === 'css' || label === 'scss' || label === 'less') {
|
if (label === 'css' || label === 'scss' || label === 'less') {
|
||||||
return new Worker(
|
return new Worker(
|
||||||
new URL('../../../release/esm/vs/language/css/css.worker.js', import.meta.url),
|
new URL('../../../out/monaco-editor/esm/vs/language/css/css.worker.js', import.meta.url),
|
||||||
{ type: 'module' }
|
{ type: 'module' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
||||||
return new Worker(
|
return new Worker(
|
||||||
new URL('../../../release/esm/vs/language/html/html.worker.js', import.meta.url),
|
new URL('../../../out/monaco-editor/esm/vs/language/html/html.worker.js', import.meta.url),
|
||||||
{ type: 'module' }
|
{ type: 'module' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (label === 'typescript' || label === 'javascript') {
|
if (label === 'typescript' || label === 'javascript') {
|
||||||
return new Worker(
|
return new Worker(
|
||||||
new URL('../../../release/esm/vs/language/typescript/ts.worker.js', import.meta.url),
|
new URL(
|
||||||
|
'../../../out/monaco-editor/esm/vs/language/typescript/ts.worker.js',
|
||||||
|
import.meta.url
|
||||||
|
),
|
||||||
{ type: 'module' }
|
{ type: 'module' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return new Worker(new URL('../../../release/esm/vs/editor/editor.worker.js', import.meta.url), {
|
return new Worker(
|
||||||
type: 'module'
|
new URL('../../../out/monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url),
|
||||||
});
|
{
|
||||||
|
type: 'module'
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as monaco from '../../../release/esm/vs/editor/editor.main';
|
import * as monaco from '../../../out/monaco-editor/esm/vs/editor/editor.main';
|
||||||
import editorWorker from '../../../release/esm/vs/editor/editor.worker?worker';
|
import editorWorker from '../../../out/monaco-editor/esm/vs/editor/editor.worker?worker';
|
||||||
import jsonWorker from '../../../release/esm/vs/language/json/json.worker?worker';
|
import jsonWorker from '../../../out/monaco-editor/esm/vs/language/json/json.worker?worker';
|
||||||
import cssWorker from '../../../release/esm/vs/language/css/css.worker?worker';
|
import cssWorker from '../../../out/monaco-editor/esm/vs/language/css/css.worker?worker';
|
||||||
import htmlWorker from '../../../release/esm/vs/language/html/html.worker?worker';
|
import htmlWorker from '../../../out/monaco-editor/esm/vs/language/html/html.worker?worker';
|
||||||
import tsWorker from '../../../release/esm/vs/language/typescript/ts.worker?worker';
|
import tsWorker from '../../../out/monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
||||||
|
|
||||||
self.MonacoEnvironment = {
|
self.MonacoEnvironment = {
|
||||||
getWorker(moduleId, label) {
|
getWorker(moduleId, label) {
|
||||||
|
@ -6,8 +6,8 @@ const path = require('path');
|
|||||||
requirejs.config({
|
requirejs.config({
|
||||||
baseUrl: '',
|
baseUrl: '',
|
||||||
paths: {
|
paths: {
|
||||||
'vs/fillers/monaco-editor-core': 'out/amd/fillers/monaco-editor-core-amd',
|
'vs/fillers/monaco-editor-core': 'out/languages/amd-tsc/fillers/monaco-editor-core-amd',
|
||||||
'vs/basic-languages': 'out/amd/basic-languages',
|
'vs/basic-languages': 'out/languages/amd-tsc/basic-languages',
|
||||||
vs: './node_modules/monaco-editor-core/dev/vs'
|
vs: './node_modules/monaco-editor-core/dev/vs'
|
||||||
},
|
},
|
||||||
nodeRequire: require
|
nodeRequire: require
|
||||||
@ -38,7 +38,7 @@ requirejs(
|
|||||||
['test/unit/setup'],
|
['test/unit/setup'],
|
||||||
function () {
|
function () {
|
||||||
glob(
|
glob(
|
||||||
'out/amd/basic-languages/*/*.test.js',
|
'out/languages/amd-tsc/basic-languages/*/*.test.js',
|
||||||
{ cwd: path.join(__dirname, '../../') },
|
{ cwd: path.join(__dirname, '../../') },
|
||||||
function (err, files) {
|
function (err, files) {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -46,7 +46,7 @@ requirejs(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
requirejs(
|
requirejs(
|
||||||
files.map((f) => f.replace(/^out\/amd/, 'vs').replace(/\.js$/, '')),
|
files.map((f) => f.replace(/^out\/languages\/amd-tsc/, 'vs').replace(/\.js$/, '')),
|
||||||
function () {
|
function () {
|
||||||
run(); // We can launch the tests!
|
run(); // We can launch the tests!
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,7 @@ import { getMonaco, loadMonaco } from "../../../monaco-loader";
|
|||||||
*/
|
*/
|
||||||
export class MonacoLoader extends React.Component<
|
export class MonacoLoader extends React.Component<
|
||||||
{ children: (m: typeof monaco) => React.ReactChild },
|
{ children: (m: typeof monaco) => React.ReactChild },
|
||||||
{ monaco: typeof monaco | undefined }
|
{ monaco?: typeof monaco }
|
||||||
> {
|
> {
|
||||||
constructor(props: any) {
|
constructor(props: any) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -115,10 +115,10 @@ export function toLoaderConfig(settings: Settings): IMonacoSetup {
|
|||||||
let languagesUrl: string;
|
let languagesUrl: string;
|
||||||
switch (settings.languagesSource) {
|
switch (settings.languagesSource) {
|
||||||
case "latest":
|
case "latest":
|
||||||
languagesUrl = `${root}/out/release/${settings.latestLanguagesStability}/vs`;
|
languagesUrl = `${root}/out/languages/bundled/amd-${settings.latestLanguagesStability}/vs`;
|
||||||
break;
|
break;
|
||||||
case "source":
|
case "source":
|
||||||
languagesUrl = `${root}/out/amd`;
|
languagesUrl = `${root}/out/languages/amd-tsc`;
|
||||||
break;
|
break;
|
||||||
case "url":
|
case "url":
|
||||||
languagesUrl = settings.languagesUrl;
|
languagesUrl = settings.languagesUrl;
|
||||||
@ -156,11 +156,11 @@ export function getDefaultSettings(): Settings {
|
|||||||
|
|
||||||
coreSource: "latest",
|
coreSource: "latest",
|
||||||
latestCoreStability: "dev",
|
latestCoreStability: "dev",
|
||||||
coreUrl: "http://localhost:5000/out/vs",
|
coreUrl: "http://localhost:5001/out/vs",
|
||||||
|
|
||||||
languagesSource: "latest",
|
languagesSource: "latest",
|
||||||
latestLanguagesStability: "dev",
|
latestLanguagesStability: "dev",
|
||||||
languagesUrl: "http://localhost:8080/out",
|
languagesUrl: "http://localhost:5002/out/languages/amd-tsc",
|
||||||
customConfig: JSON.stringify({
|
customConfig: JSON.stringify({
|
||||||
loaderUrl: "",
|
loaderUrl: "",
|
||||||
codiconUrl: "",
|
codiconUrl: "",
|
||||||
|
@ -14,5 +14,5 @@
|
|||||||
// to enable mobx decorators
|
// to enable mobx decorators
|
||||||
"useDefineForClassFields": false
|
"useDefineForClassFields": false
|
||||||
},
|
},
|
||||||
"include": ["src/**/*", "../release/monaco.d.ts"]
|
"include": ["src/**/*", "./node_modules/monaco-editor/monaco.d.ts"]
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
"module": "CommonJS",
|
"module": "CommonJS",
|
||||||
"skipLibCheck": true
|
"skipLibCheck": true
|
||||||
},
|
},
|
||||||
"include": ["../../release/esm/vs/editor/editor.api.d.ts"],
|
"include": ["../../out/monaco-editor/esm/vs/editor/editor.api.d.ts"],
|
||||||
"exclude": ["theme"]
|
"exclude": ["theme"]
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://typedoc.org/schema.json",
|
"$schema": "https://typedoc.org/schema.json",
|
||||||
"entryPoints": ["../../release/esm/vs/editor/editor.api.d.ts"],
|
"entryPoints": ["../../out/monaco-editor/esm/vs/editor/editor.api.d.ts"],
|
||||||
|
|
||||||
"out": "dist",
|
"out": "dist",
|
||||||
"theme": "default",
|
"theme": "default",
|
||||||
|
@ -131,7 +131,7 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
new CopyPlugin({
|
new CopyPlugin({
|
||||||
patterns: [{ from: "../out/", to: "./out/" }],
|
patterns: [{ from: "../out/languages/", to: "./out/languages/" }],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
} as webpack.Configuration;
|
} as webpack.Configuration;
|
||||||
|
Loading…
Reference in New Issue
Block a user