@adonisjs/repl 3.1.4 → 3.1.8
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/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The MIT License
|
|
2
2
|
|
|
3
|
-
Copyright
|
|
3
|
+
Copyright 2022 Harminder Virk, contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ class ReplProvider {
|
|
|
18
18
|
this.app.container.singleton('Adonis/Addons/Repl', () => {
|
|
19
19
|
const compiler = global[Symbol.for('REQUIRE_TS_COMPILER')];
|
|
20
20
|
const { Repl } = require('../src/Repl');
|
|
21
|
-
return new Repl(compiler, path_1.join(os_1.homedir(), '.adonis_repl_history'));
|
|
21
|
+
return new Repl(compiler, (0, path_1.join)((0, os_1.homedir)(), '.adonis_repl_history'));
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -24,7 +24,7 @@ class Compiler {
|
|
|
24
24
|
* Process the await keywords in the code
|
|
25
25
|
*/
|
|
26
26
|
processAwait(statement) {
|
|
27
|
-
const potentialWrappedCode = node_repl_await_1.processTopLevelAwait(statement);
|
|
27
|
+
const potentialWrappedCode = (0, node_repl_await_1.processTopLevelAwait)(statement);
|
|
28
28
|
if (!potentialWrappedCode) {
|
|
29
29
|
return { compiled: statement, awaitPromise: false };
|
|
30
30
|
}
|
|
@@ -70,7 +70,7 @@ class ImportsParser {
|
|
|
70
70
|
/**
|
|
71
71
|
* Parse all imports in the current line
|
|
72
72
|
*/
|
|
73
|
-
const imports = await parse_imports_1.default(statement);
|
|
73
|
+
const imports = await (0, parse_imports_1.default)(statement);
|
|
74
74
|
const importsAsArray = [...imports];
|
|
75
75
|
return importsAsArray
|
|
76
76
|
.map(({ moduleSpecifier, importClause }) => {
|
package/build/src/Repl/index.js
CHANGED
|
@@ -23,6 +23,7 @@ const Compiler_1 = require("../Compiler");
|
|
|
23
23
|
* ls inspect
|
|
24
24
|
*/
|
|
25
25
|
const GLOBAL_NODE_PROPERTIES = [
|
|
26
|
+
'performance',
|
|
26
27
|
'global',
|
|
27
28
|
'clearInterval',
|
|
28
29
|
'clearTimeout',
|
|
@@ -100,7 +101,7 @@ class Repl {
|
|
|
100
101
|
/**
|
|
101
102
|
* Reference to the colors to print colorful messages
|
|
102
103
|
*/
|
|
103
|
-
this.colors = colors_1.getBest(false);
|
|
104
|
+
this.colors = (0, colors_1.getBest)(false);
|
|
104
105
|
}
|
|
105
106
|
/**
|
|
106
107
|
* Find if the error is recoverable or not
|
|
@@ -183,7 +184,7 @@ class Repl {
|
|
|
183
184
|
* Register "p" method
|
|
184
185
|
*/
|
|
185
186
|
this.addMethod('p', function promisify(_, fn) {
|
|
186
|
-
return util_1.promisify(fn);
|
|
187
|
+
return (0, util_1.promisify)(fn);
|
|
187
188
|
}, {
|
|
188
189
|
description: 'Promisify a function. Similar to Node.js "util.promisify"',
|
|
189
190
|
usage: `p ${this.colors.gray('(function)')}`,
|
|
@@ -262,7 +263,7 @@ class Repl {
|
|
|
262
263
|
}
|
|
263
264
|
return result;
|
|
264
265
|
}, {});
|
|
265
|
-
console.log(util_1.inspect(context, false, 1, true));
|
|
266
|
+
console.log((0, util_1.inspect)(context, false, 1, true));
|
|
266
267
|
}
|
|
267
268
|
/**
|
|
268
269
|
* Prints the context to the console
|
|
@@ -286,7 +287,7 @@ class Repl {
|
|
|
286
287
|
*/
|
|
287
288
|
start() {
|
|
288
289
|
this.printWelcomeMessage();
|
|
289
|
-
this.server = repl_1.start({
|
|
290
|
+
this.server = (0, repl_1.start)({
|
|
290
291
|
prompt: '> ',
|
|
291
292
|
input: process.stdin,
|
|
292
293
|
output: process.stdout,
|
|
@@ -340,7 +341,7 @@ class Repl {
|
|
|
340
341
|
* Register a custom loader function to be added to the context
|
|
341
342
|
*/
|
|
342
343
|
addMethod(name, handler, options) {
|
|
343
|
-
const width = string_width_1.default(options?.usage || name);
|
|
344
|
+
const width = (0, string_width_1.default)(options?.usage || name);
|
|
344
345
|
if (width > this.longestCustomMethodName) {
|
|
345
346
|
this.longestCustomMethodName = width;
|
|
346
347
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/repl",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.8",
|
|
4
4
|
"description": "REPL for AdonisJS",
|
|
5
5
|
"main": "build/providers/ReplProvider.js",
|
|
6
6
|
"files": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"mrm": "mrm --preset=@adonisjs/mrm-preset",
|
|
17
17
|
"pretest": "npm run lint",
|
|
18
|
-
"test": "node
|
|
18
|
+
"test": "node .bin/test.js",
|
|
19
19
|
"clean": "del build",
|
|
20
20
|
"compile": "npm run lint && npm run clean && tsc",
|
|
21
21
|
"build": "npm run compile",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"lint": "eslint . --ext=.ts",
|
|
24
24
|
"format": "prettier --write .",
|
|
25
25
|
"commit": "git-cz",
|
|
26
|
-
"release": "np",
|
|
26
|
+
"release": "np --message=\"chore(release): %s\"",
|
|
27
27
|
"version": "npm run build",
|
|
28
28
|
"sync-labels": "github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json adonisjs/repl"
|
|
29
29
|
},
|
|
@@ -38,28 +38,29 @@
|
|
|
38
38
|
"@adonisjs/core": "^5.1.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@adonisjs/core": "^5.
|
|
42
|
-
"@adonisjs/mrm-preset": "^
|
|
43
|
-
"@adonisjs/require-ts": "^2.0.
|
|
44
|
-
"@poppinss/dev-utils": "^
|
|
45
|
-
"@types/node": "^
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
41
|
+
"@adonisjs/core": "^5.4.2",
|
|
42
|
+
"@adonisjs/mrm-preset": "^5.0.2",
|
|
43
|
+
"@adonisjs/require-ts": "^2.0.9",
|
|
44
|
+
"@poppinss/dev-utils": "^2.0.1",
|
|
45
|
+
"@types/node": "^17.0.9",
|
|
46
|
+
"commitizen": "^4.2.4",
|
|
47
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
48
|
+
"del-cli": "^4.0.1",
|
|
49
|
+
"doctoc": "^2.1.0",
|
|
50
|
+
"eslint": "^8.7.0",
|
|
49
51
|
"eslint-config-prettier": "^8.3.0",
|
|
50
|
-
"eslint-plugin-adonis": "^1.
|
|
51
|
-
"eslint-plugin-prettier": "^
|
|
52
|
-
"github-label-sync": "^2.0.
|
|
53
|
-
"husky": "^
|
|
54
|
-
"japa": "^
|
|
55
|
-
"mrm": "^3.0.
|
|
56
|
-
"np": "^7.
|
|
57
|
-
"prettier": "^2.
|
|
58
|
-
"typescript": "^4.
|
|
52
|
+
"eslint-plugin-adonis": "^2.1.0",
|
|
53
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
54
|
+
"github-label-sync": "^2.0.2",
|
|
55
|
+
"husky": "^7.0.4",
|
|
56
|
+
"japa": "^4.0.0",
|
|
57
|
+
"mrm": "^3.0.10",
|
|
58
|
+
"np": "^7.6.0",
|
|
59
|
+
"prettier": "^2.5.1",
|
|
60
|
+
"typescript": "^4.5.4"
|
|
59
61
|
},
|
|
60
62
|
"husky": {
|
|
61
63
|
"hooks": {
|
|
62
|
-
"pre-commit": "doctoc README.md --title='## Table of contents' && git add README.md",
|
|
63
64
|
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"
|
|
64
65
|
}
|
|
65
66
|
},
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"tag": "latest"
|
|
86
87
|
},
|
|
87
88
|
"dependencies": {
|
|
88
|
-
"@poppinss/colors": "^
|
|
89
|
+
"@poppinss/colors": "^3.0.0",
|
|
89
90
|
"node-repl-await": "^0.1.2",
|
|
90
91
|
"parse-imports": "0.0.5",
|
|
91
92
|
"string-width": "^4.2.2"
|
|
@@ -110,5 +111,48 @@
|
|
|
110
111
|
"@adonisjs/repl/build/commands"
|
|
111
112
|
],
|
|
112
113
|
"types": "@adonisjs/repl"
|
|
114
|
+
},
|
|
115
|
+
"mrmConfig": {
|
|
116
|
+
"core": true,
|
|
117
|
+
"license": "MIT",
|
|
118
|
+
"services": [
|
|
119
|
+
"github-actions"
|
|
120
|
+
],
|
|
121
|
+
"minNodeVersion": "14.15.4",
|
|
122
|
+
"probotApps": [
|
|
123
|
+
"stale",
|
|
124
|
+
"lock"
|
|
125
|
+
],
|
|
126
|
+
"runGhActionsOnWindows": true
|
|
127
|
+
},
|
|
128
|
+
"eslintConfig": {
|
|
129
|
+
"extends": [
|
|
130
|
+
"plugin:adonis/typescriptPackage",
|
|
131
|
+
"prettier"
|
|
132
|
+
],
|
|
133
|
+
"plugins": [
|
|
134
|
+
"prettier"
|
|
135
|
+
],
|
|
136
|
+
"rules": {
|
|
137
|
+
"prettier/prettier": [
|
|
138
|
+
"error",
|
|
139
|
+
{
|
|
140
|
+
"endOfLine": "auto"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"eslintIgnore": [
|
|
146
|
+
"build"
|
|
147
|
+
],
|
|
148
|
+
"prettier": {
|
|
149
|
+
"trailingComma": "es5",
|
|
150
|
+
"semi": false,
|
|
151
|
+
"singleQuote": true,
|
|
152
|
+
"useTabs": false,
|
|
153
|
+
"quoteProps": "consistent",
|
|
154
|
+
"bracketSpacing": true,
|
|
155
|
+
"arrowParens": "always",
|
|
156
|
+
"printWidth": 100
|
|
113
157
|
}
|
|
114
158
|
}
|