mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 11:35:40 +01:00
Run prettier
This commit is contained in:
parent
734e1cb987
commit
9a52545094
9 changed files with 97 additions and 62 deletions
|
|
@ -82,7 +82,11 @@ exports.removeDir = removeDir;
|
||||||
function tsc(_projectPath) {
|
function tsc(_projectPath) {
|
||||||
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}...`);
|
||||||
cp.spawnSync(process.execPath, [path.join(__dirname, '../node_modules/typescript/lib/tsc.js'), '-p', projectPath], { stdio: 'inherit', stderr: 'inherit' });
|
cp.spawnSync(
|
||||||
|
process.execPath,
|
||||||
|
[path.join(__dirname, '../node_modules/typescript/lib/tsc.js'), '-p', projectPath],
|
||||||
|
{ stdio: 'inherit', stderr: 'inherit' }
|
||||||
|
);
|
||||||
console.log(`Compiled ${_projectPath}`);
|
console.log(`Compiled ${_projectPath}`);
|
||||||
}
|
}
|
||||||
exports.tsc = tsc;
|
exports.tsc = tsc;
|
||||||
|
|
@ -94,7 +98,11 @@ exports.tsc = tsc;
|
||||||
*/
|
*/
|
||||||
function prettier(_filePath) {
|
function prettier(_filePath) {
|
||||||
const filePath = path.join(REPO_ROOT, _filePath);
|
const filePath = path.join(REPO_ROOT, _filePath);
|
||||||
cp.spawnSync(process.execPath, [path.join(__dirname, '../node_modules/prettier/bin-prettier.js'), '--write', filePath], { stdio: 'inherit', stderr: 'inherit' });
|
cp.spawnSync(
|
||||||
|
process.execPath,
|
||||||
|
[path.join(__dirname, '../node_modules/prettier/bin-prettier.js'), '--write', filePath],
|
||||||
|
{ stdio: 'inherit', stderr: 'inherit' }
|
||||||
|
);
|
||||||
|
|
||||||
console.log(`Ran prettier over ${_filePath}`);
|
console.log(`Ran prettier over ${_filePath}`);
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +197,7 @@ function getGitVersion() {
|
||||||
let refsMatch;
|
let refsMatch;
|
||||||
const refs = {};
|
const refs = {};
|
||||||
|
|
||||||
while (refsMatch = refsRegex.exec(refsRaw)) {
|
while ((refsMatch = refsRegex.exec(refsRaw))) {
|
||||||
refs[refsMatch[2]] = refsMatch[1];
|
refs[refsMatch[2]] = refsMatch[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,9 @@ function buildAMD(entryPoint, banner) {
|
||||||
buildOneAMD('min', entryPoint, banner);
|
buildOneAMD('min', entryPoint, banner);
|
||||||
}
|
}
|
||||||
|
|
||||||
buildAMD('src/monaco.contribution.ts', 'define("vs/language/css/monaco.contribution",["vs/editor/editor.api"],()=>{');
|
buildAMD(
|
||||||
|
'src/monaco.contribution.ts',
|
||||||
|
'define("vs/language/css/monaco.contribution",["vs/editor/editor.api"],()=>{'
|
||||||
|
);
|
||||||
buildAMD('src/cssMode.ts', 'define("vs/language/css/cssMode",["vs/editor/editor.api"],()=>{');
|
buildAMD('src/cssMode.ts', 'define("vs/language/css/cssMode",["vs/editor/editor.api"],()=>{');
|
||||||
buildAMD('src/cssWorker.ts', 'define("vs/language/css/cssWorker",[],()=>{');
|
buildAMD('src/cssWorker.ts', 'define("vs/language/css/cssWorker",[],()=>{');
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,9 @@ declare var require: any;
|
||||||
|
|
||||||
function getMode(): Promise<typeof mode> {
|
function getMode(): Promise<typeof mode> {
|
||||||
if (AMD) {
|
if (AMD) {
|
||||||
return new Promise((resolve, reject) => { require(['vs/language/css/cssMode'], resolve, reject); });
|
return new Promise((resolve, reject) => {
|
||||||
|
require(['vs/language/css/cssMode'], resolve, reject);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return import('./cssMode');
|
return import('./cssMode');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ module.exports = {
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'monaco-editor': path.resolve(__dirname, '../../release'),
|
'monaco-editor': path.resolve(__dirname, '../../release')
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
|
|
@ -29,7 +29,9 @@ module.exports = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [new MonacoWebpackPlugin({
|
plugins: [
|
||||||
monacoEditorPath: path.resolve(__dirname, '../../release')
|
new MonacoWebpackPlugin({
|
||||||
})]
|
monacoEditorPath: path.resolve(__dirname, '../../release')
|
||||||
|
})
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ module.exports = {
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'monaco-editor': path.resolve(__dirname, '../../release'),
|
'monaco-editor': path.resolve(__dirname, '../../release')
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
|
|
@ -26,7 +26,9 @@ module.exports = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
plugins: [new MonacoWebpackPlugin({
|
plugins: [
|
||||||
monacoEditorPath: path.resolve(__dirname, '../../release')
|
new MonacoWebpackPlugin({
|
||||||
})]
|
monacoEditorPath: path.resolve(__dirname, '../../release')
|
||||||
|
})
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ monaco.languages.registerDocumentSemanticTokensProvider('plaintext', {
|
||||||
monaco.editor.defineTheme('myCustomTheme', {
|
monaco.editor.defineTheme('myCustomTheme', {
|
||||||
base: 'vs',
|
base: 'vs',
|
||||||
inherit: true,
|
inherit: true,
|
||||||
colors : {},
|
colors: {},
|
||||||
rules: [
|
rules: [
|
||||||
{ token: 'comment', foreground: 'aaaaaa', fontStyle: 'italic' },
|
{ token: 'comment', foreground: 'aaaaaa', fontStyle: 'italic' },
|
||||||
{ token: 'keyword', foreground: 'ce63eb' },
|
{ token: 'keyword', foreground: 'ce63eb' },
|
||||||
|
|
|
||||||
|
|
@ -14,27 +14,36 @@ removeDir(`monaco-html/out`);
|
||||||
|
|
||||||
tsc(`monaco-html/src/tsconfig.json`);
|
tsc(`monaco-html/src/tsconfig.json`);
|
||||||
|
|
||||||
dts(`monaco-html/out/amd/monaco.contribution.d.ts`, `monaco-html/monaco.d.ts`, 'monaco.languages.html');
|
dts(
|
||||||
|
`monaco-html/out/amd/monaco.contribution.d.ts`,
|
||||||
|
`monaco-html/monaco.d.ts`,
|
||||||
|
'monaco.languages.html'
|
||||||
|
);
|
||||||
|
|
||||||
esbuild.build({
|
esbuild
|
||||||
entryPoints: ['src/htmlMode.ts', 'src/html.worker.ts', 'src/monaco.contribution.ts'],
|
.build({
|
||||||
bundle: true,
|
entryPoints: ['src/htmlMode.ts', 'src/html.worker.ts', 'src/monaco.contribution.ts'],
|
||||||
target: 'esnext',
|
bundle: true,
|
||||||
format: 'esm',
|
target: 'esnext',
|
||||||
external: ['monaco-editor-core', '*/htmlMode'],
|
format: 'esm',
|
||||||
outdir: 'release/esm/',
|
external: ['monaco-editor-core', '*/htmlMode'],
|
||||||
plugins: [
|
outdir: 'release/esm/',
|
||||||
alias({
|
plugins: [
|
||||||
'vscode-nls': path.join(__dirname, '../src/fillers/vscode-nls.ts'),
|
alias({
|
||||||
}),
|
'vscode-nls': path.join(__dirname, '../src/fillers/vscode-nls.ts')
|
||||||
],
|
})
|
||||||
}).then((result) => {
|
]
|
||||||
if (result.errors.length > 0) {
|
})
|
||||||
console.error(result.errors);
|
.then((result) => {
|
||||||
}
|
if (result.errors.length > 0) {
|
||||||
if (result.warnings.length > 0) {
|
console.error(result.errors);
|
||||||
console.error(result.warnings);
|
}
|
||||||
}
|
if (result.warnings.length > 0) {
|
||||||
|
console.error(result.warnings);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
cp.spawnSync(process.execPath, [path.join(__dirname, './bundle.js')], {
|
||||||
|
stdio: 'inherit',
|
||||||
|
stderr: 'inherit'
|
||||||
});
|
});
|
||||||
|
|
||||||
cp.spawnSync(process.execPath, [path.join(__dirname, './bundle.js')], { stdio: 'inherit', stderr: 'inherit' });
|
|
||||||
|
|
|
||||||
|
|
@ -14,27 +14,36 @@ removeDir(`monaco-json/out`);
|
||||||
|
|
||||||
tsc(`monaco-json/src/tsconfig.json`);
|
tsc(`monaco-json/src/tsconfig.json`);
|
||||||
|
|
||||||
dts(`monaco-json/out/amd/monaco.contribution.d.ts`, `monaco-json/monaco.d.ts`, 'monaco.languages.json');
|
dts(
|
||||||
|
`monaco-json/out/amd/monaco.contribution.d.ts`,
|
||||||
|
`monaco-json/monaco.d.ts`,
|
||||||
|
'monaco.languages.json'
|
||||||
|
);
|
||||||
|
|
||||||
esbuild.build({
|
esbuild
|
||||||
entryPoints: ['src/jsonMode.ts', 'src/json.worker.ts', 'src/monaco.contribution.ts'],
|
.build({
|
||||||
bundle: true,
|
entryPoints: ['src/jsonMode.ts', 'src/json.worker.ts', 'src/monaco.contribution.ts'],
|
||||||
target: 'esnext',
|
bundle: true,
|
||||||
format: 'esm',
|
target: 'esnext',
|
||||||
external: ['monaco-editor-core', '*/jsonMode'],
|
format: 'esm',
|
||||||
outdir: 'release/esm/',
|
external: ['monaco-editor-core', '*/jsonMode'],
|
||||||
plugins: [
|
outdir: 'release/esm/',
|
||||||
alias({
|
plugins: [
|
||||||
'vscode-nls': path.join(__dirname, '../src/fillers/vscode-nls.ts'),
|
alias({
|
||||||
}),
|
'vscode-nls': path.join(__dirname, '../src/fillers/vscode-nls.ts')
|
||||||
],
|
})
|
||||||
}).then((result) => {
|
]
|
||||||
if (result.errors.length > 0) {
|
})
|
||||||
console.error(result.errors);
|
.then((result) => {
|
||||||
}
|
if (result.errors.length > 0) {
|
||||||
if (result.warnings.length > 0) {
|
console.error(result.errors);
|
||||||
console.error(result.warnings);
|
}
|
||||||
}
|
if (result.warnings.length > 0) {
|
||||||
|
console.error(result.warnings);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
cp.spawnSync(process.execPath, [path.join(__dirname, './bundle.js')], {
|
||||||
|
stdio: 'inherit',
|
||||||
|
stderr: 'inherit'
|
||||||
});
|
});
|
||||||
|
|
||||||
cp.spawnSync(process.execPath, [path.join(__dirname, './bundle.js')], { stdio: 'inherit', stderr: 'inherit' });
|
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ function tokenize(
|
||||||
let offset = offsetDelta + scanner.getPosition();
|
let offset = offsetDelta + scanner.getPosition();
|
||||||
let type = '';
|
let type = '';
|
||||||
|
|
||||||
const kind = <SyntaxKind><any>scanner.scan();
|
const kind = <SyntaxKind>(<any>scanner.scan());
|
||||||
if (kind === SyntaxKind.EOF) {
|
if (kind === SyntaxKind.EOF) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -261,7 +261,7 @@ function tokenize(
|
||||||
|
|
||||||
ret.endState = new JSONState(
|
ret.endState = new JSONState(
|
||||||
state.getStateData(),
|
state.getStateData(),
|
||||||
<ScanError><any>scanner.getTokenError(),
|
<ScanError>(<any>scanner.getTokenError()),
|
||||||
lastWasColon,
|
lastWasColon,
|
||||||
parents
|
parents
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue