@cedarjs/structure 2.2.1 → 2.2.2-next.31

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.
Files changed (126) hide show
  1. package/README.md +8 -24
  2. package/dist/index.d.ts +3 -5
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +8 -23
  5. package/dist/model/RWCell.d.ts +4 -3
  6. package/dist/model/RWCell.d.ts.map +1 -1
  7. package/dist/model/RWCell.js +7 -8
  8. package/dist/model/RWComponent.d.ts +1 -1
  9. package/dist/model/RWComponent.d.ts.map +1 -1
  10. package/dist/model/RWComponent.js +2 -2
  11. package/dist/model/RWEnvHelper.d.ts +3 -7
  12. package/dist/model/RWEnvHelper.d.ts.map +1 -1
  13. package/dist/model/RWEnvHelper.js +33 -114
  14. package/dist/model/RWFunction.d.ts +1 -1
  15. package/dist/model/RWFunction.d.ts.map +1 -1
  16. package/dist/model/RWFunction.js +2 -2
  17. package/dist/model/RWLayout.d.ts +1 -1
  18. package/dist/model/RWLayout.d.ts.map +1 -1
  19. package/dist/model/RWLayout.js +2 -2
  20. package/dist/model/RWPage.d.ts +1 -1
  21. package/dist/model/RWPage.d.ts.map +1 -1
  22. package/dist/model/RWPage.js +2 -2
  23. package/dist/model/RWProject.d.ts +1 -4
  24. package/dist/model/RWProject.d.ts.map +1 -1
  25. package/dist/model/RWProject.js +17 -19
  26. package/dist/model/RWRoute.d.ts +3 -16
  27. package/dist/model/RWRoute.d.ts.map +1 -1
  28. package/dist/model/RWRoute.js +11 -137
  29. package/dist/model/RWRouter.d.ts +2 -6
  30. package/dist/model/RWRouter.d.ts.map +1 -1
  31. package/dist/model/RWRouter.js +10 -62
  32. package/dist/model/RWSDL.d.ts +2 -2
  33. package/dist/model/RWSDL.d.ts.map +1 -1
  34. package/dist/model/RWSDL.js +4 -4
  35. package/dist/model/RWSDLField.d.ts +3 -7
  36. package/dist/model/RWSDLField.d.ts.map +1 -1
  37. package/dist/model/RWSDLField.js +10 -59
  38. package/dist/model/RWService.d.ts +1 -1
  39. package/dist/model/RWService.d.ts.map +1 -1
  40. package/dist/model/RWService.js +2 -2
  41. package/dist/model/RWServiceFunction.d.ts +2 -2
  42. package/dist/model/RWServiceFunction.d.ts.map +1 -1
  43. package/dist/model/RWServiceFunction.js +5 -6
  44. package/dist/model/RWTOML.d.ts +2 -2
  45. package/dist/model/RWTOML.d.ts.map +1 -1
  46. package/dist/model/RWTOML.js +6 -6
  47. package/dist/model/util/process_env.d.ts +9 -18
  48. package/dist/model/util/process_env.d.ts.map +1 -1
  49. package/dist/model/util/process_env.js +25 -34
  50. package/dist/nodes.d.ts +62 -0
  51. package/dist/nodes.d.ts.map +1 -0
  52. package/dist/nodes.js +175 -0
  53. package/dist/x/Location.d.ts +9 -0
  54. package/dist/x/Location.d.ts.map +1 -0
  55. package/dist/x/Location.js +18 -0
  56. package/dist/x/Position.d.ts +12 -0
  57. package/dist/x/Position.d.ts.map +1 -0
  58. package/dist/x/Position.js +35 -0
  59. package/dist/x/Range.d.ts +8 -0
  60. package/dist/x/Range.d.ts.map +1 -0
  61. package/dist/x/Range.js +22 -0
  62. package/dist/x/{vscode-languageserver-types.d.ts → diagnostics.d.ts} +27 -36
  63. package/dist/x/diagnostics.d.ts.map +1 -0
  64. package/dist/x/{vscode-languageserver-types.js → diagnostics.js} +30 -135
  65. package/dist/x/path.d.ts +1 -0
  66. package/dist/x/path.d.ts.map +1 -1
  67. package/dist/x/path.js +25 -17
  68. package/dist/x/prisma.d.ts +2 -3
  69. package/dist/x/prisma.d.ts.map +1 -1
  70. package/dist/x/prisma.js +5 -5
  71. package/package.json +3 -8
  72. package/dist/hosts.d.ts +0 -23
  73. package/dist/hosts.d.ts.map +0 -1
  74. package/dist/hosts.js +0 -44
  75. package/dist/ide.d.ts +0 -122
  76. package/dist/ide.d.ts.map +0 -1
  77. package/dist/ide.js +0 -240
  78. package/dist/interactive_cli/RedwoodCommandString.d.ts +0 -20
  79. package/dist/interactive_cli/RedwoodCommandString.d.ts.map +0 -1
  80. package/dist/interactive_cli/RedwoodCommandString.js +0 -72
  81. package/dist/interactive_cli/command_builder.d.ts +0 -10
  82. package/dist/interactive_cli/command_builder.d.ts.map +0 -1
  83. package/dist/interactive_cli/command_builder.js +0 -196
  84. package/dist/interactive_cli/dry_run.d.ts +0 -28
  85. package/dist/interactive_cli/dry_run.d.ts.map +0 -1
  86. package/dist/interactive_cli/dry_run.js +0 -104
  87. package/dist/interactive_cli/ui.d.ts +0 -32
  88. package/dist/interactive_cli/ui.d.ts.map +0 -1
  89. package/dist/interactive_cli/ui.js +0 -84
  90. package/dist/language_server/RWLanguageServer.d.ts +0 -30
  91. package/dist/language_server/RWLanguageServer.d.ts.map +0 -1
  92. package/dist/language_server/RWLanguageServer.js +0 -201
  93. package/dist/language_server/commands.d.ts +0 -14
  94. package/dist/language_server/commands.d.ts.map +0 -1
  95. package/dist/language_server/commands.js +0 -122
  96. package/dist/language_server/diagnostics.d.ts +0 -10
  97. package/dist/language_server/diagnostics.d.ts.map +0 -1
  98. package/dist/language_server/diagnostics.js +0 -61
  99. package/dist/language_server/outline.d.ts +0 -7
  100. package/dist/language_server/outline.d.ts.map +0 -1
  101. package/dist/language_server/outline.js +0 -37
  102. package/dist/language_server/start.d.ts +0 -2
  103. package/dist/language_server/start.d.ts.map +0 -1
  104. package/dist/language_server/start.js +0 -4
  105. package/dist/language_server/xmethods.d.ts +0 -11
  106. package/dist/language_server/xmethods.d.ts.map +0 -1
  107. package/dist/language_server/xmethods.js +0 -42
  108. package/dist/model/util/advanced_path_parser.d.ts +0 -12
  109. package/dist/model/util/advanced_path_parser.d.ts.map +0 -1
  110. package/dist/model/util/advanced_path_parser.js +0 -38
  111. package/dist/outline/index.d.ts +0 -3
  112. package/dist/outline/index.d.ts.map +0 -1
  113. package/dist/outline/index.js +0 -31
  114. package/dist/outline/outline.d.ts +0 -4
  115. package/dist/outline/outline.d.ts.map +0 -1
  116. package/dist/outline/outline.js +0 -262
  117. package/dist/outline/types.d.ts +0 -87
  118. package/dist/outline/types.d.ts.map +0 -1
  119. package/dist/outline/types.js +0 -72
  120. package/dist/x/vscode-languageserver-types.d.ts.map +0 -1
  121. package/dist/x/vscode-languageserver.d.ts +0 -12
  122. package/dist/x/vscode-languageserver.d.ts.map +0 -1
  123. package/dist/x/vscode-languageserver.js +0 -61
  124. package/dist/x/vscode.d.ts +0 -126
  125. package/dist/x/vscode.d.ts.map +0 -1
  126. package/dist/x/vscode.js +0 -294
