forked from remcohaszing/monaco-yaml
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: align with pengx17/master branch
- Loading branch information
Showing
40 changed files
with
1,510 additions
and
2,937 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
/.vscode/ | ||
/lib/ | ||
/out/ | ||
/scripts/ | ||
/src/ | ||
/test/ | ||
/release/dev/ | ||
/gulpfile.js | ||
/.gitignore | ||
/.npmignore |
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 was deleted.
Oops, something went wrong.
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,33 +1,39 @@ | ||
{ | ||
"name": "monaco-yaml", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "YAML plugin for the Monaco Editor", | ||
"scripts": { | ||
"compile": "gulp compile", | ||
"watch": "gulp watch", | ||
"prepublish": "gulp release" | ||
"compile": "rimraf ./out && tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json", | ||
"watch": "tsc -p ./src --watch", | ||
"prepublish": "rimraf ./release && yarn run compile && node ./scripts/release.js && node ./scripts/bundle && mcopy ./src/monaco.d.ts ./release/monaco.d.ts" | ||
}, | ||
"author": "Kevin Decker <[email protected]> (http://incaseofstairs.com)", | ||
"maintainers": [ | ||
"kpdecker", | ||
"pengx17" | ||
], | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kpdecker/monaco-yaml" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/kpdecker/monaco-yaml/issues" | ||
}, | ||
"devDependencies": { | ||
"event-stream": "^3.3.2", | ||
"gulp": "^3.9.1", | ||
"gulp-requirejs": "^0.1.3", | ||
"gulp-tsb": "^2.0.0", | ||
"gulp-uglify": "^1.5.3", | ||
"js-yaml": "^3.10.0", | ||
"jsonc-parser": "1.0.0", | ||
"merge-stream": "^1.0.0", | ||
"monaco-editor-core": "^0.10.1", | ||
"monaco-languages": "^0.9.0", | ||
"object-assign": "^4.1.0", | ||
"rimraf": "^2.5.2", | ||
"typescript": "^2.7.1", | ||
"vscode-json-languageservice": "^3.0.5", | ||
"vscode-languageserver-types": "^3.5.0" | ||
"@types/chai": "^4.1.4", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.9.3", | ||
"js-yaml": "^3.12.0", | ||
"jsonc-parser": "^2.0.2", | ||
"monaco-editor-core": "0.14.6", | ||
"monaco-languages": "1.5.1", | ||
"monaco-plugin-helpers": "^1.0.2", | ||
"requirejs": "^2.3.5", | ||
"rimraf": "^2.6.2", | ||
"typescript": "^3.0.3", | ||
"uglify-es": "^3.3.9", | ||
"vscode-json-languageservice": "^3.1.6", | ||
"vscode-languageserver-types": "3.12.0" | ||
} | ||
} |
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,82 @@ | ||
const requirejs = require('requirejs'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const UglifyES = require("uglify-es"); | ||
const helpers = require('monaco-plugin-helpers'); | ||
|
||
const REPO_ROOT = path.resolve(__dirname, '..'); | ||
|
||
const sha1 = helpers.getGitVersion(REPO_ROOT); | ||
const semver = require('../package.json').version; | ||
const headerVersion = semver + '(' + sha1 + ')'; | ||
|
||
const BUNDLED_FILE_HEADER = [ | ||
'/*!-----------------------------------------------------------------------------', | ||
' * Copyright (c) Microsoft Corporation. All rights reserved.', | ||
' * monaco-yaml version: ' + headerVersion, | ||
' * Released under the MIT license', | ||
' * https://github.com/kpdecker/monaco-yaml/blob/master/LICENSE.md', | ||
' *-----------------------------------------------------------------------------*/', | ||
'' | ||
].join('\n'); | ||
|
||
bundleOne('monaco.contribution'); | ||
bundleOne('yamlMode'); | ||
bundleOne('yamlWorker'); | ||
|
||
function bundleOne(moduleId, exclude) { | ||
requirejs.optimize({ | ||
baseUrl: 'out/amd/', | ||
name: 'vs/language/yaml/' + moduleId, | ||
out: 'release/dev/' + moduleId + '.js', | ||
exclude: exclude, | ||
paths: { | ||
'vs/language/yaml': REPO_ROOT + '/out/amd' | ||
}, | ||
optimize: 'none', | ||
packages: [ | ||
{ | ||
name: 'js-yaml', | ||
location: path.join(REPO_ROOT, 'node_modules/js-yaml/dist'), | ||
main: 'js-yaml' | ||
}, | ||
|
||
// The following is required by YAML language service | ||
{ | ||
name: 'jsonc-parser', | ||
location: path.join(REPO_ROOT, 'node_modules/jsonc-parser/lib/umd'), | ||
main: 'main' | ||
}, { | ||
name: 'vscode-json-languageservice/lib', | ||
location: path.join(REPO_ROOT, 'node_modules/vscode-json-languageservice/lib/umd') | ||
}, | ||
|
||
{ | ||
name: 'vscode-languageserver-types', | ||
location: path.join(REPO_ROOT, 'node_modules/vscode-languageserver-types/lib/umd'), | ||
main: 'main' | ||
}, { | ||
name: 'vscode-uri', | ||
location: path.join(REPO_ROOT, 'node_modules/vscode-uri/lib/umd'), | ||
main: 'index' | ||
}, { | ||
name: 'vscode-nls', | ||
location: path.join(REPO_ROOT, '/out/amd/fillers'), | ||
main: 'vscode-nls' | ||
}] | ||
}, function () { | ||
const devFilePath = path.join(REPO_ROOT, 'release/dev/' + moduleId + '.js'); | ||
const minFilePath = path.join(REPO_ROOT, 'release/min/' + moduleId + '.js'); | ||
const fileContents = fs.readFileSync(devFilePath).toString(); | ||
console.log(); | ||
console.log(`Minifying ${devFilePath}...`); | ||
const result = UglifyES.minify(fileContents, { | ||
output: { | ||
comments: 'some' | ||
} | ||
}); | ||
console.log(`Done.`); | ||
try { fs.mkdirSync(path.join(REPO_ROOT, 'release/min')) } catch (err) { } | ||
fs.writeFileSync(minFilePath, BUNDLED_FILE_HEADER + result.code); | ||
}) | ||
} |
Oops, something went wrong.