@cedarjs/structure 2.8.1-next.116 → 2.8.1
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/README.md +1 -1
- package/dist/errors.js +15 -9
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +67 -40
- package/dist/model/RWCell.d.ts +4 -4
- package/dist/model/RWCell.d.ts.map +1 -1
- package/dist/model/RWCell.js +103 -111
- package/dist/model/RWComponent.d.ts +2 -2
- package/dist/model/RWComponent.d.ts.map +1 -1
- package/dist/model/RWComponent.js +41 -46
- package/dist/model/RWEnvHelper.d.ts +4 -4
- package/dist/model/RWEnvHelper.d.ts.map +1 -1
- package/dist/model/RWEnvHelper.js +205 -212
- package/dist/model/RWFunction.d.ts +2 -2
- package/dist/model/RWFunction.d.ts.map +1 -1
- package/dist/model/RWFunction.js +15 -10
- package/dist/model/RWLayout.d.ts +2 -2
- package/dist/model/RWLayout.d.ts.map +1 -1
- package/dist/model/RWLayout.js +15 -10
- package/dist/model/RWPage.d.ts +3 -3
- package/dist/model/RWPage.d.ts.map +1 -1
- package/dist/model/RWPage.js +57 -61
- package/dist/model/RWProject.d.ts +17 -11
- package/dist/model/RWProject.d.ts.map +1 -1
- package/dist/model/RWProject.js +164 -218
- package/dist/model/RWRoute.d.ts +5 -5
- package/dist/model/RWRoute.d.ts.map +1 -1
- package/dist/model/RWRoute.js +262 -312
- package/dist/model/RWRouter.d.ts +4 -4
- package/dist/model/RWRouter.d.ts.map +1 -1
- package/dist/model/RWRouter.js +126 -130
- package/dist/model/RWSDL.d.ts +5 -5
- package/dist/model/RWSDL.d.ts.map +1 -1
- package/dist/model/RWSDL.js +84 -96
- package/dist/model/RWSDLField.d.ts +6 -6
- package/dist/model/RWSDLField.d.ts.map +1 -1
- package/dist/model/RWSDLField.js +81 -79
- package/dist/model/RWService.d.ts +4 -4
- package/dist/model/RWService.d.ts.map +1 -1
- package/dist/model/RWService.js +76 -76
- package/dist/model/RWServiceFunction.d.ts +4 -4
- package/dist/model/RWServiceFunction.d.ts.map +1 -1
- package/dist/model/RWServiceFunction.js +97 -95
- package/dist/model/RWTOML.d.ts +3 -3
- package/dist/model/RWTOML.d.ts.map +1 -1
- package/dist/model/RWTOML.js +55 -53
- package/dist/model/index.d.ts +2 -2
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +20 -3
- package/dist/model/util/process_env.js +62 -44
- package/dist/nodes.d.ts +2 -2
- package/dist/nodes.d.ts.map +1 -1
- package/dist/nodes.js +164 -171
- package/dist/util.js +33 -23
- package/dist/x/Array.js +25 -15
- package/dist/x/Location.d.ts +1 -1
- package/dist/x/Location.d.ts.map +1 -1
- package/dist/x/Location.js +17 -11
- package/dist/x/Position.js +29 -18
- package/dist/x/Range.d.ts +1 -1
- package/dist/x/Range.d.ts.map +1 -1
- package/dist/x/Range.js +22 -17
- package/dist/x/URL.js +75 -59
- package/dist/x/child_process.d.ts +1 -1
- package/dist/x/child_process.d.ts.map +1 -1
- package/dist/x/child_process.js +49 -35
- package/dist/x/decorators.d.ts +2 -2
- package/dist/x/decorators.d.ts.map +1 -1
- package/dist/x/decorators.js +26 -46
- package/dist/x/diagnostics.d.ts +3 -3
- package/dist/x/diagnostics.d.ts.map +1 -1
- package/dist/x/diagnostics.js +259 -163
- package/dist/x/path.js +55 -36
- package/dist/x/prisma.d.ts +2 -2
- package/dist/x/prisma.d.ts.map +1 -1
- package/dist/x/prisma.js +55 -32
- package/dist/x/ts-morph.js +45 -34
- package/package.json +17 -38
- package/dist/errors.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/model/RWCell.js.map +0 -1
- package/dist/model/RWComponent.js.map +0 -1
- package/dist/model/RWEnvHelper.js.map +0 -1
- package/dist/model/RWFunction.js.map +0 -1
- package/dist/model/RWLayout.js.map +0 -1
- package/dist/model/RWPage.js.map +0 -1
- package/dist/model/RWProject.js.map +0 -1
- package/dist/model/RWRoute.js.map +0 -1
- package/dist/model/RWRouter.js.map +0 -1
- package/dist/model/RWSDL.js.map +0 -1
- package/dist/model/RWSDLField.js.map +0 -1
- package/dist/model/RWService.js.map +0 -1
- package/dist/model/RWServiceFunction.js.map +0 -1
- package/dist/model/RWTOML.js.map +0 -1
- package/dist/model/index.js.map +0 -1
- package/dist/model/util/process_env.js.map +0 -1
- package/dist/nodes.js.map +0 -1
- package/dist/util.js.map +0 -1
- package/dist/x/Array.js.map +0 -1
- package/dist/x/Location.js.map +0 -1
- package/dist/x/Position.js.map +0 -1
- package/dist/x/Range.js.map +0 -1
- package/dist/x/URL.js.map +0 -1
- package/dist/x/child_process.js.map +0 -1
- package/dist/x/decorators.js.map +0 -1
- package/dist/x/diagnostics.js.map +0 -1
- package/dist/x/path.js.map +0 -1
- package/dist/x/prisma.js.map +0 -1
- package/dist/x/ts-morph.js.map +0 -1
|
@@ -1,222 +1,215 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
+
var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard").default;
|
|
6
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.RWEnvHelper = void 0;
|
|
10
|
+
var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/starts-with"));
|
|
11
|
+
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/includes"));
|
|
12
|
+
var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/bind"));
|
|
13
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/map"));
|
|
14
|
+
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/array/from"));
|
|
15
|
+
var _getOwnPropertyDescriptor = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor"));
|
|
16
|
+
var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/applyDecoratedDescriptor"));
|
|
17
|
+
var _nodeFs = _interopRequireDefault(require("node:fs"));
|
|
18
|
+
var _nodePath = require("node:path");
|
|
19
|
+
var dotenv = _interopRequireWildcard(require("dotenv-defaults"));
|
|
20
|
+
var _pickBy = _interopRequireDefault(require("lodash/pickBy.js"));
|
|
21
|
+
var _projectConfig = require("@cedarjs/project-config");
|
|
22
|
+
var _nodes = require("../nodes");
|
|
23
|
+
var _decorators = require("../x/decorators");
|
|
24
|
+
var _diagnostics = require("../x/diagnostics");
|
|
25
|
+
var _prisma = require("../x/prisma");
|
|
26
|
+
var _process_env = require("./util/process_env");
|
|
27
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _dec8, _dec9, _dec0, _dec1, _dec10, _class2;
|
|
28
|
+
let RWEnvHelper = exports.RWEnvHelper = (_dec = (0, _decorators.lazy)(), _dec2 = (0, _decorators.lazy)(), _dec3 = (0, _decorators.lazy)(), _dec4 = (0, _decorators.lazy)(), _dec5 = (0, _decorators.lazy)(), _dec6 = (0, _decorators.lazy)(), _dec7 = (0, _decorators.lazy)(), _class = class RWEnvHelper extends _nodes.BaseNode {
|
|
29
|
+
constructor(parent) {
|
|
30
|
+
super();
|
|
31
|
+
this.parent = parent;
|
|
32
|
+
}
|
|
33
|
+
get id() {
|
|
34
|
+
// this is an internal node. it is not associated to any particular file
|
|
35
|
+
return this.parent.id + ' envHelper';
|
|
36
|
+
}
|
|
37
|
+
bailOutOnCollection() {
|
|
38
|
+
// we need this node to participate in all collection requests
|
|
39
|
+
// because it will emit info and diagnostics for files all over the codebase
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* parse .env
|
|
45
|
+
* return undefined if not present
|
|
46
|
+
* NOTE: It does not apply defaults (see env_merged)
|
|
47
|
+
*/
|
|
48
|
+
get env() {
|
|
49
|
+
return this._dotenv('.env');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* .env.defaults
|
|
54
|
+
* return undefined if not present
|
|
55
|
+
*/
|
|
56
|
+
get env_defaults() {
|
|
57
|
+
return this._dotenv('.env.defaults');
|
|
58
|
+
}
|
|
59
|
+
get api_prisma_env() {
|
|
60
|
+
return this._dotenv('api/prisma/.env');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* .env.defaults + .env
|
|
65
|
+
* uses the same algorithm that env-defaults does (Object.assign(), which is equivalent to object spread addition)
|
|
66
|
+
*/
|
|
67
|
+
get env_default_merged() {
|
|
68
|
+
return {
|
|
69
|
+
...(this.env_defaults ?? {}),
|
|
70
|
+
...(this.env ?? {})
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* - starts with .env + .env.defaults
|
|
76
|
+
* - allows any variables prefixed with 'REDWOOD_ENV_'
|
|
77
|
+
* - applies the "include" rule on the rest
|
|
78
|
+
* @param include
|
|
79
|
+
*/
|
|
80
|
+
env_default_merged_filtered(include) {
|
|
81
|
+
return (0, _pickBy.default)(this.env_default_merged, (_v, k) => {
|
|
82
|
+
var _context, _context2;
|
|
83
|
+
return (0, _startsWith.default)(k).call(k, 'REDWOOD_ENV_') || ((_context = include) == null ? void 0 : (0, _bind.default)(_context2 = Function.call).call(_context2, (0, _includes.default)(_context), _context))?.(k);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
_dotenv(f) {
|
|
87
|
+
const file = (0, _nodePath.join)(this.parent.projectRoot, f);
|
|
88
|
+
if (!_nodeFs.default.existsSync(file)) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
return dotenv.parse(_nodeFs.default.readFileSync(file, 'utf-8'));
|
|
92
|
+
}
|
|
93
|
+
get env_available_to_api() {
|
|
94
|
+
// in the API side, all variables are visible
|
|
95
|
+
return this.env_default_merged;
|
|
96
|
+
// return this.env_merged_filter(
|
|
97
|
+
// this.parent.redwoodTOML.api_includeEnvironmentVariables ?? []
|
|
98
|
+
// )
|
|
99
|
+
}
|
|
100
|
+
get env_available_to_web() {
|
|
101
|
+
return this.env_default_merged_filtered(this.parent.redwoodTOML.web_includeEnvironmentVariables ?? []);
|
|
102
|
+
}
|
|
103
|
+
async children() {
|
|
104
|
+
return [...(await this.process_env_expressions())];
|
|
105
|
+
}
|
|
106
|
+
async process_env_expressions() {
|
|
107
|
+
var _context3, _context4;
|
|
108
|
+
const {
|
|
109
|
+
pathHelper
|
|
110
|
+
} = this.parent;
|
|
111
|
+
const api = (0, _map.default)(_context3 = (0, _process_env.process_env_findAll)(pathHelper.api.base)).call(_context3, x => new ProcessDotEnvExpression(this, 'api', x.key, x.node));
|
|
112
|
+
const web = (0, _map.default)(_context4 = (0, _process_env.process_env_findAll)(pathHelper.web.base)).call(_context4, x => new ProcessDotEnvExpression(this, 'web', x.key, x.node));
|
|
113
|
+
const schemaPath = await (0, _projectConfig.getSchemaPath)(pathHelper.api.prismaConfig);
|
|
114
|
+
const prisma = (0, _from.default)((0, _prisma.prisma_parseEnvExpressionsInFile)(schemaPath));
|
|
115
|
+
const pp = (0, _map.default)(prisma).call(prisma, x => new ProcessDotEnvExpression(this, 'prisma', x.key, x.location));
|
|
116
|
+
return [...api, ...web, ...pp];
|
|
117
|
+
}
|
|
118
|
+
}, (0, _applyDecoratedDescriptor2.default)(_class.prototype, "id", [_dec], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "id"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "env", [_dec2], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "env"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "env_defaults", [_dec3], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "env_defaults"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "api_prisma_env", [_dec4], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "api_prisma_env"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "env_default_merged", [_dec5], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "env_default_merged"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "env_available_to_api", [_dec6], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "env_available_to_api"), _class.prototype), (0, _applyDecoratedDescriptor2.default)(_class.prototype, "env_available_to_web", [_dec7], (0, _getOwnPropertyDescriptor.default)(_class.prototype, "env_available_to_web"), _class.prototype), _class);
|
|
118
119
|
/**
|
|
119
120
|
* An occurrence of process.env somewhere in the codebase
|
|
120
121
|
*/
|
|
121
|
-
class ProcessDotEnvExpression extends BaseNode {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
122
|
+
let ProcessDotEnvExpression = (_dec8 = (0, _decorators.lazy)(), _dec9 = (0, _decorators.lazy)(), _dec0 = (0, _decorators.lazy)(), _dec1 = (0, _decorators.lazy)(), _dec10 = (0, _decorators.lazy)(), _class2 = class ProcessDotEnvExpression extends _nodes.BaseNode {
|
|
123
|
+
constructor(parent, kind, key, node) {
|
|
124
|
+
super();
|
|
125
|
+
this.parent = parent;
|
|
126
|
+
this.kind = kind;
|
|
127
|
+
this.key = key;
|
|
128
|
+
this.node = node;
|
|
129
|
+
}
|
|
130
|
+
bailOutOnCollection(uri) {
|
|
131
|
+
if (this.location.uri !== uri) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
get id() {
|
|
137
|
+
// this is an internal node. it is not associated to any particular file
|
|
138
|
+
// we just need to make sure the ID is unique and correctly nested
|
|
139
|
+
return this.parent.id + ' ' + (0, _diagnostics.LocationLike_toHashLink)(this.location);
|
|
140
|
+
}
|
|
141
|
+
get side() {
|
|
142
|
+
return this.kind === 'web' ? 'web' : 'api';
|
|
143
|
+
}
|
|
144
|
+
get location() {
|
|
145
|
+
return (0, _diagnostics.LocationLike_toLocation)(this.node);
|
|
146
|
+
}
|
|
147
|
+
*diagnostics() {
|
|
148
|
+
const {
|
|
149
|
+
key,
|
|
150
|
+
location,
|
|
151
|
+
value_as_available
|
|
152
|
+
} = this;
|
|
153
|
+
const {
|
|
154
|
+
uri,
|
|
155
|
+
range
|
|
156
|
+
} = location;
|
|
157
|
+
if (typeof value_as_available === 'undefined') {
|
|
158
|
+
// the value is not available
|
|
159
|
+
// there are a few scenarios here...
|
|
160
|
+
if (this.parent.env_default_merged[key]) {
|
|
161
|
+
// value is actually in the merged env, but it is not visible here
|
|
162
|
+
// this is probably because the user forgot to add an includeEnvironmentVariables rule
|
|
163
|
+
const snippet = `
|
|
160
164
|
[${this.side}]
|
|
161
165
|
includeEnvironmentVariables = ['${this.key}']`;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
yield {
|
|
167
|
+
uri,
|
|
168
|
+
diagnostic: {
|
|
169
|
+
range,
|
|
170
|
+
message: `
|
|
167
171
|
This env variable is present in '${this.value_definition_file_basename}',
|
|
168
172
|
but it won't be available to your app in production *unless* you add it to includeEnvironmentVariables.
|
|
169
173
|
Tip: add the following to your cedar.toml (or redwood.toml):
|
|
170
174
|
${snippet}
|
|
171
175
|
`,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
], ProcessDotEnvExpression.prototype, "side", null);
|
|
213
|
-
__decorate([
|
|
214
|
-
lazy()
|
|
215
|
-
], ProcessDotEnvExpression.prototype, "location", null);
|
|
216
|
-
__decorate([
|
|
217
|
-
lazy()
|
|
218
|
-
], ProcessDotEnvExpression.prototype, "value_definition_file_basename", null);
|
|
219
|
-
__decorate([
|
|
220
|
-
lazy()
|
|
221
|
-
], ProcessDotEnvExpression.prototype, "value_as_available", null);
|
|
222
|
-
//# sourceMappingURL=RWEnvHelper.js.map
|
|
176
|
+
severity: _diagnostics.DiagnosticSeverity.Warning
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
} else {
|
|
180
|
+
// the value is simply not visible
|
|
181
|
+
yield {
|
|
182
|
+
uri,
|
|
183
|
+
diagnostic: {
|
|
184
|
+
range,
|
|
185
|
+
message: `env value ${key} is not available. add it to your .env file`,
|
|
186
|
+
severity: _diagnostics.DiagnosticSeverity.Warning
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
get value_definition_file_basename() {
|
|
193
|
+
const {
|
|
194
|
+
key,
|
|
195
|
+
parent: {
|
|
196
|
+
env,
|
|
197
|
+
env_defaults
|
|
198
|
+
}
|
|
199
|
+
} = this;
|
|
200
|
+
if (env?.[key]) {
|
|
201
|
+
return '.env';
|
|
202
|
+
}
|
|
203
|
+
if (env_defaults?.[key]) {
|
|
204
|
+
return '.env.defaults';
|
|
205
|
+
}
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
get value_as_available() {
|
|
209
|
+
if (this.side === 'web') {
|
|
210
|
+
return this.parent.env_available_to_web[this.key];
|
|
211
|
+
}
|
|
212
|
+
const v = this.parent.env_available_to_api[this.key];
|
|
213
|
+
return v;
|
|
214
|
+
}
|
|
215
|
+
}, (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "id", [_dec8], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "id"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "side", [_dec9], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "side"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "location", [_dec0], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "location"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "value_definition_file_basename", [_dec1], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "value_definition_file_basename"), _class2.prototype), (0, _applyDecoratedDescriptor2.default)(_class2.prototype, "value_as_available", [_dec10], (0, _getOwnPropertyDescriptor.default)(_class2.prototype, "value_as_available"), _class2.prototype), _class2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RWFunction.d.ts","sourceRoot":"","sources":["../../src/model/RWFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RWFunction.d.ts","sourceRoot":"","sources":["../../src/model/RWFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C;;GAEG;AACH,qBAAa,UAAW,SAAQ,QAAQ;IAE7B,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,SAAS;gBADjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,SAAS;CAI3B"}
|
package/dist/model/RWFunction.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.RWFunction = void 0;
|
|
8
|
+
var _nodes = require("../nodes");
|
|
2
9
|
/**
|
|
3
10
|
* functions exist in the /functions folder
|
|
4
11
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.parent = parent;
|
|
12
|
-
}
|
|
12
|
+
class RWFunction extends _nodes.FileNode {
|
|
13
|
+
constructor(filePath, parent) {
|
|
14
|
+
super();
|
|
15
|
+
this.filePath = filePath;
|
|
16
|
+
this.parent = parent;
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
|
-
|
|
19
|
+
exports.RWFunction = RWFunction;
|
package/dist/model/RWLayout.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RWLayout.d.ts","sourceRoot":"","sources":["../../src/model/RWLayout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RWLayout.d.ts","sourceRoot":"","sources":["../../src/model/RWLayout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C;;GAEG;AACH,qBAAa,QAAS,SAAQ,QAAQ;IAE3B,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,SAAS;gBADjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,SAAS;CAI3B"}
|
package/dist/model/RWLayout.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.RWLayout = void 0;
|
|
8
|
+
var _nodes = require("../nodes");
|
|
2
9
|
/**
|
|
3
10
|
* layouts live in the src/layouts folder
|
|
4
11
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
this.parent = parent;
|
|
12
|
-
}
|
|
12
|
+
class RWLayout extends _nodes.FileNode {
|
|
13
|
+
constructor(filePath, parent) {
|
|
14
|
+
super();
|
|
15
|
+
this.filePath = filePath;
|
|
16
|
+
this.parent = parent;
|
|
17
|
+
}
|
|
13
18
|
}
|
|
14
|
-
|
|
19
|
+
exports.RWLayout = RWLayout;
|
package/dist/model/RWPage.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FileNode } from '../nodes
|
|
2
|
-
import type { RWProject } from './RWProject
|
|
1
|
+
import { FileNode } from '../nodes';
|
|
2
|
+
import type { RWProject } from './RWProject';
|
|
3
3
|
export declare class RWPage extends FileNode {
|
|
4
4
|
constName: string;
|
|
5
5
|
path: string;
|
|
6
6
|
parent: RWProject;
|
|
7
7
|
constructor(constName: string, path: string, parent: RWProject);
|
|
8
8
|
get filePath(): string;
|
|
9
|
-
get route(): import("./RWRoute
|
|
9
|
+
get route(): import("./RWRoute").RWRoute | undefined;
|
|
10
10
|
get layoutName(): string | undefined;
|
|
11
11
|
get actionRemove(): Map<any, any>;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RWPage.d.ts","sourceRoot":"","sources":["../../src/model/RWPage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RWPage.d.ts","sourceRoot":"","sources":["../../src/model/RWPage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,qBAAa,MAAO,SAAQ,QAAQ;IAEzB,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,SAAS;gBAFjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS;IAI1B,IAAY,QAAQ,WAEnB;IACD,IAAY,KAAK,4CAIhB;IACD,IAAY,UAAU,IAAI,MAAM,GAAG,SAAS,CAc3C;IACD,IAAY,YAAY,kBAUvB;CACF"}
|