@@ -1,196 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.command_builder = command_builder;
9
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/map"));
10
- var _getOwnPropertyDescriptor = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor"));
11
- var _set = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/set"));
12
- var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/applyDecoratedDescriptor"));
13
- var _camelcase = _interopRequireDefault(require("camelcase"));
14
- var _util = require("../util");
15
- var _decorators = require("../x/decorators");
16
- var _RedwoodCommandString = require("./RedwoodCommandString");
17
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class;
18
- function command_builder(opts) {
19
- return new CommandBuilder(opts).buildCommand();
20
- }
21
- let CommandBuilder = (_dec = (0, _decorators.memo)(), _dec2 = (0, _decorators.memo)(), _dec3 = (0, _decorators.lazy)(), _dec4 = (0, _decorators.memo)(), _dec5 = (0, _decorators.memo)(), _dec6 = (0, _decorators.memo)(), _dec7 = (0, _decorators.memo)(), _dec8 = (0, _decorators.memo)(), _class = class CommandBuilder {
22
- constructor(opts) {
23
- this.prompts = void 0;
24
- this.opts = opts;
25
- this.prompts = new PromptHelper(this.opts);
26
- }
27
- async buildCommand() {
28
- if (this.opts.cmd.isComplete) {
29
- // there is no need to build it interactively
30
- return this.opts.cmd;
31
- }
32
- // else, the command is interactive. we run the interactive builder to complete it
33
- const str = await this.buildCommandString();
34
- return str ? new _RedwoodCommandString.RedwoodCommandString(str) : undefined;
35
- }
36
- async buildCommandString() {
37
- try {
38
- switch (await this.arg_command()) {
39
- case 'generate':
40
- return await this.generate(await this.arg_generate_type());
41
- case 'db':
42
- switch (await this.arg_db_operation()) {
43
- case 'save':
44
- {
45
- const name = await this.prompts.prompt('Choose migration name');
46
- return `db save ${name}`;
47
- }
48
- case 'up':
49
- return `db up`;
50
- }
51
- return;
52
- }
53
- } catch (e) {
54
- if (e.message === 'break') {
55
- return;
56
- }
57
- throw e;
58
- }
59
- }
60
- get args() {
61
- var _context;
62
- return (0, _map.default)(_context = this.opts.cmd.parsed._).call(_context, arg => arg.toString());
63
- }
64
- async generate(type) {
65
- switch (type) {
66
- case 'page':
67
- {
68
- const pageName = await this.prompts.prompt('Page Name (ex: Home, about, MyPage, contact)');
69
- const defaultPath = '/' + (0, _camelcase.default)(pageName);
70
- const path = await this.prompts.pagePath(defaultPath);
71
- return `generate page ${pageName} ${path}`;
72
- }
73
- case 'cell':
74
- return `generate cell ${await this.prompts.prompt('Cell Name')}`;
75
- case 'scaffold':
76
- return `generate scaffold ${await this.arg_generate_scaffold_modelName()}`;
77
- case 'component':
78
- return `generate component ${await this.prompts.prompt('Component Name')}`;
79
- case 'layout':
80
- return `generate layout ${await this.prompts.prompt('Layout Name')}`;
81
- case 'sdl':
82
- {
83
- const modelName = await this.arg_generate_sdl_modelName();
84
- const opts = await this.prompts.sdl_options();
85
- if (!opts) {
86
- return;
87
- }
88
- // TODO: serialize options
89
- // services: { type: 'boolean', default: true },
90
- // crud: { type: 'boolean', default: false },
91
- // force: { type: 'boolean', default: false },
92
- return `generate sdl ${modelName}`;
93
- }
94
- }
95
- }
96
- async arg_command() {
97
- return this.args[0] ?? breakIfNull(await this.prompts.command());
98
- }
99
- async arg_generate_type() {
100
- return this.args[1] ?? breakIfNull(await this.prompts.generate_type());
101
- }
102
- async arg_db_operation() {
103
- return this.args[1] ?? breakIfNull(await this.prompts.db_operations());
104
- }
105
- async arg_generate_sdl_modelName() {
106
- return this.args[2] ?? breakIfNull(await this.prompts.model('Choose Model for SDL...'));
107
- }
108
- async arg_generate_scaffold_modelName() {
109
- return this.args[2] ?? breakIfNull(await this.prompts.model('Choose Model to Scaffold...'));
110
- }
111
- }, (0, _applyDecoratedDescriptor2.default)(_class.prototype, "buildCommand", [_dec], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "buildCommand"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "buildCommandString", [_dec2], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "buildCommandString"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "args", [_dec3], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "args"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "arg_command", [_dec4], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "arg_command"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "arg_generate_type", [_dec5], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "arg_generate_type"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "arg_db_operation", [_dec6], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "arg_db_operation"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "arg_generate_sdl_modelName", [_dec7], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "arg_generate_sdl_modelName"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "arg_generate_scaffold_modelName", [_dec8], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "arg_generate_scaffold_modelName"), _class.prototype), _class);
112
- /**
113
- * A set of specialized prompt helpers
114
- * that wrap around the UI methods and sometimes queries the RWProject
115
- */
116
- class PromptHelper {
117
- constructor(opts) {
118
- this.opts = opts;
119
- }
120
-
121
- /**
122
- * prompt for a required (and non-empty) string
123
- * @param msg
124
- */
125
- async prompt(msg) {
126
- let v = await this.opts.ui.prompt(msg);
127
- if (v === '') {
128
- v = undefined;
129
- }
130
- return breakIfNull(v);
131
- }
132
- async command() {
133
- return await this.opts.ui.pickOne(['generate', 'db'],
134
- // TODO: add more commands (this could be generated from the redwoods/cli package)
135
- 'Choose Redwood CLI command');
136
- }
137
- /**
138
- * Pick a model name from schema.prisma
139
- * @param msg
140
- */
141
- async model(msg) {
142
- const models = await this.opts.project.prismaDMMFModelNames();
143
- if (models.length === 0) {
144
- this.opts.ui.info('You must define at least one model in the "schema.prisma" file');
145
- return;
146
- }
147
- return await this.opts.ui.pickOne(models, msg);
148
- }
149
- async sdl_options() {
150
- const opts = await this.opts.ui.pickMany([{
151
- label: 'services',
152
- description: 'generate services',
153
- picked: true
154
- }, {
155
- label: 'crud',
156
- description: 'generate CRUD',
157
- picked: false
158
- }, {
159
- label: 'force',
160
- description: 'overwrite existing files',
161
- picked: false
162
- }], 'Options...');
163
- if (!opts) {
164
- return;
165
- }
166
- return new _set.default(opts);
167
- }
168
- async generate_type() {
169
- return await this.opts.ui.pickOne(generatorTypes, 'Choose Redwood component type to generate');
170
- }
171
- async db_operations() {
172
- return await this.opts.ui.pickOne(dbOperations, 'Choose db command');
173
- }
174
- async pagePath(defaultPath) {
175
- return await this.opts.ui.prompt('path', {
176
- // prompt: "path",
177
- value: defaultPath,
178
- valueSelection: [1, defaultPath.length],
179
- validateInput(path) {
180
- try {
181
- (0, _util.validateRoutePath)(path);
182
- } catch (e) {
183
- return e + '';
184
- }
185
- }
186
- });
187
- }
188
- }
189
- const generatorTypes = ['page', 'cell', 'scaffold', 'component', 'layout', 'sdl', 'service'];
190
- const dbOperations = ['down', 'generate', 'save', 'seed', 'up'];
191
- function breakIfNull(x) {
192
- if (typeof x === 'undefined' || x === null) {
193
- throw new Error('break');
194
- }
195
- return x;
196
- }
@@ -1,28 +0,0 @@
1
- import type { RedwoodCommandString } from './RedwoodCommandString';
2
- export type FileSet = {
3
- [filePath: string]: string | null;
4
- };
5
- interface Opts {
6
- /**
7
- * redwood project root (filepath)
8
- */
9
- cwd: string;
10
- /**
11
- * Command to execute
12
- */
13
- cmd: RedwoodCommandString;
14
- /**
15
- * Files to override
16
- */
17
- fileOverrides?: FileSet;
18
- /**
19
- * directory to store the temporary generated JS script
20
- */
21
- tmpdir?: string;
22
- }
23
- export declare function redwood_gen_dry_run(opts: Opts): Promise<{
24
- stdout: string;
25
- files: FileSet;
26
- }>;
27
- export {};
28
- //# sourceMappingURL=dry_run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dry_run.d.ts","sourceRoot":"","sources":["../../src/interactive_cli/dry_run.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,MAAM,MAAM,OAAO,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAE3D,UAAU,IAAI;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,GAAG,EAAE,oBAAoB,CAAA;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,GACT,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAgC7C"}
@@ -1,104 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.redwood_gen_dry_run = redwood_gen_dry_run;
9
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/json/stringify"));
10
- require("core-js/modules/esnext.json.parse.js");
11
- var _nodeFs = _interopRequireDefault(require("node:fs"));
12
- var _nodePath = _interopRequireDefault(require("node:path"));
13
- var _proxyquire = _interopRequireDefault(require("proxyquire"));
14
- var _child_process = require("../x/child_process");
15
- async function redwood_gen_dry_run(opts) {
16
- const {
17
- cwd,
18
- cmd,
19
- fileOverrides,
20
- tmpdir
21
- } = opts;
22
- if (!cmd.isComplete) {
23
- throw new Error('cannot pass an interactive command straight to the redwood-cli. You must run it through the command_builder first');
24
- }
25
- // eslint-disable-next-line
26
- const x = [_proxyquire.default].length; // we need to make sure this module is required. it will be used in a script we will generate dynamically
27
- const tempDir = tmpdir ?? _nodePath.default.join(cwd, '.tmp');
28
- const jsfile = _nodePath.default.join(tempDir, 'rwcli.js');
29
- const requireStatement = 'proxyquire';
30
- // if (extensionPath) {
31
- // requireStatement = relative(
32
- // dirname(jsfile),
33
- // extensionPath + "/node_modules/proxyquire"
34
- // );
35
- // }
36
- _nodeFs.default.mkdirSync(tempDir, {
37
- recursive: true
38
- });
39
- _nodeFs.default.writeFileSync(jsfile, buildJS(fileOverrides, requireStatement));
40
- const cmdargs = 'node ' + jsfile + ' ' + cmd.processed;
41
- const [cmd2, ...args] = cmdargs.split(' ');
42
- // TODO: use execa?
43
- const {
44
- stdout: out,
45
- stderr
46
- } = await (0, _child_process.spawnCancellable)(cmd2, args, {
47
- cwd
48
- });
49
- if (stderr) {
50
- throw new Error(stderr);
51
- }
52
- //const out = execSync(cmdargs, { cwd: projectRoot })
53
- const [stdout, jsondata] = out.toString().split(separator);
54
- return {
55
- stdout,
56
- files: JSON.parse(jsondata)
57
- };
58
- }
59
- const separator = '---------===----===--------';
60
- function buildJS(fileOverrides = {}, proxyquireRequireStatement = 'proxyquire') {
61
- let js = `
62
- const proxyquire = require("proxyquire")
63
- const fs = require('node:fs')
64
- const path = require('path')
65
- const files = {}
66
- const fileOverrides = { FILE: "OVERRIDES" }
67
- const FILE_SCHEME = 'file://'
68
-
69
- function URL_file(f) {
70
- if (f.startsWith(FILE_SCHEME))
71
- f = f.substr(FILE_SCHEME.length)
72
- return new URL(FILE_SCHEME + path.normalize(f)).href
73
- }
74
-
75
- proxyquire('@cedarjs/cli/dist', {
76
- fs: {
77
- mkdir() {},
78
- mkdirSync(...args) {},
79
- writeFile(a, b) {
80
- files[URL_file(a)] = b
81
- },
82
- writeFileSync(a, b) {
83
- files[URL_file(a)] = b
84
- },
85
- readFileSync(...args) {
86
- const f = URL_file(args[0])
87
- if (fileOverrides[f]) return fileOverrides[f]
88
- return fs.readFileSync.apply(fs, args)
89
- },
90
- '@global': true,
91
- },
92
- })
93
-
94
- process.on('exit', () => {
95
- console.log("__SEPARATOR__")
96
- console.log(JSON.stringify(files, null, 2))
97
- })
98
- `;
99
- // replace some placeholders in the template
100
- js = js.replace(`{ FILE: "OVERRIDES" }`, (0, _stringify.default)(fileOverrides));
101
- js = js.replace(`"__SEPARATOR__"`, (0, _stringify.default)(separator));
102
- js = js.replace(`require("proxyquire")`, `require("${proxyquireRequireStatement}")`);
103
- return js;
104
- }
@@ -1,32 +0,0 @@
1
- import type { VSCodeWindowMethods } from '../x/vscode';
2
- export type UIPickItem = {
3
- label: string;
4
- description?: string;
5
- picked?: boolean;
6
- };
7
- export declare function UIPickItem_normalize(item: UIPickItem | string): UIPickItem;
8
- export interface UI {
9
- info(msg: string): Promise<void>;
10
- prompt(msg: string, opts?: {
11
- value?: string;
12
- valueSelection?: any;
13
- validateInput?: any;
14
- }): Promise<string | undefined>;
15
- pickOne(items: (string | UIPickItem)[], msg: string): Promise<string | undefined>;
16
- pickMany(items: (string | UIPickItem)[], msg: string): Promise<string[] | undefined>;
17
- }
18
- export declare class VSCodeWindowUI implements UI {
19
- private w;
20
- constructor(w: VSCodeWindowMethods);
21
- info(msg: string): Promise<void>;
22
- prompt(msg: string, opts: any): Promise<string | undefined>;
23
- pickOne(items: (string | UIPickItem)[], msg: string): Promise<string | undefined>;
24
- pickMany(items: (string | UIPickItem)[], msg: string): Promise<string[] | undefined>;
25
- }
26
- export declare class CLIUI implements UI {
27
- info(msg: string): Promise<void>;
28
- prompt(msg: string): Promise<string | undefined>;
29
- pickOne(items: (string | UIPickItem)[], msg: string): Promise<string | undefined>;
30
- pickMany(items: (string | UIPickItem)[], msg: string): Promise<string[] | undefined>;
31
- }
32
- //# sourceMappingURL=ui.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/interactive_cli/ui.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,CAE1E;AAED,MAAM,WAAW,EAAE;IACjB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAChC,MAAM,CACJ,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,GAAG,CAAC;QAAC,aAAa,CAAC,EAAE,GAAG,CAAA;KAAE,GACnE,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC9B,OAAO,CACL,KAAK,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,EAC9B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC9B,QAAQ,CACN,KAAK,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,EAC9B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CAAA;CAEjC;AAED,qBAAa,cAAe,YAAW,EAAE;IAC3B,OAAO,CAAC,CAAC;gBAAD,CAAC,EAAE,mBAAmB;IACpC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAGhC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,KAAA,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKtD,OAAO,CACX,KAAK,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,EAC9B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKxB,QAAQ,CACZ,KAAK,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,EAC9B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;CAQjC;AAED,qBAAa,KAAM,YAAW,EAAE;IACxB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAGhC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAQhD,OAAO,CACX,KAAK,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,EAC9B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAUxB,QAAQ,CACZ,KAAK,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,EAC9B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC;CAUjC"}
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
5
- _Object$defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.CLIUI = void 0;
9
- exports.UIPickItem_normalize = UIPickItem_normalize;
10
- exports.VSCodeWindowUI = void 0;
11
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/map"));
12
- var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/bind"));
13
- var _enquirer = _interopRequireDefault(require("enquirer"));
14
- function UIPickItem_normalize(item) {
15
- return typeof item === 'string' ? {
16
- label: item
17
- } : item;
18
- }
19
- class VSCodeWindowUI {
20
- constructor(w) {
21
- this.w = w;
22
- }
23
- async info(msg) {
24
- await this.w.showInformationMessage(msg);
25
- }
26
- async prompt(msg, opts) {
27
- const opts2 = {
28
- ...opts,
29
- prompt: msg
30
- };
31
- return await this.w.showInputBox(opts2);
32
- }
33
- async pickOne(items, msg) {
34
- const items2 = (0, _map.default)(items).call(items, UIPickItem_normalize);
35
- const res = await this.w.showQuickPick(items2, {
36
- placeHolder: msg
37
- });
38
- return res?.label;
39
- }
40
- async pickMany(items, msg) {
41
- var _context, _context2;
42
- const items2 = (0, _map.default)(items).call(items, UIPickItem_normalize);
43
- const res = await this.w.showQuickPick(items2, {
44
- placeHolder: msg,
45
- canPickMany: true
46
- });
47
- return ((_context = res) == null ? void 0 : (0, _bind.default)(_context2 = Function.call).call(_context2, (0, _map.default)(_context), _context))?.(r => r.label);
48
- }
49
- }
50
- exports.VSCodeWindowUI = VSCodeWindowUI;
51
- class CLIUI {
52
- async info(msg) {
53
- console.log(msg);
54
- }
55
- async prompt(msg) {
56
- const res = await _enquirer.default.prompt({
57
- type: 'input',
58
- name: 'x',
59
- message: msg
60
- });
61
- return res['x'];
62
- }
63
- async pickOne(items, msg) {
64
- const items2 = (0, _map.default)(items).call(items, UIPickItem_normalize);
65
- const res = await _enquirer.default.prompt({
66
- type: 'select',
67
- name: 'x',
68
- message: msg,
69
- choices: (0, _map.default)(items2).call(items2, i => i.label)
70
- });
71
- return res['x'];
72
- }
73
- async pickMany(items, msg) {
74
- const items2 = (0, _map.default)(items).call(items, UIPickItem_normalize);
75
- const res = await _enquirer.default.prompt({
76
- type: 'multiselect',
77
- name: 'x',
78
- message: msg,
79
- choices: (0, _map.default)(items2).call(items2, i => i.label)
80
- });
81
- return res['x'];
82
- }
83
- }
84
- exports.CLIUI = CLIUI;
@@ -1,30 +0,0 @@
1
- import type { InitializeParams } from 'vscode-languageserver';
2
- import { TextDocuments } from 'vscode-languageserver';
3
- import { TextDocument } from 'vscode-languageserver-textdocument';
4
- import type { IDEInfo } from '../ide';
5
- import { HostWithDocumentsStore } from '../ide';
6
- import { RWProject } from '../model';
7
- import { CommandsManager } from './commands';
8
- import { DiagnosticsManager } from './diagnostics';
9
- import { OutlineManager } from './outline';
10
- import { XMethodsManager } from './xmethods';
11
- export declare class RWLanguageServer {
12
- initializeParams: InitializeParams;
13
- documents: TextDocuments<TextDocument>;
14
- get connection(): import("vscode-languageserver").Connection<import("vscode-languageserver")._, import("vscode-languageserver")._, import("vscode-languageserver")._, import("vscode-languageserver")._, import("vscode-languageserver")._, import("vscode-languageserver")._, import("vscode-languageserver/lib/callHierarchy.proposed").CallHierarchy & import("vscode-languageserver/lib/sematicTokens.proposed").SemanticTokens>;
15
- start(): void;
16
- get diagnostics(): DiagnosticsManager;
17
- get commands(): CommandsManager;
18
- get outline(): OutlineManager;
19
- get xmethods(): XMethodsManager;
20
- get host(): HostWithDocumentsStore;
21
- projectRoot: string | undefined;
22
- getProject(): RWProject | undefined;
23
- get vscodeWindowMethods(): import("../x/vscode").VSCodeWindowMethods;
24
- collectIDEInfo(uri?: string): Promise<IDEInfo[]>;
25
- info<T extends IDEInfo['kind']>(uri: string, kind: T): Promise<(IDEInfo & {
26
- kind: T;
27
- })[]>;
28
- get hasWorkspaceFolderCapability(): boolean;
29
- }
30
- //# sourceMappingURL=RWLanguageServer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RWLanguageServer.d.ts","sourceRoot":"","sources":["../../src/language_server/RWLanguageServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAGL,aAAa,EAEd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AAGjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAUpC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,qBAAa,gBAAgB;IAC3B,gBAAgB,EAAG,gBAAgB,CAAA;IACnC,SAAS,8BAAkC;IAC3C,IAAY,UAAU,uZAIrB;IACO,KAAK;IAsGb,IAAY,WAAW,uBAEtB;IACD,IAAY,QAAQ,oBAEnB;IACD,IAAY,OAAO,mBAElB;IACD,IAAY,QAAQ,oBAEnB;IACD,IAAY,IAAI,2BAEf;IAED,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,UAAU;IAMV,IAAI,mBAAmB,8CAEtB;IACK,cAAc,CAAC,GAAG,CAAC,EAAE,MAAM;IAG3B,IAAI,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,EAClC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,CAAC,GACN,OAAO,CAAC,CAAC,OAAO,GAAG;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,CAAC,EAAE,CAAC;IAMrC,IAAI,4BAA4B,YAI/B;CACF"}