diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 0000000..c0e277f --- /dev/null +++ b/.prettierrc.yaml @@ -0,0 +1,10 @@ +jsxBracketSameLine: true +jsxSingleQuote: true +semi: false +singleQuote: true +printWidth: 100 +useTabs: false +tabWidth: 2 +trailingComma: none +bracketSpacing: true +arrowParens: avoid \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 038337c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: node_js - -os: - - osx - -node_js: - - node - -cache: - directories: - - "node_modules" - -notifications: - email: false \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore index c32a00a..a7a44e4 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,7 +1,9 @@ .vscode/** .vscode-test/** .gitignore +.prettierrc.yaml src src/** build.js +app.yaml vsc-extension-quickstart.md diff --git a/CHANGELOG.md b/CHANGELOG.md index c421838..8d921bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # 更新日志 + +## [1.6.2] 2022-03-14 +- 修复js字符串模板中的着色 +- 优化import代码着色 + +## [1.6.1] 2022-02-22 +- 优化列表颜色 + + ## [1.5.0] 2021-09-02 - 优化滚动条配色 - 优文件列表配色 diff --git a/README.md b/README.md index 2f7e57f..877c259 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ [![Version](https://vsmarketplacebadge.apphb.com/version-short/yutent.one-plain.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.one-plain) [![Rating](https://vsmarketplacebadge.apphb.com/rating-short/yutent.one-plain.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.one-plain) [![Installs](https://vsmarketplacebadge.apphb.com/installs/yutent.one-plain.svg)](https://marketplace.visualstudio.com/items?itemName=yutent.one-plain) -[![Build Status](https://travis-ci.org/yutent/one-plain.svg?branch=master)](https://travis-ci.org/yutent/one-plain) ## 截图预览 ![截图](./demo.jpg) diff --git a/app.yaml b/app.yaml new file mode 100644 index 0000000..5dc8ef6 --- /dev/null +++ b/app.yaml @@ -0,0 +1,18 @@ + +script: node ./build.js +cwd: ./ +watch: true +name: oss +ignore_watch: [data, themes, package.json, package-lock.json, node_modules, .git, .gitignore, app.yaml] +exec_mode: fork + +error_file: ./data/logs/error.log +out_file: ./data/logs/out.log +merge_logs: true +min_uptime: 60s +max_restarts: 1 +max_memory_restart: 300M +env: + NODE_ENV: development + + \ No newline at end of file diff --git a/build.js b/build.js index 8543738..29488c0 100644 --- a/build.js +++ b/build.js @@ -6,6 +6,7 @@ const fs = require('iofs') const path = require('path') +const readline = require('readline') const colors = require('./src/colors') @@ -32,4 +33,11 @@ const theme = { } fs.echo(JSON.stringify(theme, '', 2), path.join('./themes', 'color-theme.json')) + +// 这个就只是单纯的用来阻止进程结束, 方便pm2 +readline.createInterface({ + input: process.stdin, + output: process.stdout +}) + console.log('Build complete...') diff --git a/data/logs/error.log b/data/logs/error.log new file mode 100644 index 0000000..364e8f3 --- /dev/null +++ b/data/logs/error.log @@ -0,0 +1,59 @@ +/Volumes/extends/www/project/one-plain/src/es.js:105 + 'string.template.js meta.template.expression.js meta.array.literal.js meta.brace.square.js', + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +SyntaxError: Unexpected string + at wrapSafe (internal/modules/cjs/loader.js:915:16) + at Module._compile (internal/modules/cjs/loader.js:963:27) + at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) + at Module.load (internal/modules/cjs/loader.js:863:32) + at Function.Module._load (internal/modules/cjs/loader.js:708:14) + at Module.require (internal/modules/cjs/loader.js:887:19) + at require (internal/modules/cjs/helpers.js:74:18) + at Object. (/Volumes/extends/www/project/one-plain/build.js:14:12) + at Module._compile (internal/modules/cjs/loader.js:999:30) + at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) +/Volumes/extends/www/project/one-plain/src/es.js:20 + 'meta.import.ts string.quoted.double.ts' + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +SyntaxError: Unexpected string + at wrapSafe (internal/modules/cjs/loader.js:915:16) + at Module._compile (internal/modules/cjs/loader.js:963:27) + at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) + at Module.load (internal/modules/cjs/loader.js:863:32) + at Function.Module._load (internal/modules/cjs/loader.js:708:14) + at Module.require (internal/modules/cjs/loader.js:887:19) + at require (internal/modules/cjs/helpers.js:74:18) + at Object. (/Volumes/extends/www/project/one-plain/build.js:14:12) + at Module._compile (internal/modules/cjs/loader.js:999:30) + at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) +/Volumes/extends/www/project/one-plain/src/es.js:20 + 'meta.import.ts string.quoted.double.ts' + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +SyntaxError: Unexpected string + at wrapSafe (internal/modules/cjs/loader.js:915:16) + at Module._compile (internal/modules/cjs/loader.js:963:27) + at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) + at Module.load (internal/modules/cjs/loader.js:863:32) + at Function.Module._load (internal/modules/cjs/loader.js:708:14) + at Module.require (internal/modules/cjs/loader.js:887:19) + at require (internal/modules/cjs/helpers.js:74:18) + at Object. (/Volumes/extends/www/project/one-plain/build.js:14:12) + at Module._compile (internal/modules/cjs/loader.js:999:30) + at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) +readline.js:228 + input.on('data', ondata); + ^ + +TypeError: Cannot read property 'on' of undefined + at new Interface (readline.js:228:11) + at Object.createInterface (readline.js:92:10) + at Object. (/Volumes/extends/www/project/one-plain/build.js:37:10) + at Module._compile (internal/modules/cjs/loader.js:999:30) + at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) + at Module.load (internal/modules/cjs/loader.js:863:32) + at Function.Module._load (internal/modules/cjs/loader.js:708:14) + at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) + at internal/main/run_main_module.js:17:47 diff --git a/data/logs/out.log b/data/logs/out.log new file mode 100644 index 0000000..4e24608 --- /dev/null +++ b/data/logs/out.log @@ -0,0 +1,33 @@ +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... +Build complete... diff --git a/package.json b/package.json index f09d55a..ecc366f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "one plain@own", "description": "🔥 米白色主题@自用", "icon": "logo.png", - "version": "1.5.0", + "version": "1.6.2", "publisher": "yutent", "author": "Yutent [@yutent]", "engines": { diff --git a/src/base.js b/src/base.js index 452f51d..218d7a7 100644 --- a/src/base.js +++ b/src/base.js @@ -58,6 +58,7 @@ module.exports = [ scope: [ 'keyword.control', 'meta.tag', + 'punctuation.accessor.js', 'punctuation.definition.tag', 'punctuation.separator.inheritance.php', 'punctuation.definition.tag.html', @@ -92,7 +93,7 @@ module.exports = [ 'entity.name.function', 'meta.function-call', 'variable.function', - 'support.function', + 'support.function.js', 'keyword.other.special-method', 'meta.block-level' ], @@ -273,24 +274,7 @@ module.exports = [ foreground: '#e53935' } }, - { - name: 'entity.name.method.js', - scope: ['entity.name.method.js'], - settings: { - fontStyle: 'italic', - foreground: '#6182B8' - } - }, - { - name: 'meta.method.js', - scope: [ - 'meta.class-method.js entity.name.function.js', - 'variable.function.constructor' - ], - settings: { - foreground: '#6182B8' - } - }, + { name: 'Attributes', scope: ['entity.other.attribute-name'], @@ -332,16 +316,5 @@ module.exports = [ settings: { fontStyle: 'underline' } - }, - { - name: 'Decorators', - scope: [ - 'tag.decorator.js entity.name.tag.js', - 'tag.decorator.js punctuation.definition.tag.js' - ], - settings: { - fontStyle: 'italic', - foreground: '#6182B8' - } } ] diff --git a/src/colors.js b/src/colors.js index 5124e49..59f00dc 100644 --- a/src/colors.js +++ b/src/colors.js @@ -87,12 +87,12 @@ module.exports = { 'inputValidation.warningBorder': '#FFB62C50', 'dropdown.background': vars.white, 'dropdown.border': '#00000010', - 'list.hoverForeground': vars.cyan1, - 'list.hoverBackground': '#80CBC4', - 'list.activeSelectionBackground': vars.plain1, - 'list.activeSelectionForeground': '#80CBC4', - 'list.inactiveSelectionForeground': '#80CBC4', + 'list.hoverForeground': vars.cyan2, + 'list.hoverBackground': '#80CBC410', + 'list.activeSelectionBackground': '#80CBC430', + 'list.activeSelectionForeground': vars.cyan2, 'list.inactiveSelectionBackground': '#ccd7da50', + 'list.inactiveSelectionForeground': '#80CBC4', 'list.focusBackground': '#90A4AE20', 'list.focusForeground': vars.common, 'list.highlightForeground': '#80CBC4', diff --git a/src/es.js b/src/es.js index 6a02464..a4e6b9c 100644 --- a/src/es.js +++ b/src/es.js @@ -1,6 +1,71 @@ const vars = require('./var') module.exports = [ + { + name: 'import constant', + scope: [ + 'meta.import.js variable.other.readwrite.alias.js', + 'meta.import.ts variable.other.readwrite.alias.ts' + ], + settings: { + foreground: vars.blue2 + } + }, + { + name: 'import path', + scope: [ + 'meta.import.js string.quoted.single.js', + 'meta.import.js string.quoted.double.js', + 'meta.import.ts string.quoted.single.ts', + 'meta.import.ts string.quoted.double.ts' + ], + settings: { + fontStyle: 'underline', + foreground: vars.common + } + }, + { + name: 'import path', + scope: [ + 'meta.import.js string.quoted.single.js punctuation.definition.string.begin.js', + 'meta.import.js string.quoted.double.js punctuation.definition.string.begin.js', + 'meta.import.js string.quoted.single.js punctuation.definition.string.end.js', + 'meta.import.js string.quoted.double.js punctuation.definition.string.end.js', + 'meta.import.ts string.quoted.single.ts punctuation.definition.string.begin.ts', + 'meta.import.ts string.quoted.double.ts punctuation.definition.string.begin.ts', + 'meta.import.ts string.quoted.single.ts punctuation.definition.string.end.ts', + 'meta.import.ts string.quoted.double.ts punctuation.definition.string.end.ts' + ], + settings: { + fontStyle: 'none' + } + }, + { + name: 'Decorators', + scope: [ + 'tag.decorator.js entity.name.tag.js', + 'tag.decorator.js punctuation.definition.tag.js' + ], + settings: { + fontStyle: 'italic', + foreground: '#6182B8' + } + }, + { + name: 'meta.method.js', + scope: ['meta.class-method.js entity.name.function.js', 'variable.function.constructor'], + settings: { + foreground: '#6182B8' + } + }, + { + name: 'entity.name.method.js', + scope: ['entity.name.method.js'], + settings: { + fontStyle: 'italic', + foreground: '#6182B8' + } + }, { name: 'Class extends, build-in, dom', scope: [ @@ -8,6 +73,7 @@ module.exports = [ 'support.type.object.module.js', 'support.type.object.dom.js', 'support.constant.math', + 'support.constant.json', 'meta.class.extends.js variable.other.readwrite.js', 'meta.function-call.static.without-arguments.js variable.other.class.js', 'meta.function-call.static.with-arguments.js variable.other.class.js', @@ -42,9 +108,7 @@ module.exports = [ { name: 'js/ts doc email', - scope: [ - 'comment.block.documentation constant.other.email.link.underline.jsdoc' - ], + scope: ['comment.block.documentation constant.other.email.link.underline.jsdoc'], settings: { fontStyle: 'italic underline' } @@ -54,20 +118,46 @@ module.exports = [ name: 'ts string express', scope: [ 'punctuation.definition.template-expression.begin.ts', - 'punctuation.definition.template-expression.end.ts' + 'punctuation.definition.template-expression.end.ts', + 'punctuation.definition.template-expression.begin.js', + 'punctuation.definition.template-expression.end.js' ], settings: { fontStyle: '', foreground: '#ff5370' } }, - + { + name: 'Punctuation', + scope: [ + 'meta.object.member.js meta.array.literal.js meta.brace.square.js', + 'meta.object.member.js meta.arrow.js meta.brace.round.js', + 'string.template.js meta.template.expression.js meta.array.literal.js meta.brace.square.js', + 'string.template.js meta.template.expression.js meta.brace.round.js', + 'string.template.ts meta.template.expression.ts meta.array.literal.ts meta.brace.square.ts', + 'string.template.ts meta.template.expression.ts meta.brace.round.ts' + ], + settings: { + foreground: vars.common + } + }, + { + name: 'Variables', + scope: [ + 'string.template.js meta.template.expression.js support.variable.property.js', + 'string.template.ts meta.template.expression.ts support.variable.property.ts' + ], + settings: { + foreground: vars.common2 + } + }, { name: 'build-in function', scope: [ 'source.js support.function.node.js', 'meta.group.braces.curly.js support.function', 'meta.function-call.ts support.function.ts', + 'meta.function-call.js support.function.js', 'support.function.builtin.js' ], settings: { @@ -123,7 +213,11 @@ module.exports = [ name: 'object keys', scope: [ 'constant.other.object.key.js string.unquoted.label.js', - 'constant.other.object.key.js string.quoted.label.js' + 'constant.other.object.key.js string.quoted.label.js', + 'meta.object.member.js meta.object-literal.key.js string.quoted.double.js', + 'meta.object.member.js meta.object-literal.key.js string.quoted.single.js', + 'meta.object.member.js meta.object-literal.key.js constant.numeric.decimal.js', + 'meta.objectliteral.js meta.object.member.js meta.object-literal.key.js' ], settings: { fontStyle: 'italic bold', diff --git a/themes/color-theme.json b/themes/color-theme.json index dbd9500..12d2929 100644 --- a/themes/color-theme.json +++ b/themes/color-theme.json @@ -88,12 +88,12 @@ "inputValidation.warningBorder": "#FFB62C50", "dropdown.background": "#ffffff", "dropdown.border": "#00000010", - "list.hoverForeground": "#3fc2a7", - "list.hoverBackground": "#80CBC4", - "list.activeSelectionBackground": "#f8f9fd", - "list.activeSelectionForeground": "#80CBC4", - "list.inactiveSelectionForeground": "#80CBC4", + "list.hoverForeground": "#19b491", + "list.hoverBackground": "#80CBC410", + "list.activeSelectionBackground": "#80CBC430", + "list.activeSelectionForeground": "#19b491", "list.inactiveSelectionBackground": "#ccd7da50", + "list.inactiveSelectionForeground": "#80CBC4", "list.focusBackground": "#90A4AE20", "list.focusForeground": "#90a4ae", "list.highlightForeground": "#80CBC4", @@ -229,7 +229,7 @@ }, { "name": "Operator, Misc", - "scope": "keyword.control, meta.tag, punctuation.definition.tag, punctuation.separator.inheritance.php, punctuation.definition.tag.html, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html, punctuation.section.embedded, keyword.other.template, keyword.other.substitution", + "scope": "keyword.control, meta.tag, punctuation.accessor.js, punctuation.definition.tag, punctuation.separator.inheritance.php, punctuation.definition.tag.html, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html, punctuation.section.embedded, keyword.other.template, keyword.other.substitution", "settings": { "foreground": "#ff5370" } @@ -250,7 +250,7 @@ }, { "name": "Function, Special Method, Block Level", - "scope": "entity.name.function, meta.function-call, variable.function, support.function, keyword.other.special-method, meta.block-level", + "scope": "entity.name.function, meta.function-call, variable.function, support.function.js, keyword.other.special-method, meta.block-level", "settings": { "foreground": "#0096ff" } @@ -389,21 +389,6 @@ "foreground": "#e53935" } }, - { - "name": "entity.name.method.js", - "scope": "entity.name.method.js", - "settings": { - "fontStyle": "italic", - "foreground": "#6182B8" - } - }, - { - "name": "meta.method.js", - "scope": "meta.class-method.js entity.name.function.js, variable.function.constructor", - "settings": { - "foreground": "#6182B8" - } - }, { "name": "Attributes", "scope": "entity.other.attribute-name", @@ -446,14 +431,6 @@ "fontStyle": "underline" } }, - { - "name": "Decorators", - "scope": "tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js", - "settings": { - "fontStyle": "italic", - "foreground": "#6182B8" - } - }, { "name": "HTML Attributes", "scope": "text.html.basic entity.other.attribute-name.html, text.html.basic entity.other.attribute-name, text.xhtml.basic entity.other.attribute-name.xhtml, text.xhtml.basic entity.other.attribute-name", @@ -512,9 +489,54 @@ "foreground": "#70acf7" } }, + { + "name": "import constant", + "scope": "meta.import.js variable.other.readwrite.alias.js, meta.import.ts variable.other.readwrite.alias.ts", + "settings": { + "foreground": "#0096ff" + } + }, + { + "name": "import path", + "scope": "meta.import.js string.quoted.single.js, meta.import.js string.quoted.double.js, meta.import.ts string.quoted.single.ts, meta.import.ts string.quoted.double.ts", + "settings": { + "fontStyle": "underline", + "foreground": "#90a4ae" + } + }, + { + "name": "import path", + "scope": "meta.import.js string.quoted.single.js punctuation.definition.string.begin.js, meta.import.js string.quoted.double.js punctuation.definition.string.begin.js, meta.import.js string.quoted.single.js punctuation.definition.string.end.js, meta.import.js string.quoted.double.js punctuation.definition.string.end.js, meta.import.ts string.quoted.single.ts punctuation.definition.string.begin.ts, meta.import.ts string.quoted.double.ts punctuation.definition.string.begin.ts, meta.import.ts string.quoted.single.ts punctuation.definition.string.end.ts, meta.import.ts string.quoted.double.ts punctuation.definition.string.end.ts", + "settings": { + "fontStyle": "none" + } + }, + { + "name": "Decorators", + "scope": "tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js", + "settings": { + "fontStyle": "italic", + "foreground": "#6182B8" + } + }, + { + "name": "meta.method.js", + "scope": "meta.class-method.js entity.name.function.js, variable.function.constructor", + "settings": { + "foreground": "#6182B8" + } + }, + { + "name": "entity.name.method.js", + "scope": "entity.name.method.js", + "settings": { + "fontStyle": "italic", + "foreground": "#6182B8" + } + }, { "name": "Class extends, build-in, dom", - "scope": "support.type.object.console.js, support.type.object.module.js, support.type.object.dom.js, support.constant.math, meta.class.extends.js variable.other.readwrite.js, meta.function-call.static.without-arguments.js variable.other.class.js, meta.function-call.static.with-arguments.js variable.other.class.js, meta.property.class.js variable.other.class.js", + "scope": "support.type.object.console.js, support.type.object.module.js, support.type.object.dom.js, support.constant.math, support.constant.json, meta.class.extends.js variable.other.readwrite.js, meta.function-call.static.without-arguments.js variable.other.class.js, meta.function-call.static.with-arguments.js variable.other.class.js, meta.property.class.js variable.other.class.js", "settings": { "fontStyle": "bold italic", "foreground": "#ffb62c" @@ -545,15 +567,29 @@ }, { "name": "ts string express", - "scope": "punctuation.definition.template-expression.begin.ts, punctuation.definition.template-expression.end.ts", + "scope": "punctuation.definition.template-expression.begin.ts, punctuation.definition.template-expression.end.ts, punctuation.definition.template-expression.begin.js, punctuation.definition.template-expression.end.js", "settings": { "fontStyle": "", "foreground": "#ff5370" } }, + { + "name": "Punctuation", + "scope": "meta.object.member.js meta.array.literal.js meta.brace.square.js, meta.object.member.js meta.arrow.js meta.brace.round.js, string.template.js meta.template.expression.js meta.array.literal.js meta.brace.square.js, string.template.js meta.template.expression.js meta.brace.round.js, string.template.ts meta.template.expression.ts meta.array.literal.ts meta.brace.square.ts, string.template.ts meta.template.expression.ts meta.brace.round.ts", + "settings": { + "foreground": "#90a4ae" + } + }, + { + "name": "Variables", + "scope": "string.template.js meta.template.expression.js support.variable.property.js, string.template.ts meta.template.expression.ts support.variable.property.ts", + "settings": { + "foreground": "#546e7a" + } + }, { "name": "build-in function", - "scope": "source.js support.function.node.js, meta.group.braces.curly.js support.function, meta.function-call.ts support.function.ts, support.function.builtin.js", + "scope": "source.js support.function.node.js, meta.group.braces.curly.js support.function, meta.function-call.ts support.function.ts, meta.function-call.js support.function.js, support.function.builtin.js", "settings": { "fontStyle": "italic", "foreground": "#be7ee7" @@ -584,7 +620,7 @@ }, { "name": "object keys", - "scope": "constant.other.object.key.js string.unquoted.label.js, constant.other.object.key.js string.quoted.label.js", + "scope": "constant.other.object.key.js string.unquoted.label.js, constant.other.object.key.js string.quoted.label.js, meta.object.member.js meta.object-literal.key.js string.quoted.double.js, meta.object.member.js meta.object-literal.key.js string.quoted.single.js, meta.object.member.js meta.object-literal.key.js constant.numeric.decimal.js, meta.objectliteral.js meta.object.member.js meta.object-literal.key.js", "settings": { "fontStyle": "italic bold", "foreground": "#90a4ae"