@cedarjs/structure 2.2.2-next.0 → 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
package/dist/x/vscode.js DELETED
@@ -1,294 +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_cli = Command_cli;
9
- exports.Command_open = Command_open;
10
- exports.ProviderResult_normalize = ProviderResult_normalize;
11
- exports.RemoteTreeDataProviderImpl = void 0;
12
- exports.RemoteTreeDataProvider_publishOverLSPConnection = RemoteTreeDataProvider_publishOverLSPConnection;
13
- exports.TreeItemCollapsibleState2 = exports.TreeItem2Wrapper = void 0;
14
- exports.VSCodeWindowMethods_fromConnection = VSCodeWindowMethods_fromConnection;
15
- require("core-js/modules/es.array.push.js");
16
- require("core-js/modules/esnext.json.parse.js");
17
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/json/stringify"));
18
- var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/keys"));
19
- var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/map"));
20
- var _getOwnPropertyDescriptor = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor"));
21
- var _setInterval2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/set-interval"));
22
- var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/bind"));
23
- var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/starts-with"));
24
- var _trim = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/trim"));
25
- var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/applyDecoratedDescriptor"));
26
- var _lodash = require("lodash");
27
- var _vscodeLanguageserverTypes = require("vscode-languageserver-types");
28
- var _decorators = require("../x/decorators");
29
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _dec9, _class2; // vscode is a compile-time only dependency
30
- // we only use it in type declarations
31
- // (we can't use "import type" since we need to do use it in some typeof expressions)
32
- function VSCodeWindowMethods_fromConnection(connection) {
33
- return new VSCodeWindowMethodsWrapper(connection);
34
- }
35
-
36
- /**
37
- * these methods are exposed by decoupled studio only
38
- */
39
- class VSCodeWindowMethodsWrapper {
40
- constructor(connection) {
41
- this.connection = connection;
42
- }
43
- showQuickPick(...args) {
44
- return this.connection.sendRequest('xxx/showQuickPick', args);
45
- }
46
- showInformationMessage(...args) {
47
- return this.connection.sendRequest('xxx/showInformationMessage', args);
48
- }
49
- showInputBox(...args) {
50
- return this.connection.sendRequest('xxx/showInputBox', args);
51
- }
52
- createTerminal2(props) {
53
- return this.connection.sendRequest('xxx/createTerminal2', [props]);
54
- }
55
- withProgress(_options, task) {
56
- // TODO:
57
- return task();
58
- }
59
- }
60
-
61
- /**
62
- * menus types must be known beforehand.
63
- * they are set up by the vscode extension in its package.json
64
- */
65
-
66
- /**
67
- * Based on the actual TreeItem interface provided by VSCode.
68
- * It has a few differences.
69
- */
70
- let TreeItem2Wrapper = exports.TreeItem2Wrapper = (_dec = (0, _decorators.lazy)(), _dec2 = (0, _decorators.lazy)(), _dec3 = (0, _decorators.lazy)(), _dec4 = (0, _decorators.lazy)(), _dec5 = (0, _decorators.memo)(), _dec6 = (0, _decorators.memo)(), _dec7 = (0, _decorators.memo)(_stringify.default), _dec8 = (0, _decorators.lazy)(), _class = class TreeItem2Wrapper {
71
- constructor(item, parent, indexInParent = 0) {
72
- this.item = item;
73
- this.parent = parent;
74
- this.indexInParent = indexInParent;
75
- }
76
- get keys() {
77
- var _context;
78
- if (!this.parent) {
79
- return [];
80
- }
81
- return [...(((_context = this.parent) == null ? void 0 : (0, _keys.default)(_context)) ?? []), this.key];
82
- }
83
- get key() {
84
- const {
85
- indexInParent,
86
- item: {
87
- key,
88
- label
89
- }
90
- } = this;
91
- if (key) {
92
- return key;
93
- }
94
- return (label ?? '') + '-' + indexInParent;
95
- }
96
- get id() {
97
- return (0, _stringify.default)((0, _keys.default)(this));
98
- }
99
- get collapsibleState() {
100
- return this.item.collapsibleState ?? (this.item.children ? TreeItemCollapsibleState2.Collapsed : TreeItemCollapsibleState2.None);
101
- }
102
- async children() {
103
- var _context2;
104
- const cs = await ProviderResult_normalize(this.item.children?.());
105
- return (0, _map.default)(_context2 = cs ?? []).call(_context2, (c, i) => new TreeItem2Wrapper(c, this, i));
106
- }
107
- async findChild(key) {
108
- for (const c of await this.children()) {
109
- if (c.key === key) {
110
- return c;
111
- }
112
- }
113
- }
114
- async findChildRec(keys) {
115
- if (keys.length === 0) {
116
- return this;
117
- }
118
- const [k, ...rest] = keys;
119
- return await (await this.findChild(k))?.findChildRec(rest);
120
- }
121
- get serializableTreeItem() {
122
- return {
123
- ...this.item,
124
- id: this.id,
125
- collapsibleState: this.collapsibleState
126
- };
127
- }
128
- }, (0, _applyDecoratedDescriptor2.default)(_class.prototype, "keys", [_dec], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "keys"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "key", [_dec2], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "key"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "id", [_dec3], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "id"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "collapsibleState", [_dec4], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "collapsibleState"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "children", [_dec5], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "children"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "findChild", [_dec6], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "findChild"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "findChildRec", [_dec7], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "findChildRec"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "serializableTreeItem", [_dec8], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "serializableTreeItem"), _class.prototype), _class);
129
- /**
130
- * https://microsoft.github.io/vscode-codicons/dist/codicon.html
131
- * plust a few extra icons provided by decoupled studio:
132
- * - redwood
133
- * - prisma
134
- * - graphql
135
- * - netlify
136
- */
137
- /**
138
- * A copy of vscode.TreeItemCollapsibleState
139
- * we don't want to have a runtime dependency on the vscode package
140
- */
141
- let TreeItemCollapsibleState2 = exports.TreeItemCollapsibleState2 = /*#__PURE__*/function (TreeItemCollapsibleState2) {
142
- /**
143
- * Determines an item can be neither collapsed nor expanded. Implies it has no children.
144
- */
145
- TreeItemCollapsibleState2[TreeItemCollapsibleState2["None"] = 0] = "None";
146
- /**
147
- * Determines an item is collapsed
148
- */
149
- TreeItemCollapsibleState2[TreeItemCollapsibleState2["Collapsed"] = 1] = "Collapsed";
150
- /**
151
- * Determines an item is expanded
152
- */
153
- TreeItemCollapsibleState2[TreeItemCollapsibleState2["Expanded"] = 2] = "Expanded";
154
- return TreeItemCollapsibleState2;
155
- }({});
156
- /**
157
- * A vscode.TreeDataProvider that uses string IDs as elements
158
- * and returns a SerializableTreeItem.
159
- */
160
- let RemoteTreeDataProviderImpl = exports.RemoteTreeDataProviderImpl = (_dec9 = (0, _decorators.memo)(), _class2 = class RemoteTreeDataProviderImpl {
161
- constructor(getRoot, refreshInterval = 5000) {
162
- this.root = void 0;
163
- // ----- start TreeDataProvider impl
164
- this.listeners = [];
165
- this.getRoot = getRoot;
166
- this.refreshInterval = refreshInterval;
167
- }
168
- refresh() {
169
- this.root = new TreeItem2Wrapper(this.getRoot());
170
- }
171
- lazyInit() {
172
- this.refresh();
173
- (0, _setInterval2.default)(() => {
174
- this.refresh();
175
- for (const l of this.listeners) {
176
- l(undefined);
177
- }
178
- }, this.refreshInterval);
179
- }
180
- onDidChangeTreeData(listener) {
181
- this.lazyInit();
182
- this.listeners.push(listener);
183
- return null; // TODO: disposable (we're not using it for now)
184
- }
185
- async getTreeItem(id) {
186
- this.lazyInit();
187
- //console.log('getTreeItem', id)
188
- const keys = JSON.parse(id);
189
- const item = await this.root.findChildRec(keys);
190
- if (!item) {
191
- throw new Error(`item not found for id ${id}`);
192
- }
193
- //console.log('--->', item.treeItemOverTheWire)
194
- return item.serializableTreeItem;
195
- }
196
- async getChildren(id) {
197
- var _context3, _context4;
198
- this.lazyInit();
199
- //console.log('getChildren', id)
200
- const keys = id ? JSON.parse(id) : [];
201
- const self = await this.root.findChildRec(keys);
202
- const children = await self?.children();
203
- if (!children) {
204
- return [];
205
- }
206
- const res = ((_context3 = children) == null ? void 0 : (0, _bind.default)(_context4 = Function.call).call(_context4, (0, _map.default)(_context3), _context3))?.(c => c.id);
207
- //console.log('--->', res)
208
- return res;
209
- }
210
-
211
- // getParent(id: string) {
212
- // return null as any
213
- // }
214
-
215
- // ----- end TreeDataProvider impl
216
- }, (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "lazyInit", [_dec9], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "lazyInit"), _class2.prototype), _class2);
217
- function RemoteTreeDataProvider_publishOverLSPConnection(tdp, connection, methodPrefix) {
218
- const lazyInit = (0, _lodash.memoize)(() => {
219
- // we only setup this listener if we receive a call
220
- tdp.onDidChangeTreeData?.(id => connection.sendRequest(`${methodPrefix}onDidChangeTreeData`, [id]));
221
- });
222
- connection.onRequest(`${methodPrefix}getChildren`, async id => {
223
- lazyInit();
224
- try {
225
- return await ProviderResult_normalize(tdp.getChildren(id));
226
- } catch {
227
- return [];
228
- }
229
- });
230
- connection.onRequest(`${methodPrefix}getTreeItem`, async id => {
231
- lazyInit();
232
- try {
233
- return await ProviderResult_normalize(tdp.getTreeItem(id));
234
- } catch (e) {
235
- return {
236
- label: '(project has too many errors)',
237
- tooltip: e + ''
238
- };
239
- }
240
- });
241
- }
242
- async function ProviderResult_normalize(x) {
243
- if (isThenable(x)) {
244
- return await ProviderResult_normalize(await x);
245
- }
246
- if (x === null) {
247
- return undefined;
248
- }
249
- return x;
250
- }
251
- function isThenable(x) {
252
- if (typeof x !== 'object') {
253
- return false;
254
- }
255
- if (x === null) {
256
- return false;
257
- }
258
- return typeof x['then'] === 'function';
259
- }
260
- function Command_open(uriOrLocation) {
261
- const {
262
- uri,
263
- range
264
- } = _vscodeLanguageserverTypes.Location.is(uriOrLocation) ? uriOrLocation : {
265
- uri: uriOrLocation,
266
- range: undefined
267
- };
268
- if ((0, _startsWith.default)(uri).call(uri, 'https') || (0, _startsWith.default)(uri).call(uri, 'http')) {
269
- return {
270
- command: 'vscode.open',
271
- arguments: [uri],
272
- title: 'open'
273
- };
274
- }
275
- return {
276
- command: 'vscode.open',
277
- arguments: [uri, {
278
- selection: range,
279
- preserveFocus: true
280
- }],
281
- title: 'open'
282
- };
283
- }
284
- function Command_cli(cmd, title = 'run...') {
285
- cmd = (0, _trim.default)(cmd).call(cmd);
286
- if (!((0, _startsWith.default)(cmd).call(cmd, 'rw') || (0, _startsWith.default)(cmd).call(cmd, 'redwood'))) {
287
- cmd = 'redwood ' + cmd;
288
- }
289
- return {
290
- command: 'redwoodjs.cli',
291
- arguments: [cmd],
292
- title
293
- };
294
- }