anl 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/node_modules/commander/lib/command.js +3 -3
- package/lib/package.json.js +1 -1
- package/lib/src/index.js +3 -2
- package/lib/src/utils.js +1 -1
- package/lib/src/vscode.js +32 -0
- package/package.json +1 -1
- package/template/.prettierrc.js +14 -0
- package/template/.stylelintignore +0 -0
- package/template/react-eslint.js +22 -22
- package/template/settings.json +17 -0
- package/template/vue-eslint.js +25 -0
- package/lib/_virtual/_cloneBuffer.js +0 -7
- package/lib/_virtual/_commonjsHelpers.js +0 -7
- package/lib/_virtual/_nodeUtil.js +0 -7
- package/lib/_virtual/eastasianwidth.js +0 -7
- package/lib/_virtual/index2.js +0 -7
- package/lib/_virtual/index3.js +0 -7
- package/lib/_virtual/isBuffer.js +0 -7
- package/lib/_virtual/lodash.js +0 -7
- package/lib/_virtual/signals.js +0 -7
- package/lib/node_modules/ansi-escapes/index.js +0 -166
- package/lib/node_modules/ansi-styles/index.js +0 -229
- package/lib/node_modules/cli-cursor/index.js +0 -47
- package/lib/node_modules/cli-width/index.js +0 -59
- package/lib/node_modules/eastasianwidth/eastasianwidth.js +0 -321
- package/lib/node_modules/figures/index.js +0 -304
- package/lib/node_modules/inquirer/lib/inquirer.js +0 -109
- package/lib/node_modules/inquirer/lib/objects/choice.js +0 -41
- package/lib/node_modules/inquirer/lib/objects/choices.js +0 -125
- package/lib/node_modules/inquirer/lib/objects/separator.js +0 -43
- package/lib/node_modules/inquirer/lib/prompts/base.js +0 -194
- package/lib/node_modules/inquirer/lib/prompts/checkbox.js +0 -283
- package/lib/node_modules/inquirer/lib/prompts/confirm.js +0 -106
- package/lib/node_modules/inquirer/lib/prompts/editor.js +0 -113
- package/lib/node_modules/inquirer/lib/prompts/expand.js +0 -281
- package/lib/node_modules/inquirer/lib/prompts/input.js +0 -118
- package/lib/node_modules/inquirer/lib/prompts/list.js +0 -218
- package/lib/node_modules/inquirer/lib/prompts/number.js +0 -32
- package/lib/node_modules/inquirer/lib/prompts/password.js +0 -135
- package/lib/node_modules/inquirer/lib/prompts/rawlist.js +0 -236
- package/lib/node_modules/inquirer/lib/ui/baseUI.js +0 -99
- package/lib/node_modules/inquirer/lib/ui/bottom-bar.js +0 -103
- package/lib/node_modules/inquirer/lib/ui/prompt.js +0 -158
- package/lib/node_modules/inquirer/lib/utils/events.js +0 -62
- package/lib/node_modules/inquirer/lib/utils/incrementListIndex.js +0 -23
- package/lib/node_modules/inquirer/lib/utils/paginator.js +0 -87
- package/lib/node_modules/inquirer/lib/utils/readline.js +0 -60
- package/lib/node_modules/inquirer/lib/utils/screen-manager.js +0 -183
- package/lib/node_modules/inquirer/lib/utils/utils.js +0 -31
- package/lib/node_modules/inquirer/node_modules/ansi-regex/index.js +0 -14
- package/lib/node_modules/inquirer/node_modules/strip-ansi/index.js +0 -15
- package/lib/node_modules/is-unicode-supported/index.js +0 -27
- package/lib/node_modules/lodash/_DataView.js +0 -16
- package/lib/node_modules/lodash/_Hash.js +0 -44
- package/lib/node_modules/lodash/_ListCache.js +0 -44
- package/lib/node_modules/lodash/_Map.js +0 -16
- package/lib/node_modules/lodash/_MapCache.js +0 -44
- package/lib/node_modules/lodash/_Promise.js +0 -16
- package/lib/node_modules/lodash/_Set.js +0 -16
- package/lib/node_modules/lodash/_Stack.js +0 -40
- package/lib/node_modules/lodash/_Symbol.js +0 -14
- package/lib/node_modules/lodash/_Uint8Array.js +0 -14
- package/lib/node_modules/lodash/_WeakMap.js +0 -16
- package/lib/node_modules/lodash/_apply.js +0 -28
- package/lib/node_modules/lodash/_arrayEach.js +0 -29
- package/lib/node_modules/lodash/_arrayFilter.js +0 -32
- package/lib/node_modules/lodash/_arrayLikeKeys.js +0 -63
- package/lib/node_modules/lodash/_arrayMap.js +0 -28
- package/lib/node_modules/lodash/_arrayPush.js +0 -27
- package/lib/node_modules/lodash/_assignValue.js +0 -37
- package/lib/node_modules/lodash/_assocIndexOf.js +0 -29
- package/lib/node_modules/lodash/_baseAssign.js +0 -26
- package/lib/node_modules/lodash/_baseAssignIn.js +0 -26
- package/lib/node_modules/lodash/_baseAssignValue.js +0 -33
- package/lib/node_modules/lodash/_baseClone.js +0 -197
- package/lib/node_modules/lodash/_baseCreate.js +0 -38
- package/lib/node_modules/lodash/_baseGet.js +0 -33
- package/lib/node_modules/lodash/_baseGetAllKeys.js +0 -29
- package/lib/node_modules/lodash/_baseGetTag.js +0 -38
- package/lib/node_modules/lodash/_baseIsArguments.js +0 -27
- package/lib/node_modules/lodash/_baseIsMap.js +0 -27
- package/lib/node_modules/lodash/_baseIsNative.js +0 -58
- package/lib/node_modules/lodash/_baseIsSet.js +0 -27
- package/lib/node_modules/lodash/_baseIsTypedArray.js +0 -70
- package/lib/node_modules/lodash/_baseKeys.js +0 -39
- package/lib/node_modules/lodash/_baseKeysIn.js +0 -43
- package/lib/node_modules/lodash/_baseRest.js +0 -27
- package/lib/node_modules/lodash/_baseSet.js +0 -63
- package/lib/node_modules/lodash/_baseSetToString.js +0 -32
- package/lib/node_modules/lodash/_baseTimes.js +0 -27
- package/lib/node_modules/lodash/_baseToString.js +0 -48
- package/lib/node_modules/lodash/_baseUnary.js +0 -21
- package/lib/node_modules/lodash/_castPath.js +0 -32
- package/lib/node_modules/lodash/_cloneArrayBuffer.js +0 -24
- package/lib/node_modules/lodash/_cloneBuffer.js +0 -42
- package/lib/node_modules/lodash/_cloneDataView.js +0 -24
- package/lib/node_modules/lodash/_cloneRegExp.js +0 -24
- package/lib/node_modules/lodash/_cloneSymbol.js +0 -26
- package/lib/node_modules/lodash/_cloneTypedArray.js +0 -24
- package/lib/node_modules/lodash/_copyArray.js +0 -27
- package/lib/node_modules/lodash/_copyObject.js +0 -49
- package/lib/node_modules/lodash/_copySymbols.js +0 -25
- package/lib/node_modules/lodash/_copySymbolsIn.js +0 -25
- package/lib/node_modules/lodash/_coreJsData.js +0 -14
- package/lib/node_modules/lodash/_defineProperty.js +0 -19
- package/lib/node_modules/lodash/_freeGlobal.js +0 -13
- package/lib/node_modules/lodash/_getAllKeys.js +0 -26
- package/lib/node_modules/lodash/_getAllKeysIn.js +0 -27
- package/lib/node_modules/lodash/_getMapData.js +0 -26
- package/lib/node_modules/lodash/_getNative.js +0 -26
- package/lib/node_modules/lodash/_getPrototype.js +0 -14
- package/lib/node_modules/lodash/_getRawTag.js +0 -54
- package/lib/node_modules/lodash/_getSymbols.js +0 -39
- package/lib/node_modules/lodash/_getSymbolsIn.js +0 -36
- package/lib/node_modules/lodash/_getTag.js +0 -72
- package/lib/node_modules/lodash/_getValue.js +0 -20
- package/lib/node_modules/lodash/_hashClear.js +0 -23
- package/lib/node_modules/lodash/_hashDelete.js +0 -24
- package/lib/node_modules/lodash/_hashGet.js +0 -38
- package/lib/node_modules/lodash/_hashHas.js +0 -31
- package/lib/node_modules/lodash/_hashSet.js +0 -31
- package/lib/node_modules/lodash/_initCloneArray.js +0 -33
- package/lib/node_modules/lodash/_initCloneByTag.js +0 -89
- package/lib/node_modules/lodash/_initCloneObject.js +0 -28
- package/lib/node_modules/lodash/_isIndex.js +0 -32
- package/lib/node_modules/lodash/_isIterateeCall.js +0 -41
- package/lib/node_modules/lodash/_isKey.js +0 -38
- package/lib/node_modules/lodash/_isKeyable.js +0 -22
- package/lib/node_modules/lodash/_isMasked.js +0 -28
- package/lib/node_modules/lodash/_isPrototype.js +0 -25
- package/lib/node_modules/lodash/_listCacheClear.js +0 -20
- package/lib/node_modules/lodash/_listCacheDelete.js +0 -43
- package/lib/node_modules/lodash/_listCacheGet.js +0 -27
- package/lib/node_modules/lodash/_listCacheHas.js +0 -24
- package/lib/node_modules/lodash/_listCacheSet.js +0 -34
- package/lib/node_modules/lodash/_mapCacheClear.js +0 -31
- package/lib/node_modules/lodash/_mapCacheDelete.js +0 -26
- package/lib/node_modules/lodash/_mapCacheGet.js +0 -24
- package/lib/node_modules/lodash/_mapCacheHas.js +0 -24
- package/lib/node_modules/lodash/_mapCacheSet.js +0 -30
- package/lib/node_modules/lodash/_memoizeCapped.js +0 -34
- package/lib/node_modules/lodash/_nativeCreate.js +0 -14
- package/lib/node_modules/lodash/_nativeKeys.js +0 -14
- package/lib/node_modules/lodash/_nativeKeysIn.js +0 -27
- package/lib/node_modules/lodash/_nodeUtil.js +0 -37
- package/lib/node_modules/lodash/_objectToString.js +0 -29
- package/lib/node_modules/lodash/_overArg.js +0 -22
- package/lib/node_modules/lodash/_overRest.js +0 -44
- package/lib/node_modules/lodash/_root.js +0 -17
- package/lib/node_modules/lodash/_setToString.js +0 -23
- package/lib/node_modules/lodash/_shortOut.js +0 -44
- package/lib/node_modules/lodash/_stackClear.js +0 -23
- package/lib/node_modules/lodash/_stackDelete.js +0 -25
- package/lib/node_modules/lodash/_stackGet.js +0 -21
- package/lib/node_modules/lodash/_stackHas.js +0 -21
- package/lib/node_modules/lodash/_stackSet.js +0 -44
- package/lib/node_modules/lodash/_stringToPath.js +0 -35
- package/lib/node_modules/lodash/_toKey.js +0 -29
- package/lib/node_modules/lodash/_toSource.js +0 -33
- package/lib/node_modules/lodash/clone.js +0 -44
- package/lib/node_modules/lodash/constant.js +0 -33
- package/lib/node_modules/lodash/defaults.js +0 -75
- package/lib/node_modules/lodash/eq.js +0 -44
- package/lib/node_modules/lodash/get.js +0 -41
- package/lib/node_modules/lodash/identity.js +0 -28
- package/lib/node_modules/lodash/isArguments.js +0 -45
- package/lib/node_modules/lodash/isArray.js +0 -33
- package/lib/node_modules/lodash/isArrayLike.js +0 -42
- package/lib/node_modules/lodash/isBuffer.js +0 -46
- package/lib/node_modules/lodash/isFunction.js +0 -46
- package/lib/node_modules/lodash/isLength.js +0 -42
- package/lib/node_modules/lodash/isMap.js +0 -38
- package/lib/node_modules/lodash/isObject.js +0 -38
- package/lib/node_modules/lodash/isObjectLike.js +0 -36
- package/lib/node_modules/lodash/isPlainObject.js +0 -72
- package/lib/node_modules/lodash/isSet.js +0 -38
- package/lib/node_modules/lodash/isSymbol.js +0 -38
- package/lib/node_modules/lodash/isTypedArray.js +0 -38
- package/lib/node_modules/lodash/keys.js +0 -47
- package/lib/node_modules/lodash/keysIn.js +0 -42
- package/lib/node_modules/lodash/lodash.js +0 -17209
- package/lib/node_modules/lodash/memoize.js +0 -81
- package/lib/node_modules/lodash/set.js +0 -43
- package/lib/node_modules/lodash/stubArray.js +0 -30
- package/lib/node_modules/lodash/stubFalse.js +0 -25
- package/lib/node_modules/lodash/toString.js +0 -36
- package/lib/node_modules/mute-stream/mute.js +0 -157
- package/lib/node_modules/restore-cursor/index.js +0 -20
- package/lib/node_modules/run-async/index.js +0 -106
- package/lib/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -107
- package/lib/node_modules/rxjs/dist/esm5/internal/Subject.js +0 -167
- package/lib/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -174
- package/lib/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -150
- package/lib/node_modules/rxjs/dist/esm5/internal/config.js +0 -13
- package/lib/node_modules/rxjs/dist/esm5/internal/observable/ConnectableObservable.js +0 -68
- package/lib/node_modules/rxjs/dist/esm5/internal/observable/defer.js +0 -14
- package/lib/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -16
- package/lib/node_modules/rxjs/dist/esm5/internal/observable/from.js +0 -12
- package/lib/node_modules/rxjs/dist/esm5/internal/observable/fromEvent.js +0 -65
- package/lib/node_modules/rxjs/dist/esm5/internal/observable/fromSubscribable.js +0 -11
- package/lib/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js +0 -155
- package/lib/node_modules/rxjs/dist/esm5/internal/observable/of.js +0 -17
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js +0 -67
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/concatMap.js +0 -12
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/connect.js +0 -23
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/filter.js +0 -15
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/flatMap.js +0 -9
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/map.js +0 -17
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js +0 -67
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js +0 -22
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/multicast.js +0 -19
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js +0 -16
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/publish.js +0 -13
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/reduce.js +0 -12
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/refCount.js +0 -32
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/scanInternals.js +0 -28
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/share.js +0 -91
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js +0 -14
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/take.js +0 -26
- package/lib/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js +0 -17
- package/lib/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js +0 -24
- package/lib/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js +0 -29
- package/lib/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js +0 -38
- package/lib/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js +0 -13
- package/lib/node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js +0 -13
- package/lib/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js +0 -12
- package/lib/node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js +0 -43
- package/lib/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -21
- package/lib/node_modules/rxjs/dist/esm5/internal/symbol/iterator.js +0 -14
- package/lib/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
- package/lib/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js +0 -15
- package/lib/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -18
- package/lib/node_modules/rxjs/dist/esm5/internal/util/args.js +0 -14
- package/lib/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -12
- package/lib/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -16
- package/lib/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -11
- package/lib/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js +0 -23
- package/lib/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -9
- package/lib/node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js +0 -7
- package/lib/node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js +0 -11
- package/lib/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -9
- package/lib/node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js +0 -12
- package/lib/node_modules/rxjs/dist/esm5/internal/util/isIterable.js +0 -12
- package/lib/node_modules/rxjs/dist/esm5/internal/util/isPromise.js +0 -11
- package/lib/node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js +0 -45
- package/lib/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js +0 -11
- package/lib/node_modules/rxjs/dist/esm5/internal/util/lift.js +0 -27
- package/lib/node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js +0 -16
- package/lib/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -7
- package/lib/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -19
- package/lib/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -15
- package/lib/node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js +0 -9
- package/lib/node_modules/signal-exit/index.js +0 -222
- package/lib/node_modules/signal-exit/signals.js +0 -59
- package/lib/node_modules/string-width/index.js +0 -64
- package/lib/node_modules/string-width/node_modules/ansi-regex/index.js +0 -14
- package/lib/node_modules/string-width/node_modules/strip-ansi/index.js +0 -15
- package/lib/node_modules/tslib/tslib.es6.js +0 -145
- package/lib/node_modules/wrap-ansi/index.js +0 -220
- package/lib/node_modules/wrap-ansi/node_modules/ansi-regex/index.js +0 -14
- package/lib/node_modules/wrap-ansi/node_modules/strip-ansi/index.js +0 -15
- package/lib/src/const.js +0 -7
- package/lib/src/install-eslint.js +0 -54
- package/lib/src/lint-init.js +0 -31
|
@@ -6,7 +6,7 @@ var command = require('../../../_virtual/command.js');
|
|
|
6
6
|
var require$$0 = require('events');
|
|
7
7
|
var require$$1 = require('child_process');
|
|
8
8
|
var require$$2 = require('path');
|
|
9
|
-
var
|
|
9
|
+
var require$$3 = require('fs');
|
|
10
10
|
var require$$4 = require('process');
|
|
11
11
|
require('./argument.js');
|
|
12
12
|
require('./error.js');
|
|
@@ -24,13 +24,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
24
24
|
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
25
25
|
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
|
|
26
26
|
var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
|
|
27
|
-
var
|
|
27
|
+
var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3);
|
|
28
28
|
var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);
|
|
29
29
|
|
|
30
30
|
const EventEmitter = require$$0__default["default"].EventEmitter;
|
|
31
31
|
const childProcess = require$$1__default["default"];
|
|
32
32
|
const path = require$$2__default["default"];
|
|
33
|
-
const fs =
|
|
33
|
+
const fs = require$$3__default["default"];
|
|
34
34
|
const process = require$$4__default["default"];
|
|
35
35
|
|
|
36
36
|
const { Argument, humanReadableArgName } = argument.__exports;
|
package/lib/package.json.js
CHANGED
package/lib/src/index.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var esm = require('../node_modules/commander/esm.mjs.js');
|
|
4
4
|
var _package = require('../package.json.js');
|
|
5
|
-
var
|
|
5
|
+
var vscode = require('./vscode.js');
|
|
6
6
|
|
|
7
7
|
esm.program.version(`${_package["default"].version}`, '-v --version').usage('<command> [options]');
|
|
8
8
|
esm.program
|
|
9
9
|
.command('lint')
|
|
10
10
|
.description('install eslint, prettier, commitlint')
|
|
11
|
-
.action(() =>
|
|
11
|
+
// .action(() => lintHandle());
|
|
12
|
+
.action(() => vscode["default"]());
|
|
12
13
|
esm.program.parse(process.argv);
|
package/lib/src/utils.js
CHANGED
|
@@ -14,7 +14,7 @@ var ora__default = /*#__PURE__*/_interopDefaultLegacy(ora);
|
|
|
14
14
|
const SP = ora__default["default"]();
|
|
15
15
|
const spinner = {
|
|
16
16
|
stop: () => SP.stop(),
|
|
17
|
-
error: (msg) => SP.fail(chalk__default["default"].red(msg)),
|
|
17
|
+
error: (msg) => SP.fail(`❌ ${chalk__default["default"].red(msg)}`),
|
|
18
18
|
start: (msg) => {
|
|
19
19
|
SP.text = chalk__default["default"].blue(msg);
|
|
20
20
|
SP.start();
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var require$$1 = require('child_process');
|
|
6
|
+
var require$$3 = require('fs');
|
|
7
|
+
var _package = require('../package.json.js');
|
|
8
|
+
var utils = require('./utils.js');
|
|
9
|
+
|
|
10
|
+
const vscodeHandle = () => {
|
|
11
|
+
const setting_path = `${process.cwd()}/.vscode/settings.json`;
|
|
12
|
+
if (require$$3.existsSync(setting_path)) {
|
|
13
|
+
const readData = require$$3.readFileSync(setting_path, 'utf-8');
|
|
14
|
+
const parsedData = JSON.parse(readData);
|
|
15
|
+
parsedData['editor.formatOnSave'] = true;
|
|
16
|
+
parsedData['editor.defaultFormatter'] = 'esbenp.prettier-vscode';
|
|
17
|
+
const writeData = JSON.stringify(parsedData, null, '\t');
|
|
18
|
+
require$$3.writeFileSync(setting_path, writeData);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const rootPath = require$$1.exec('npm root -g');
|
|
22
|
+
rootPath.stdout?.on('data', (data) => {
|
|
23
|
+
require$$3.copyFileSync(`${data.trim()}/${_package["default"].name}/template/settings.json`, `${process.cwd()}/.vscode/settings.json`);
|
|
24
|
+
utils.spinner.success('✨ .vscode/settings.json file write success');
|
|
25
|
+
});
|
|
26
|
+
rootPath.stderr?.on('data', () => {
|
|
27
|
+
utils.spinner.error('.vscode/settings.json file write fail');
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports["default"] = vscodeHandle;
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
printWidth: 80,
|
|
3
|
+
tabWidth: 2,
|
|
4
|
+
useTabs: true,
|
|
5
|
+
semi: true,
|
|
6
|
+
singleQuote: true,
|
|
7
|
+
quoteProps: "as-needed",
|
|
8
|
+
trailingComma: "none",
|
|
9
|
+
bracketSpacing: true,
|
|
10
|
+
arrowParens: "always",
|
|
11
|
+
rangeStart: 0,
|
|
12
|
+
proseWrap: "preserve",
|
|
13
|
+
htmlWhitespaceSensitivity: "css"
|
|
14
|
+
}
|
|
File without changes
|
package/template/react-eslint.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"eslint:recommended",
|
|
8
|
+
"plugin:react/recommended",
|
|
9
|
+
"plugin:@typescript-eslint/recommended",
|
|
10
|
+
"prettier"
|
|
11
|
+
],
|
|
12
|
+
"overrides": [],
|
|
13
|
+
"parser": "@typescript-eslint/parser",
|
|
14
|
+
"parserOptions": {
|
|
15
|
+
"ecmaVersion": "latest",
|
|
16
|
+
"sourceType": "module"
|
|
17
|
+
},
|
|
18
|
+
"plugins": [
|
|
19
|
+
"react",
|
|
20
|
+
"@typescript-eslint"
|
|
21
|
+
],
|
|
22
|
+
"rules": {
|
|
23
|
+
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": true,
|
|
3
|
+
"[javascript]": {
|
|
4
|
+
"editor.defaultFormatter": "vscode.typescript-language-features"
|
|
5
|
+
},
|
|
6
|
+
"[typescript]": {
|
|
7
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
8
|
+
},
|
|
9
|
+
"[json]": {
|
|
10
|
+
"editor.quickSuggestions": {
|
|
11
|
+
"strings": true
|
|
12
|
+
},
|
|
13
|
+
"editor.suggest.insertMode": "replace",
|
|
14
|
+
"gitlens.codeLens.scopes": ["document"],
|
|
15
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": true,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"eslint:recommended",
|
|
8
|
+
"plugin:vue/vue3-essential",
|
|
9
|
+
"plugin:@typescript-eslint/recommended",
|
|
10
|
+
"prettier"
|
|
11
|
+
],
|
|
12
|
+
"overrides": [
|
|
13
|
+
],
|
|
14
|
+
"parser": "@typescript-eslint/parser",
|
|
15
|
+
"parserOptions": {
|
|
16
|
+
"ecmaVersion": "latest",
|
|
17
|
+
"sourceType": "module"
|
|
18
|
+
},
|
|
19
|
+
"plugins": [
|
|
20
|
+
"vue",
|
|
21
|
+
"@typescript-eslint"
|
|
22
|
+
],
|
|
23
|
+
"rules": {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
|
-
|
|
7
|
-
exports.commonjsGlobal = commonjsGlobal;
|
package/lib/_virtual/index2.js
DELETED
package/lib/_virtual/index3.js
DELETED
package/lib/_virtual/isBuffer.js
DELETED
package/lib/_virtual/lodash.js
DELETED
package/lib/_virtual/signals.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var process = require('node:process');
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var process__default = /*#__PURE__*/_interopDefaultLegacy(process);
|
|
10
|
-
|
|
11
|
-
const ESC = '\u001B[';
|
|
12
|
-
const OSC = '\u001B]';
|
|
13
|
-
const BEL = '\u0007';
|
|
14
|
-
const SEP = ';';
|
|
15
|
-
|
|
16
|
-
const isTerminalApp = process__default["default"].env.TERM_PROGRAM === 'Apple_Terminal';
|
|
17
|
-
|
|
18
|
-
const ansiEscapes = {};
|
|
19
|
-
|
|
20
|
-
ansiEscapes.cursorTo = (x, y) => {
|
|
21
|
-
if (typeof x !== 'number') {
|
|
22
|
-
throw new TypeError('The `x` argument is required');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (typeof y !== 'number') {
|
|
26
|
-
return ESC + (x + 1) + 'G';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return ESC + (y + 1) + SEP + (x + 1) + 'H';
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
ansiEscapes.cursorMove = (x, y) => {
|
|
33
|
-
if (typeof x !== 'number') {
|
|
34
|
-
throw new TypeError('The `x` argument is required');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let returnValue = '';
|
|
38
|
-
|
|
39
|
-
if (x < 0) {
|
|
40
|
-
returnValue += ESC + (-x) + 'D';
|
|
41
|
-
} else if (x > 0) {
|
|
42
|
-
returnValue += ESC + x + 'C';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (y < 0) {
|
|
46
|
-
returnValue += ESC + (-y) + 'A';
|
|
47
|
-
} else if (y > 0) {
|
|
48
|
-
returnValue += ESC + y + 'B';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return returnValue;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
ansiEscapes.cursorUp = (count = 1) => ESC + count + 'A';
|
|
55
|
-
ansiEscapes.cursorDown = (count = 1) => ESC + count + 'B';
|
|
56
|
-
ansiEscapes.cursorForward = (count = 1) => ESC + count + 'C';
|
|
57
|
-
ansiEscapes.cursorBackward = (count = 1) => ESC + count + 'D';
|
|
58
|
-
|
|
59
|
-
ansiEscapes.cursorLeft = ESC + 'G';
|
|
60
|
-
ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : ESC + 's';
|
|
61
|
-
ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : ESC + 'u';
|
|
62
|
-
ansiEscapes.cursorGetPosition = ESC + '6n';
|
|
63
|
-
ansiEscapes.cursorNextLine = ESC + 'E';
|
|
64
|
-
ansiEscapes.cursorPrevLine = ESC + 'F';
|
|
65
|
-
ansiEscapes.cursorHide = ESC + '?25l';
|
|
66
|
-
ansiEscapes.cursorShow = ESC + '?25h';
|
|
67
|
-
|
|
68
|
-
ansiEscapes.eraseLines = count => {
|
|
69
|
-
let clear = '';
|
|
70
|
-
|
|
71
|
-
for (let i = 0; i < count; i++) {
|
|
72
|
-
clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : '');
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (count) {
|
|
76
|
-
clear += ansiEscapes.cursorLeft;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return clear;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
ansiEscapes.eraseEndLine = ESC + 'K';
|
|
83
|
-
ansiEscapes.eraseStartLine = ESC + '1K';
|
|
84
|
-
ansiEscapes.eraseLine = ESC + '2K';
|
|
85
|
-
ansiEscapes.eraseDown = ESC + 'J';
|
|
86
|
-
ansiEscapes.eraseUp = ESC + '1J';
|
|
87
|
-
ansiEscapes.eraseScreen = ESC + '2J';
|
|
88
|
-
ansiEscapes.scrollUp = ESC + 'S';
|
|
89
|
-
ansiEscapes.scrollDown = ESC + 'T';
|
|
90
|
-
|
|
91
|
-
ansiEscapes.clearScreen = '\u001Bc';
|
|
92
|
-
|
|
93
|
-
ansiEscapes.clearTerminal = process__default["default"].platform === 'win32'
|
|
94
|
-
? `${ansiEscapes.eraseScreen}${ESC}0f`
|
|
95
|
-
// 1. Erases the screen (Only done in case `2` is not supported)
|
|
96
|
-
// 2. Erases the whole screen including scrollback buffer
|
|
97
|
-
// 3. Moves cursor to the top-left position
|
|
98
|
-
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
|
99
|
-
: `${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
|
|
100
|
-
|
|
101
|
-
ansiEscapes.beep = BEL;
|
|
102
|
-
|
|
103
|
-
ansiEscapes.link = (text, url) => [
|
|
104
|
-
OSC,
|
|
105
|
-
'8',
|
|
106
|
-
SEP,
|
|
107
|
-
SEP,
|
|
108
|
-
url,
|
|
109
|
-
BEL,
|
|
110
|
-
text,
|
|
111
|
-
OSC,
|
|
112
|
-
'8',
|
|
113
|
-
SEP,
|
|
114
|
-
SEP,
|
|
115
|
-
BEL,
|
|
116
|
-
].join('');
|
|
117
|
-
|
|
118
|
-
ansiEscapes.image = (buffer, options = {}) => {
|
|
119
|
-
let returnValue = `${OSC}1337;File=inline=1`;
|
|
120
|
-
|
|
121
|
-
if (options.width) {
|
|
122
|
-
returnValue += `;width=${options.width}`;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (options.height) {
|
|
126
|
-
returnValue += `;height=${options.height}`;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (options.preserveAspectRatio === false) {
|
|
130
|
-
returnValue += ';preserveAspectRatio=0';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return returnValue + ':' + buffer.toString('base64') + BEL;
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
ansiEscapes.iTerm = {
|
|
137
|
-
setCwd: (cwd = process__default["default"].cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
|
|
138
|
-
|
|
139
|
-
annotation(message, options = {}) {
|
|
140
|
-
let returnValue = `${OSC}1337;`;
|
|
141
|
-
|
|
142
|
-
const hasX = typeof options.x !== 'undefined';
|
|
143
|
-
const hasY = typeof options.y !== 'undefined';
|
|
144
|
-
if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== 'undefined')) {
|
|
145
|
-
throw new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
message = message.replace(/\|/g, '');
|
|
149
|
-
|
|
150
|
-
returnValue += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';
|
|
151
|
-
|
|
152
|
-
if (options.length > 0) {
|
|
153
|
-
returnValue += (
|
|
154
|
-
hasX
|
|
155
|
-
? [message, options.length, options.x, options.y]
|
|
156
|
-
: [options.length, message]
|
|
157
|
-
).join('|');
|
|
158
|
-
} else {
|
|
159
|
-
returnValue += message;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return returnValue + BEL;
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
exports["default"] = ansiEscapes;
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const ANSI_BACKGROUND_OFFSET = 10;
|
|
6
|
-
|
|
7
|
-
const wrapAnsi16 = (offset = 0) => code => `\u001B[${code + offset}m`;
|
|
8
|
-
|
|
9
|
-
const wrapAnsi256 = (offset = 0) => code => `\u001B[${38 + offset};5;${code}m`;
|
|
10
|
-
|
|
11
|
-
const wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
|
|
12
|
-
|
|
13
|
-
const styles = {
|
|
14
|
-
modifier: {
|
|
15
|
-
reset: [0, 0],
|
|
16
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
17
|
-
bold: [1, 22],
|
|
18
|
-
dim: [2, 22],
|
|
19
|
-
italic: [3, 23],
|
|
20
|
-
underline: [4, 24],
|
|
21
|
-
overline: [53, 55],
|
|
22
|
-
inverse: [7, 27],
|
|
23
|
-
hidden: [8, 28],
|
|
24
|
-
strikethrough: [9, 29],
|
|
25
|
-
},
|
|
26
|
-
color: {
|
|
27
|
-
black: [30, 39],
|
|
28
|
-
red: [31, 39],
|
|
29
|
-
green: [32, 39],
|
|
30
|
-
yellow: [33, 39],
|
|
31
|
-
blue: [34, 39],
|
|
32
|
-
magenta: [35, 39],
|
|
33
|
-
cyan: [36, 39],
|
|
34
|
-
white: [37, 39],
|
|
35
|
-
|
|
36
|
-
// Bright color
|
|
37
|
-
blackBright: [90, 39],
|
|
38
|
-
gray: [90, 39], // Alias of `blackBright`
|
|
39
|
-
grey: [90, 39], // Alias of `blackBright`
|
|
40
|
-
redBright: [91, 39],
|
|
41
|
-
greenBright: [92, 39],
|
|
42
|
-
yellowBright: [93, 39],
|
|
43
|
-
blueBright: [94, 39],
|
|
44
|
-
magentaBright: [95, 39],
|
|
45
|
-
cyanBright: [96, 39],
|
|
46
|
-
whiteBright: [97, 39],
|
|
47
|
-
},
|
|
48
|
-
bgColor: {
|
|
49
|
-
bgBlack: [40, 49],
|
|
50
|
-
bgRed: [41, 49],
|
|
51
|
-
bgGreen: [42, 49],
|
|
52
|
-
bgYellow: [43, 49],
|
|
53
|
-
bgBlue: [44, 49],
|
|
54
|
-
bgMagenta: [45, 49],
|
|
55
|
-
bgCyan: [46, 49],
|
|
56
|
-
bgWhite: [47, 49],
|
|
57
|
-
|
|
58
|
-
// Bright color
|
|
59
|
-
bgBlackBright: [100, 49],
|
|
60
|
-
bgGray: [100, 49], // Alias of `bgBlackBright`
|
|
61
|
-
bgGrey: [100, 49], // Alias of `bgBlackBright`
|
|
62
|
-
bgRedBright: [101, 49],
|
|
63
|
-
bgGreenBright: [102, 49],
|
|
64
|
-
bgYellowBright: [103, 49],
|
|
65
|
-
bgBlueBright: [104, 49],
|
|
66
|
-
bgMagentaBright: [105, 49],
|
|
67
|
-
bgCyanBright: [106, 49],
|
|
68
|
-
bgWhiteBright: [107, 49],
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
Object.keys(styles.modifier);
|
|
73
|
-
const foregroundColorNames = Object.keys(styles.color);
|
|
74
|
-
const backgroundColorNames = Object.keys(styles.bgColor);
|
|
75
|
-
[...foregroundColorNames, ...backgroundColorNames];
|
|
76
|
-
|
|
77
|
-
function assembleStyles() {
|
|
78
|
-
const codes = new Map();
|
|
79
|
-
|
|
80
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
81
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
82
|
-
styles[styleName] = {
|
|
83
|
-
open: `\u001B[${style[0]}m`,
|
|
84
|
-
close: `\u001B[${style[1]}m`,
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
group[styleName] = styles[styleName];
|
|
88
|
-
|
|
89
|
-
codes.set(style[0], style[1]);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
Object.defineProperty(styles, groupName, {
|
|
93
|
-
value: group,
|
|
94
|
-
enumerable: false,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
Object.defineProperty(styles, 'codes', {
|
|
99
|
-
value: codes,
|
|
100
|
-
enumerable: false,
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
styles.color.close = '\u001B[39m';
|
|
104
|
-
styles.bgColor.close = '\u001B[49m';
|
|
105
|
-
|
|
106
|
-
styles.color.ansi = wrapAnsi16();
|
|
107
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
108
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
109
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
110
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
111
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
112
|
-
|
|
113
|
-
// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js
|
|
114
|
-
Object.defineProperties(styles, {
|
|
115
|
-
rgbToAnsi256: {
|
|
116
|
-
value: (red, green, blue) => {
|
|
117
|
-
// We use the extended greyscale palette here, with the exception of
|
|
118
|
-
// black and white. normal palette only has 4 greyscale shades.
|
|
119
|
-
if (red === green && green === blue) {
|
|
120
|
-
if (red < 8) {
|
|
121
|
-
return 16;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (red > 248) {
|
|
125
|
-
return 231;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return Math.round(((red - 8) / 247) * 24) + 232;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return 16
|
|
132
|
-
+ (36 * Math.round(red / 255 * 5))
|
|
133
|
-
+ (6 * Math.round(green / 255 * 5))
|
|
134
|
-
+ Math.round(blue / 255 * 5);
|
|
135
|
-
},
|
|
136
|
-
enumerable: false,
|
|
137
|
-
},
|
|
138
|
-
hexToRgb: {
|
|
139
|
-
value: hex => {
|
|
140
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
141
|
-
if (!matches) {
|
|
142
|
-
return [0, 0, 0];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
let [colorString] = matches;
|
|
146
|
-
|
|
147
|
-
if (colorString.length === 3) {
|
|
148
|
-
colorString = [...colorString].map(character => character + character).join('');
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const integer = Number.parseInt(colorString, 16);
|
|
152
|
-
|
|
153
|
-
return [
|
|
154
|
-
/* eslint-disable no-bitwise */
|
|
155
|
-
(integer >> 16) & 0xFF,
|
|
156
|
-
(integer >> 8) & 0xFF,
|
|
157
|
-
integer & 0xFF,
|
|
158
|
-
/* eslint-enable no-bitwise */
|
|
159
|
-
];
|
|
160
|
-
},
|
|
161
|
-
enumerable: false,
|
|
162
|
-
},
|
|
163
|
-
hexToAnsi256: {
|
|
164
|
-
value: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
165
|
-
enumerable: false,
|
|
166
|
-
},
|
|
167
|
-
ansi256ToAnsi: {
|
|
168
|
-
value: code => {
|
|
169
|
-
if (code < 8) {
|
|
170
|
-
return 30 + code;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (code < 16) {
|
|
174
|
-
return 90 + (code - 8);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
let red;
|
|
178
|
-
let green;
|
|
179
|
-
let blue;
|
|
180
|
-
|
|
181
|
-
if (code >= 232) {
|
|
182
|
-
red = (((code - 232) * 10) + 8) / 255;
|
|
183
|
-
green = red;
|
|
184
|
-
blue = red;
|
|
185
|
-
} else {
|
|
186
|
-
code -= 16;
|
|
187
|
-
|
|
188
|
-
const remainder = code % 36;
|
|
189
|
-
|
|
190
|
-
red = Math.floor(code / 36) / 5;
|
|
191
|
-
green = Math.floor(remainder / 6) / 5;
|
|
192
|
-
blue = (remainder % 6) / 5;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const value = Math.max(red, green, blue) * 2;
|
|
196
|
-
|
|
197
|
-
if (value === 0) {
|
|
198
|
-
return 30;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// eslint-disable-next-line no-bitwise
|
|
202
|
-
let result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));
|
|
203
|
-
|
|
204
|
-
if (value === 2) {
|
|
205
|
-
result += 60;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return result;
|
|
209
|
-
},
|
|
210
|
-
enumerable: false,
|
|
211
|
-
},
|
|
212
|
-
rgbToAnsi: {
|
|
213
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
214
|
-
enumerable: false,
|
|
215
|
-
},
|
|
216
|
-
hexToAnsi: {
|
|
217
|
-
value: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
218
|
-
enumerable: false,
|
|
219
|
-
},
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
return styles;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
const ansiStyles = assembleStyles();
|
|
226
|
-
|
|
227
|
-
exports.backgroundColorNames = backgroundColorNames;
|
|
228
|
-
exports["default"] = ansiStyles;
|
|
229
|
-
exports.foregroundColorNames = foregroundColorNames;
|