eslint-plugin-use-agnostic 0.10.2 → 0.10.3

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.
@@ -1,4 +1,5 @@
1
1
  import {
2
+ agnostic20ConfigName,
2
3
  USE_SERVER_LOGICS as COMMONS_USE_SERVER_LOGICS,
3
4
  USE_SERVER_COMPONENTS as COMMONS_USE_SERVER_COMPONENTS,
4
5
  USE_SERVER_FUNCTIONS as COMMONS_USE_SERVER_FUNCTIONS,
@@ -11,6 +12,8 @@ import {
11
12
 
12
13
  import { makeIntroForSpecificViolationMessage as commonsMakeIntroForSpecificViolationMessage } from "../../../_commons/utilities/helpers.js";
13
14
 
15
+ import jscommentsConfig from "../../../../comments.config.js";
16
+
14
17
  /**
15
18
  * @typedef {import('../../../../types/agnostic20/_commons/typedefs.js').Directive} Directive
16
19
  * @typedef {import('../../../../types/agnostic20/_commons/typedefs.js').Directives} Directives
@@ -100,72 +103,100 @@ const SUGGEST_USE_AGNOSTIC =
100
103
 
101
104
  export const effectiveDirectives_blockedImports = Object.freeze({
102
105
  [USE_SERVER_LOGICS]: [
103
- // USE_SERVER_LOGICS allowed, because Server Logics can compose with one another.
104
- // USE_SERVER_COMPONENTS allowed, because Server Components are OK to be composed with Server Logics as long as the Server Logics Module, by convention, does not export React components.
105
- // USE_SERVER_FUNCTIONS allowed, because Server Functions, being able to import one another, can compose and do so via Server Logics, despite this method seeming superfluous at first glance. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)
106
+ // USE_SERVER_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_SERVER_LOGICS
107
+ // USE_SERVER_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_SERVER_COMPONENTS
108
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_SERVER_FUNCTIONS
106
109
  {
107
110
  blockedImport: USE_CLIENT_LOGICS,
108
111
  message: `${makeIntroForSpecificViolationMessage(
109
112
  USE_SERVER_LOGICS,
110
113
  USE_CLIENT_LOGICS
111
- )} Client Logics should never leak to the server.`,
114
+ )} ${
115
+ jscommentsConfig[agnostic20ConfigName][USE_SERVER_LOGICS][
116
+ USE_CLIENT_LOGICS
117
+ ] // $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_CLIENT_LOGICS
118
+ }`,
112
119
  },
113
120
  {
114
121
  blockedImport: USE_CLIENT_COMPONENTS,
115
122
  message: `${makeIntroForSpecificViolationMessage(
116
123
  USE_SERVER_LOGICS,
117
124
  USE_CLIENT_COMPONENTS
118
- )} Client Components cannot be tinkered with on the server.`,
125
+ )} ${
126
+ jscommentsConfig[agnostic20ConfigName][USE_SERVER_LOGICS][
127
+ USE_CLIENT_COMPONENTS
128
+ ] // $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_CLIENT_COMPONENTS
129
+ }`,
119
130
  },
120
- // USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the server just like they can on the client.
121
- // USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can be composed with Logics on the server just like they can on the client, as long at the Server Logics Module, by convention, does not export React components.
131
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_AGNOSTIC_LOGICS
132
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_AGNOSTIC_COMPONENTS
122
133
  ],
123
134
  [USE_SERVER_COMPONENTS]: [
124
- // USE_SERVER_LOGICS allowed, because Server Logics, being logic from the server, can safely support Server Components.
125
- // USE_SERVER_COMPONENTS allowed, because Server Components can compose with one another, assuming thanks to the inclusion of the 'use agnostic' directive that they are actual Server Components.
126
- // USE_SERVER_FUNCTIONS allowed, because Server Functions can be passed to imported Client Components within Server Components Modules, even though indeed Server Components Modules and Server Components can make their own Server Functions through inline 'use server' directives.
135
+ // USE_SERVER_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_SERVER_LOGICS
136
+ // USE_SERVER_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_SERVER_COMPONENTS
137
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_SERVER_FUNCTIONS
127
138
  {
128
139
  blockedImport: USE_CLIENT_LOGICS,
129
140
  message: `${makeIntroForSpecificViolationMessage(
130
141
  USE_SERVER_COMPONENTS,
131
142
  USE_CLIENT_LOGICS
132
- )} Client Logics should never leak to the server.`,
143
+ )} ${
144
+ jscommentsConfig[agnostic20ConfigName][USE_SERVER_COMPONENTS][
145
+ USE_CLIENT_LOGICS
146
+ ] // $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_CLIENT_LOGICS
147
+ }`,
133
148
  },
134
- // USE_CLIENT_COMPONENTS allowed, because Client Components can be nested inside Server Components either to wrap some of the tree with client state accessible through child Client Components and pass through Server Components, or to create client boundaries when the root of the application is planted on the server.
135
- // USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the server just like they can on the client.
136
- // USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can render safely on the server just like they can on the client.
149
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_CLIENT_COMPONENTS
150
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_AGNOSTIC_LOGICS
151
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_AGNOSTIC_COMPONENTS
137
152
  ],
138
153
  [USE_SERVER_FUNCTIONS]: [
139
- // USE_SERVER_LOGICS allowed, because Server Logics, being logic from the server, can safely support Server Functions.
154
+ // USE_SERVER_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_SERVER_LOGICS
140
155
  {
141
156
  blockedImport: USE_SERVER_COMPONENTS,
142
157
  message: `${makeIntroForSpecificViolationMessage(
143
158
  USE_SERVER_FUNCTIONS,
144
159
  USE_SERVER_COMPONENTS
145
- )} Server Components aren't allowed because Server Functions have no business working with React Components.`,
160
+ )} ${
161
+ jscommentsConfig[agnostic20ConfigName][USE_SERVER_FUNCTIONS][
162
+ USE_SERVER_COMPONENTS
163
+ ] // $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_SERVER_COMPONENTS
164
+ }`,
146
165
  },
147
- // USE_SERVER_FUNCTIONS allowed, because Server Functions, even though they don't need to import one another and the same results can be generated via Server Logics for the outcome of a single Server Function, can still compose with one another. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)
166
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_SERVER_FUNCTIONS
148
167
  {
149
168
  blockedImport: USE_CLIENT_LOGICS,
150
169
  message: `${makeIntroForSpecificViolationMessage(
151
170
  USE_SERVER_FUNCTIONS,
152
171
  USE_CLIENT_LOGICS
153
- )} Client Logics should never leak to the server.`,
172
+ )} ${
173
+ jscommentsConfig[agnostic20ConfigName][USE_SERVER_FUNCTIONS][
174
+ USE_CLIENT_LOGICS
175
+ ] // $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_CLIENT_LOGICS
176
+ }`,
154
177
  },
155
178
  {
156
179
  blockedImport: USE_CLIENT_COMPONENTS,
157
180
  message: `${makeIntroForSpecificViolationMessage(
158
181
  USE_SERVER_FUNCTIONS,
159
182
  USE_CLIENT_COMPONENTS
160
- )} Client Components aren't allowed because Server Functions have no business working with React Components.`,
183
+ )} ${
184
+ jscommentsConfig[agnostic20ConfigName][USE_SERVER_FUNCTIONS][
185
+ USE_CLIENT_COMPONENTS
186
+ ] // $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_CLIENT_COMPONENTS
187
+ }`,
161
188
  },
162
- // USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the server just like they can on the client.
189
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_LOGICS
163
190
  {
164
191
  blockedImport: USE_AGNOSTIC_COMPONENTS,
165
192
  message: `${makeIntroForSpecificViolationMessage(
166
193
  USE_SERVER_FUNCTIONS,
167
194
  USE_AGNOSTIC_COMPONENTS
168
- )} Agnostic Components aren't allowed because Server Functions have no business working with React Components.`,
195
+ )} ${
196
+ jscommentsConfig[agnostic20ConfigName][USE_SERVER_FUNCTIONS][
197
+ USE_AGNOSTIC_COMPONENTS
198
+ ] // $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_COMPONENTS
199
+ }`,
169
200
  },
170
201
  ],
171
202
  [USE_CLIENT_LOGICS]: [
@@ -174,7 +205,11 @@ export const effectiveDirectives_blockedImports = Object.freeze({
174
205
  message: `${makeIntroForSpecificViolationMessage(
175
206
  USE_CLIENT_LOGICS,
176
207
  USE_SERVER_LOGICS
177
- )} Server Logics should never leak to the client.
208
+ )} ${
209
+ jscommentsConfig[agnostic20ConfigName][USE_CLIENT_LOGICS][
210
+ USE_SERVER_LOGICS
211
+ ] // $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_LOGICS
212
+ }
178
213
  ${SUGGEST_USE_AGNOSTIC}`,
179
214
  },
180
215
  {
@@ -182,14 +217,18 @@ ${SUGGEST_USE_AGNOSTIC}`,
182
217
  message: `${makeIntroForSpecificViolationMessage(
183
218
  USE_CLIENT_LOGICS,
184
219
  USE_SERVER_COMPONENTS
185
- )} Server Components cannot be thinkered with on the client.
220
+ )} ${
221
+ jscommentsConfig[agnostic20ConfigName][USE_CLIENT_LOGICS][
222
+ USE_SERVER_COMPONENTS
223
+ ] // $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_COMPONENTS
224
+ }
186
225
  ${SUGGEST_USE_AGNOSTIC}`,
187
226
  },
188
- // USE_SERVER_FUNCTIONS allowed, because Server Functions can technically be attached to Client Components that are being tinkered with within Client Logics Modules.
189
- // USE_CLIENT_LOGICS allowed, because Client Logics can compose with one another.
190
- // USE_CLIENT_COMPONENTS allowed, because Client Components are OK to be composed with Client Logics as long as the Client Logics Module, by convention, does not export React components.
191
- // USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the client just like they can on the server.
192
- // USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can be composed with Logics on the client just like they can on the server, as long as the Client Logics Module, by convention, does not export React components.
227
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_FUNCTIONS
228
+ // USE_CLIENT_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_CLIENT_LOGICS
229
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_CLIENT_COMPONENTS
230
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_AGNOSTIC_LOGICS
231
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_AGNOSTIC_COMPONENTS
193
232
  ],
194
233
  [USE_CLIENT_COMPONENTS]: [
195
234
  {
@@ -197,7 +236,11 @@ ${SUGGEST_USE_AGNOSTIC}`,
197
236
  message: `${makeIntroForSpecificViolationMessage(
198
237
  USE_CLIENT_COMPONENTS,
199
238
  USE_SERVER_LOGICS
200
- )} Server Logics should never leak to the client.
239
+ )} ${
240
+ jscommentsConfig[agnostic20ConfigName][USE_CLIENT_COMPONENTS][
241
+ USE_SERVER_LOGICS
242
+ ] // $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_SERVER_LOGICS
243
+ }
201
244
  ${SUGGEST_USE_AGNOSTIC}`,
202
245
  },
203
246
  {
@@ -205,14 +248,18 @@ ${SUGGEST_USE_AGNOSTIC}`,
205
248
  message: `${makeIntroForSpecificViolationMessage(
206
249
  USE_CLIENT_COMPONENTS,
207
250
  USE_SERVER_COMPONENTS
208
- )} Server Components may only pass through Client Components via the children prop within Server Components Modules.
251
+ )} ${
252
+ jscommentsConfig[agnostic20ConfigName][USE_CLIENT_COMPONENTS][
253
+ USE_SERVER_COMPONENTS
254
+ ] // $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_SERVER_COMPONENTS
255
+ }
209
256
  ${SUGGEST_USE_AGNOSTIC}`,
210
257
  },
211
- // USE_SERVER_FUNCTIONS allowed, because Server Functions are specifically triggered by Client Components.
212
- // USE_CLIENT_LOGICS allowed, because Client Logics, being logic from the client, can safely support Client Components.
213
- // USE_CLIENT_COMPONENTS allowed, because Client Components can compose with one another.
214
- // USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can run safely on the client just like they can on the server.
215
- // USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can render safely on the client just like they can on the server.
258
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_SERVER_FUNCTIONS
259
+ // USE_CLIENT_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_CLIENT_LOGICS
260
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_CLIENT_COMPONENTS
261
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_LOGICS
262
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_COMPONENTS
216
263
  ],
217
264
  [USE_AGNOSTIC_LOGICS]: [
218
265
  {
@@ -220,7 +267,11 @@ ${SUGGEST_USE_AGNOSTIC}`,
220
267
  message: `${makeIntroForSpecificViolationMessage(
221
268
  USE_AGNOSTIC_LOGICS,
222
269
  USE_SERVER_LOGICS
223
- )} Server Logics cannot run on both the server and the client.
270
+ )} ${
271
+ jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
272
+ USE_SERVER_LOGICS
273
+ ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_LOGICS
274
+ }
224
275
  ${SUGGEST_USE_AGNOSTIC}`,
225
276
  },
226
277
  {
@@ -228,7 +279,11 @@ ${SUGGEST_USE_AGNOSTIC}`,
228
279
  message: `${makeIntroForSpecificViolationMessage(
229
280
  USE_AGNOSTIC_LOGICS,
230
281
  USE_SERVER_COMPONENTS
231
- )} Server Components cannot be tinkered with on both the server and the client.
282
+ )} ${
283
+ jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
284
+ USE_SERVER_COMPONENTS
285
+ ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_COMPONENTS
286
+ }
232
287
  ${SUGGEST_USE_AGNOSTIC}`,
233
288
  },
234
289
  {
@@ -236,24 +291,36 @@ ${SUGGEST_USE_AGNOSTIC}`,
236
291
  message: `${makeIntroForSpecificViolationMessage(
237
292
  USE_AGNOSTIC_LOGICS,
238
293
  USE_SERVER_FUNCTIONS
239
- )} Server Functions can be modified on the server and on the client, but their use cases on both environments are not one-to-one compatible, since they're being addressed as they are on the server and addressed as references on the client.`,
294
+ )} ${
295
+ jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
296
+ USE_SERVER_FUNCTIONS
297
+ ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_FUNCTIONS
298
+ }`,
240
299
  },
241
300
  {
242
301
  blockedImport: USE_CLIENT_LOGICS,
243
302
  message: `${makeIntroForSpecificViolationMessage(
244
303
  USE_AGNOSTIC_LOGICS,
245
304
  USE_CLIENT_LOGICS
246
- )} Client Logics cannot run on both the server and the client.`,
305
+ )} ${
306
+ jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
307
+ USE_CLIENT_LOGICS
308
+ ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_CLIENT_LOGICS
309
+ }`,
247
310
  },
248
311
  {
249
312
  blockedImport: USE_CLIENT_COMPONENTS,
250
313
  message: `${makeIntroForSpecificViolationMessage(
251
314
  USE_AGNOSTIC_LOGICS,
252
315
  USE_CLIENT_COMPONENTS
253
- )} Client Components cannot be tinkered with on both the server and the client.`,
316
+ )} ${
317
+ jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
318
+ USE_CLIENT_COMPONENTS
319
+ ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_CLIENT_COMPONENTS
320
+ }`,
254
321
  },
255
- // USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics can compose with one another.
256
- // USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can be composed with Logics agnostically as long as the Agnostic Logics Module, by convention, does not export React components.
322
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_LOGICS
323
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_COMPONENTS
257
324
  ],
258
325
  [USE_AGNOSTIC_COMPONENTS]: [
259
326
  {
@@ -261,7 +328,11 @@ ${SUGGEST_USE_AGNOSTIC}`,
261
328
  message: `${makeIntroForSpecificViolationMessage(
262
329
  USE_AGNOSTIC_COMPONENTS,
263
330
  USE_SERVER_LOGICS
264
- )} Server Logics cannot run on both the server and the client.
331
+ )} ${
332
+ jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_COMPONENTS][
333
+ USE_SERVER_LOGICS
334
+ ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_SERVER_LOGICS
335
+ }
265
336
  ${SUGGEST_USE_AGNOSTIC}`,
266
337
  },
267
338
  {
@@ -269,19 +340,27 @@ ${SUGGEST_USE_AGNOSTIC}`,
269
340
  message: `${makeIntroForSpecificViolationMessage(
270
341
  USE_AGNOSTIC_COMPONENTS,
271
342
  USE_SERVER_COMPONENTS
272
- )} Server Components, unlike Client Components, cannot make silos of their own once on the opposing environment (the client in this case), and therefore cannot be executed from the client, making them unable to execute agnostically from both the server and the client.
343
+ )} ${
344
+ jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_COMPONENTS][
345
+ USE_SERVER_COMPONENTS
346
+ ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_SERVER_COMPONENTS
347
+ }
273
348
  ${SUGGEST_USE_AGNOSTIC}`,
274
349
  },
275
- // USE_SERVER_FUNCTIONS allowed, because Server Functions can be passed to Client Components as props when Client Components are also legally imported into Agnostic Components Modules.
350
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_SERVER_FUNCTIONS
276
351
  {
277
352
  blockedImport: USE_CLIENT_LOGICS,
278
353
  message: `${makeIntroForSpecificViolationMessage(
279
354
  USE_AGNOSTIC_COMPONENTS,
280
355
  USE_CLIENT_LOGICS
281
- )} Client Logics cannot run on both the server and the client.`,
356
+ )} ${
357
+ jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_COMPONENTS][
358
+ USE_CLIENT_LOGICS
359
+ ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_LOGICS
360
+ }`,
282
361
  },
283
- // USE_CLIENT_COMPONENTS allowed, because Client Components can be nested inside Agnostic Components either to wrap some of the tree with client state accessible through child Client Components and pass through Server Components (if still on the Server Tree), or to create client boundaries when the root of the application is planted on the server.
284
- // USE_AGNOSTIC_LOGICS allowed, because Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components.
285
- // USE_AGNOSTIC_COMPONENTS allowed, because Agnostic Components can compose with one another.
362
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_COMPONENTS
363
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_LOGICS
364
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_COMPONENTS
286
365
  ],
287
366
  });
@@ -1,4 +1,5 @@
1
1
  import {
2
+ directive21ConfigName,
2
3
  USE_SERVER_LOGICS as COMMONS_USE_SERVER_LOGICS,
3
4
  USE_CLIENT_LOGICS as COMMONS_USE_CLIENT_LOGICS,
4
5
  USE_AGNOSTIC_LOGICS as COMMONS_USE_AGNOSTIC_LOGICS,
@@ -14,6 +15,8 @@ import {
14
15
 
15
16
  import { makeIntroForSpecificViolationMessage as commonsMakeIntroForSpecificViolationMessage } from "../../../_commons/utilities/helpers.js";
16
17
 
18
+ import jscommentsConfig from "../../../../comments.config.js";
19
+
17
20
  /**
18
21
  * @typedef {import('../../../../types/directive21/_commons/typedefs.js').CommentedDirective} CommentedDirective
19
22
  * @typedef {import('../../../../types/directive21/_commons/typedefs.js').CommentedDirectiveWithoutUseAgnosticStrategies} CommentedDirectiveWithoutUseAgnosticStrategies
@@ -191,33 +194,45 @@ const makeIntroForSpecificViolationMessage = (
191
194
 
192
195
  export const commentedDirectives_blockedImports = Object.freeze({
193
196
  [USE_SERVER_LOGICS]: [
194
- // USE_SERVER_LOGICS allowed, because Prime Server Logics can compose with one another.
197
+ // USE_SERVER_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_SERVER_LOGICS
195
198
  {
196
199
  blockedImport: USE_CLIENT_LOGICS,
197
200
  message: `${makeIntroForSpecificViolationMessage(
198
201
  USE_SERVER_LOGICS,
199
202
  USE_CLIENT_LOGICS
200
- )} Prime Client Logics should never leak to the server.`,
203
+ )} ${
204
+ jscommentsConfig[directive21ConfigName][USE_SERVER_LOGICS][
205
+ USE_CLIENT_LOGICS
206
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_LOGICS
207
+ }`,
201
208
  },
202
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the server just like they can on the client.
203
- // USE_SERVER_COMPONENTS allowed, because Lineal Server Components are OK to be composed with Prime Server Logics as long as the Prime Server Logics Module, by convention, does not export React components.
209
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_AGNOSTIC_LOGICS
210
+ // USE_SERVER_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_SERVER_COMPONENTS
204
211
  {
205
212
  blockedImport: USE_CLIENT_COMPONENTS,
206
213
  message: `${makeIntroForSpecificViolationMessage(
207
214
  USE_SERVER_LOGICS,
208
215
  USE_CLIENT_COMPONENTS
209
- )} Lineal Client Components, like any Client Components, cannot be tinkered with on the server.`,
216
+ )} ${
217
+ jscommentsConfig[directive21ConfigName][USE_SERVER_LOGICS][
218
+ USE_CLIENT_COMPONENTS
219
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_COMPONENTS
220
+ }`,
210
221
  },
211
- // USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.
212
- // USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions, being able to import one another, can compose and do so via Prime Server Logics, despite this method seeming superfluous at first glance. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)
222
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_AGNOSTIC_COMPONENTS
223
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_SERVER_FUNCTIONS
213
224
  {
214
225
  blockedImport: USE_CLIENT_CONTEXTS,
215
226
  message: `${makeIntroForSpecificViolationMessage(
216
227
  USE_SERVER_LOGICS,
217
228
  USE_CLIENT_CONTEXTS
218
- )} (Special) Client Contexts Components, like any Client Components, cannot be tinkered with on the server.`,
229
+ )} ${
230
+ jscommentsConfig[directive21ConfigName][USE_SERVER_LOGICS][
231
+ USE_CLIENT_CONTEXTS
232
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_CONTEXTS
233
+ }`,
219
234
  },
220
- // USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components are able to safely render on the server, guaranteeing that only their `ComponentForServer` will be effectively involved in Prime Server Logics Modules.
235
+ // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_AGNOSTIC_CONDITIONS
221
236
  ],
222
237
  [USE_CLIENT_LOGICS]: [
223
238
  {
@@ -225,22 +240,30 @@ export const commentedDirectives_blockedImports = Object.freeze({
225
240
  message: `${makeIntroForSpecificViolationMessage(
226
241
  USE_CLIENT_LOGICS,
227
242
  USE_SERVER_LOGICS
228
- )} Prime Server Logics should never leak to the client.`,
243
+ )} ${
244
+ jscommentsConfig[directive21ConfigName][USE_CLIENT_LOGICS][
245
+ USE_SERVER_LOGICS
246
+ ] // $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_SERVER_LOGICS
247
+ }`,
229
248
  },
230
- // USE_CLIENT_LOGICS allowed, because Prime Client Logics can compose with one another.
231
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the client just like they can on the server.
249
+ // USE_CLIENT_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_CLIENT_LOGICS
250
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_AGNOSTIC_LOGICS
232
251
  {
233
252
  blockedImport: USE_SERVER_COMPONENTS,
234
253
  message: `${makeIntroForSpecificViolationMessage(
235
254
  USE_CLIENT_LOGICS,
236
255
  USE_SERVER_COMPONENTS
237
- )} Lineal Server Components cannot be thinkered with on the client.`,
256
+ )} ${
257
+ jscommentsConfig[directive21ConfigName][USE_CLIENT_LOGICS][
258
+ USE_SERVER_COMPONENTS
259
+ ] // $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_SERVER_COMPONENTS
260
+ }`,
238
261
  },
239
- // USE_CLIENT_COMPONENTS allowed, because Lineal Client Components, like any Client Components, are OK to be composed with Prime Client Logics as long as the Prime Client Logics Module, by convention, does not export React components.
240
- // USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.
241
- // USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions can technically be attached to Client Components that are being tinkered with within Client Logics Modules.
242
- // USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components, like any Client Components, are OK to be composed with Prime Client Logics as long as the Prime Client Logics Module, by convention, does not export React components.
243
- // USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components are able to safely render on the client, guaranteeing that only their `ComponentForClient` will be effectively involved in Prime Client Logics Modules.
262
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_CLIENT_COMPONENTS
263
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_AGNOSTIC_COMPONENTS
264
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_SERVER_FUNCTIONS
265
+ // USE_CLIENT_CONTEXTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_CLIENT_CONTEXTS
266
+ // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_AGNOSTIC_CONDITIONS
244
267
  ],
245
268
  [USE_AGNOSTIC_LOGICS]: [
246
269
  {
@@ -248,63 +271,91 @@ export const commentedDirectives_blockedImports = Object.freeze({
248
271
  message: `${makeIntroForSpecificViolationMessage(
249
272
  USE_AGNOSTIC_LOGICS,
250
273
  USE_SERVER_LOGICS
251
- )} Prime Server Logics cannot run on both the server and the client.`,
274
+ )} ${
275
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
276
+ USE_SERVER_LOGICS
277
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_LOGICS
278
+ }`,
252
279
  },
253
280
  {
254
281
  blockedImport: USE_CLIENT_LOGICS,
255
282
  message: `${makeIntroForSpecificViolationMessage(
256
283
  USE_AGNOSTIC_LOGICS,
257
284
  USE_CLIENT_LOGICS
258
- )} Prime Client Logics cannot run on both the server and the client.`,
285
+ )} ${
286
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
287
+ USE_CLIENT_LOGICS
288
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_LOGICS
289
+ }`,
259
290
  },
260
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can compose with one another.
291
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_LOGICS
261
292
  {
262
293
  blockedImport: USE_SERVER_COMPONENTS,
263
294
  message: `${makeIntroForSpecificViolationMessage(
264
295
  USE_AGNOSTIC_LOGICS,
265
296
  USE_SERVER_COMPONENTS
266
- )} Lineal Server Components cannot be tinkered with on both the server and the client.`,
297
+ )} ${
298
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
299
+ USE_SERVER_COMPONENTS
300
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_COMPONENTS
301
+ }`,
267
302
  },
268
303
  {
269
304
  blockedImport: USE_CLIENT_COMPONENTS,
270
305
  message: `${makeIntroForSpecificViolationMessage(
271
306
  USE_AGNOSTIC_LOGICS,
272
307
  USE_CLIENT_COMPONENTS
273
- )} Lineal Client Components, like any Client Components, cannot be tinkered with on both the server and the client.`,
308
+ )} ${
309
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
310
+ USE_CLIENT_COMPONENTS
311
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_COMPONENTS
312
+ }`,
274
313
  },
275
- // USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.
314
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_COMPONENTS
276
315
  {
277
316
  blockedImport: USE_SERVER_FUNCTIONS,
278
317
  message: `${makeIntroForSpecificViolationMessage(
279
318
  USE_AGNOSTIC_LOGICS,
280
319
  USE_SERVER_FUNCTIONS
281
- )} (Special) Server Functions can be modified on the server and on the client, but their use cases on both environments are not one-to-one compatible, since they're being addressed as they are on the server and addressed as references on the client.`,
320
+ )} ${
321
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
322
+ USE_SERVER_FUNCTIONS
323
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_FUNCTIONS
324
+ }`,
282
325
  },
283
326
  {
284
327
  blockedImport: USE_CLIENT_CONTEXTS,
285
328
  message: `${makeIntroForSpecificViolationMessage(
286
329
  USE_AGNOSTIC_LOGICS,
287
330
  USE_CLIENT_CONTEXTS
288
- )} (Special) Client Contexts Components, like any Client Components, cannot be tinkered with on both the server and the client.`,
331
+ )} ${
332
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
333
+ USE_CLIENT_CONTEXTS
334
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_CONTEXTS
335
+ }`,
289
336
  },
290
- // USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.
337
+ // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_CONDITIONS
291
338
  ],
292
339
  [USE_SERVER_COMPONENTS]: [
293
- // USE_SERVER_LOGICS allowed, because Prime Server Logics, being logic from the server, can safely support Lineal Server Components.
340
+ // USE_SERVER_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_SERVER_LOGICS
294
341
  {
295
342
  blockedImport: USE_CLIENT_LOGICS,
296
343
  message: `${makeIntroForSpecificViolationMessage(
297
344
  USE_SERVER_COMPONENTS,
298
345
  USE_CLIENT_LOGICS
299
- )} Prime Client Logics should never leak to the server.`,
346
+ )} ${
347
+ jscommentsConfig[directive21ConfigName][USE_SERVER_COMPONENTS][
348
+ USE_CLIENT_LOGICS
349
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_CLIENT_LOGICS
350
+ }`,
300
351
  },
301
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the server just like they can on the client.
302
- // USE_SERVER_COMPONENTS allowed, because Lineal Server Components can compose with one another, now that thanks to the inclusion of Agnostic Components they are actual Server Components.
303
- // USE_CLIENT_COMPONENTS allowed, because Lineal Client Components can be nested inside Server Components to create client boundaries when the root of the application is planted on the server.
304
- // USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can render safely on the server just like they can on the client.
305
- // USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions can be passed to imported Client Components within Lineal Server Components Modules, even though indeed Lineal Server Components Modules and Lineal Server Components can make their own Server Functions through inline 'use server' directives.
306
- // USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components can be nested inside Server Components to wrap some of the tree with client state accessible through child Client Components, and to pass through Server Components when the root of the application is planted on the server.
307
- // USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the server just like they can on the client.
352
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_AGNOSTIC_LOGICS
353
+ // USE_SERVER_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_SERVER_COMPONENTS
354
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_CLIENT_COMPONENTS
355
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_AGNOSTIC_COMPONENTS
356
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_SERVER_FUNCTIONS
357
+ // USE_CLIENT_CONTEXTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_CLIENT_CONTEXTS
358
+ // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_AGNOSTIC_CONDITIONS
308
359
  ],
309
360
  [USE_CLIENT_COMPONENTS]: [
310
361
  {
@@ -312,22 +363,30 @@ export const commentedDirectives_blockedImports = Object.freeze({
312
363
  message: `${makeIntroForSpecificViolationMessage(
313
364
  USE_CLIENT_COMPONENTS,
314
365
  USE_SERVER_LOGICS
315
- )} Prime Server Logics should never leak to the client.`,
366
+ )} ${
367
+ jscommentsConfig[directive21ConfigName][USE_CLIENT_COMPONENTS][
368
+ USE_SERVER_LOGICS
369
+ ] // $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_SERVER_LOGICS
370
+ }`,
316
371
  },
317
- // USE_CLIENT_LOGICS allowed, because Prime Client Logics, being logic from the client, can safely support Lineal Client Components, like any Client Components.
318
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the client just like they can on the server.
372
+ // USE_CLIENT_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_CLIENT_LOGICS
373
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_LOGICS
319
374
  {
320
375
  blockedImport: USE_SERVER_COMPONENTS,
321
376
  message: `${makeIntroForSpecificViolationMessage(
322
377
  USE_CLIENT_COMPONENTS,
323
378
  USE_SERVER_COMPONENTS
324
- )} Lineal Server Components cannot be the children of Lineal Client Components.`,
379
+ )} ${
380
+ jscommentsConfig[directive21ConfigName][USE_CLIENT_COMPONENTS][
381
+ USE_SERVER_COMPONENTS
382
+ ] // $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_SERVER_COMPONENTS
383
+ }`,
325
384
  },
326
- // USE_CLIENT_COMPONENTS allowed, because Lineal Client Components can compose with one another.
327
- // USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can render safely on the client just like they can on the server.
328
- // USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions are specifically triggered by Client Components.
329
- // USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components can effectively become Lineal and only render their children on the client via this mechanism since, by a Client Contexts Component being the child of a Lineal Client Component, the Client Contexts Component's children become the grand-children of an ancestor Lineal Client Component, enforcing them to render exclusively on the client.
330
- // USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the client just like they can on the server.
385
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_CLIENT_COMPONENTS
386
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_COMPONENTS
387
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_SERVER_FUNCTIONS
388
+ // USE_CLIENT_CONTEXTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_CLIENT_CONTEXTS
389
+ // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_CONDITIONS
331
390
  ],
332
391
  [USE_AGNOSTIC_COMPONENTS]: [
333
392
  {
@@ -335,74 +394,110 @@ export const commentedDirectives_blockedImports = Object.freeze({
335
394
  message: `${makeIntroForSpecificViolationMessage(
336
395
  USE_AGNOSTIC_COMPONENTS,
337
396
  USE_SERVER_LOGICS
338
- )} Prime Server Logics cannot run on both the server and the client.`,
397
+ )} ${
398
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_COMPONENTS][
399
+ USE_SERVER_LOGICS
400
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_SERVER_LOGICS
401
+ }`,
339
402
  },
340
403
  {
341
404
  blockedImport: USE_CLIENT_LOGICS,
342
405
  message: `${makeIntroForSpecificViolationMessage(
343
406
  USE_AGNOSTIC_COMPONENTS,
344
407
  USE_CLIENT_LOGICS
345
- )} Prime Client Logics cannot run on both the server and the client.`,
408
+ )} ${
409
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_COMPONENTS][
410
+ USE_CLIENT_LOGICS
411
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_LOGICS
412
+ }`,
346
413
  },
347
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components.
414
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_LOGICS
348
415
  {
349
416
  blockedImport: USE_SERVER_COMPONENTS,
350
417
  message: `${makeIntroForSpecificViolationMessage(
351
418
  USE_AGNOSTIC_COMPONENTS,
352
419
  USE_SERVER_COMPONENTS
353
- )} Lineal Server Components, unlike Lineal Client Components, cannot make silos of their own once on the opposing environment (the client in this case), and therefore cannot be executed from the client, making them unable to execute agnostically from both the server and the client.`,
420
+ )} ${
421
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_COMPONENTS][
422
+ USE_SERVER_COMPONENTS
423
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_SERVER_COMPONENTS
424
+ }`,
354
425
  },
355
- // USE_CLIENT_COMPONENTS allowed, because Lineal Client Components can be nested inside Agnostic Components to create client boundaries when the root of the application is planted on the server.
356
- // USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components, can compose with one another.
357
- // USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions can be passed to Client Components as props when Client Components are also legally imported into Agnostic Components Modules.
358
- // USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components can be nested inside Agnostic Components to wrap some of the tree with client state accessible through child Client Components, and to pass through Server Components (if still on the Server Tree) when the root of the application is planted on the server.
359
- // USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components can compose with Lineal Agnostic Components as if they were Lineal Agnostic Components themselves, making them a necessary mechanism for Server Components to be nested in Agnostic Components.
426
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_COMPONENTS
427
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_COMPONENTS
428
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_SERVER_FUNCTIONS
429
+ // USE_CLIENT_CONTEXTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_CONTEXTS
430
+ // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_CONDITIONS
360
431
  ],
361
432
  [USE_SERVER_FUNCTIONS]: [
362
- // USE_SERVER_LOGICS allowed, because Prime Server Logics, being logic from the server, can safely support (Special) Server Functions.
433
+ // USE_SERVER_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_SERVER_LOGICS
363
434
  {
364
435
  blockedImport: USE_CLIENT_LOGICS,
365
436
  message: `${makeIntroForSpecificViolationMessage(
366
437
  USE_SERVER_FUNCTIONS,
367
438
  USE_CLIENT_LOGICS
368
- )} Prime Client Logics should never leak to the server.`,
439
+ )} ${
440
+ jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
441
+ USE_CLIENT_LOGICS
442
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_LOGICS
443
+ }`,
369
444
  },
370
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the server just like they can on the client.
445
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_LOGICS
371
446
  {
372
447
  blockedImport: USE_SERVER_COMPONENTS,
373
448
  message: `${makeIntroForSpecificViolationMessage(
374
449
  USE_SERVER_FUNCTIONS,
375
450
  USE_SERVER_COMPONENTS
376
- )} Lineal Server Components aren't allowed because (Special) Server Functions have no business working with React Components.`,
451
+ )} ${
452
+ jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
453
+ USE_SERVER_COMPONENTS
454
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_SERVER_COMPONENTS
455
+ }`,
377
456
  },
378
457
  {
379
458
  blockedImport: USE_CLIENT_COMPONENTS,
380
459
  message: `${makeIntroForSpecificViolationMessage(
381
460
  USE_SERVER_FUNCTIONS,
382
461
  USE_CLIENT_COMPONENTS
383
- )} Lineal Client Components aren't allowed because (Special) Server Functions have no business working with React Components.`,
462
+ )} ${
463
+ jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
464
+ USE_CLIENT_COMPONENTS
465
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_COMPONENTS
466
+ }`,
384
467
  },
385
468
  {
386
469
  blockedImport: USE_AGNOSTIC_COMPONENTS,
387
470
  message: `${makeIntroForSpecificViolationMessage(
388
471
  USE_SERVER_FUNCTIONS,
389
472
  USE_AGNOSTIC_COMPONENTS
390
- )} Lineal Agnostic Components aren't allowed because (Special) Server Functions have no business working with React Components.`,
473
+ )} ${
474
+ jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
475
+ USE_AGNOSTIC_COMPONENTS
476
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_COMPONENTS
477
+ }`,
391
478
  },
392
- // USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions, even though they don't need to import one another and the same results can be generated via Prime Server Logics for the outcome of a single Server Function, can still compose with one another. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)
479
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_SERVER_FUNCTIONS
393
480
  {
394
481
  blockedImport: USE_CLIENT_CONTEXTS,
395
482
  message: `${makeIntroForSpecificViolationMessage(
396
483
  USE_SERVER_FUNCTIONS,
397
484
  USE_CLIENT_CONTEXTS
398
- )} (Special) Client Contexts Components aren't allowed because (Special) Server Functions have no business working with React Components.`,
485
+ )} ${
486
+ jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
487
+ USE_CLIENT_CONTEXTS
488
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_CONTEXTS
489
+ }`,
399
490
  },
400
491
  {
401
492
  blockedImport: USE_AGNOSTIC_CONDITIONS,
402
493
  message: `${makeIntroForSpecificViolationMessage(
403
494
  USE_SERVER_FUNCTIONS,
404
495
  USE_AGNOSTIC_CONDITIONS
405
- )} (Special) Agnostic Conditions Components aren't allowed because (Special) Server Functions have no business working with React Components.`,
496
+ )} ${
497
+ jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
498
+ USE_AGNOSTIC_CONDITIONS
499
+ ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_CONDITIONS
500
+ }`,
406
501
  },
407
502
  ],
408
503
  [USE_CLIENT_CONTEXTS]: [
@@ -411,22 +506,30 @@ export const commentedDirectives_blockedImports = Object.freeze({
411
506
  message: `${makeIntroForSpecificViolationMessage(
412
507
  USE_CLIENT_CONTEXTS,
413
508
  USE_SERVER_LOGICS
414
- )} Prime Server Logics should never leak to the client.`,
509
+ )} ${
510
+ jscommentsConfig[directive21ConfigName][USE_CLIENT_CONTEXTS][
511
+ USE_SERVER_LOGICS
512
+ ] // $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_SERVER_LOGICS
513
+ }`,
415
514
  },
416
- // USE_CLIENT_LOGICS allowed, because Prime Client Logics, being logic from the client, can safely support (Special) Client Contexts Components, like any Client Components.
417
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics can run safely on the client just like they can on the server.
515
+ // USE_CLIENT_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_CLIENT_LOGICS
516
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_AGNOSTIC_LOGICS
418
517
  {
419
518
  blockedImport: USE_SERVER_COMPONENTS,
420
519
  message: `${makeIntroForSpecificViolationMessage(
421
520
  USE_CLIENT_CONTEXTS,
422
521
  USE_SERVER_COMPONENTS
423
- )} Lineal Server Components may only pass through (Special) Client Contexts Components via the children prop within Server Components Modules.`,
522
+ )} ${
523
+ jscommentsConfig[directive21ConfigName][USE_CLIENT_CONTEXTS][
524
+ USE_SERVER_COMPONENTS
525
+ ] // $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_SERVER_COMPONENTS
526
+ }`,
424
527
  },
425
- // USE_CLIENT_COMPONENTS allowed, because Lineal Client Components can create client boundaries within (Special) Client Contexts Components.
426
- // USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can render safely on the client just like they can on the server.
427
- // USE_SERVER_FUNCTIONS allowed, because (Special) Server Functions are specifically triggered by Client Components.
428
- // USE_CLIENT_CONTEXTS allowed, because (Special) Client Contexts Components can compose with one another.
429
- // USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the client just like they can on the server, in a mechanism that allows (Special) Client Contexts Components to safely and indirectly compose with child Server Components within Client Contexts Modules.
528
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_CLIENT_COMPONENTS
529
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_AGNOSTIC_COMPONENTS
530
+ // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_SERVER_FUNCTIONS
531
+ // USE_CLIENT_CONTEXTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_CLIENT_CONTEXTS
532
+ // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_AGNOSTIC_CONDITIONS
430
533
  ],
431
534
  [USE_AGNOSTIC_CONDITIONS]: [
432
535
  {
@@ -434,36 +537,52 @@ export const commentedDirectives_blockedImports = Object.freeze({
434
537
  message: `${makeIntroForSpecificViolationMessage(
435
538
  USE_AGNOSTIC_CONDITIONS,
436
539
  USE_SERVER_LOGICS
437
- )} Prime Server Logics cannot run on both the server and the client.`,
540
+ )} ${
541
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_CONDITIONS][
542
+ USE_SERVER_LOGICS
543
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_SERVER_LOGICS
544
+ }`,
438
545
  },
439
546
  {
440
547
  blockedImport: USE_CLIENT_LOGICS,
441
548
  message: `${makeIntroForSpecificViolationMessage(
442
549
  USE_AGNOSTIC_CONDITIONS,
443
550
  USE_CLIENT_LOGICS
444
- )} Prime Client Logics cannot run on both the server and the client.`,
551
+ )} ${
552
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_CONDITIONS][
553
+ USE_CLIENT_LOGICS
554
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_CLIENT_LOGICS
555
+ }`,
445
556
  },
446
- // USE_AGNOSTIC_LOGICS allowed, because Prime Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components, including (Special) Agnostic Conditions Components. (In this case this is necessary for the import of the `conditionAgnosticComponent` function needed to make Agnostic Conditions Components.)
447
- // USE_SERVER_COMPONENTS allowed, because Lineal Server Components are to be paired as `ComponentForServer` components with `ComponentForClient` components to form (Special) Agnostic Conditions Components.
448
- // USE_CLIENT_COMPONENTS allowed, because Lineal Client Components are to be paired as `ComponentForClient` components with `ComponentForServer` components to form (Special) Agnostic Conditions Components.
449
- // USE_AGNOSTIC_COMPONENTS allowed, because Lineal Agnostic Components can take the place of `ComponentForServer` and/or `ComponentForClient` components to form (Special) Agnostic Conditions Components.
557
+ // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_AGNOSTIC_LOGICS
558
+ // USE_SERVER_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_SERVER_COMPONENTS
559
+ // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_CLIENT_COMPONENTS
560
+ // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_AGNOSTIC_COMPONENTS
450
561
  {
451
562
  blockedImport: USE_SERVER_FUNCTIONS,
452
563
  message: `${makeIntroForSpecificViolationMessage(
453
564
  USE_AGNOSTIC_CONDITIONS,
454
565
  USE_SERVER_FUNCTIONS
455
- )} (Special) Server Functions are not accepted because (Special) Agnostic Conditions Components only take finite, imported components as arguments in their making. As such, assigning props to these components, including Server Functions, is not made within Agnostic Conditions Modules.`,
566
+ )} ${
567
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_CONDITIONS][
568
+ USE_SERVER_FUNCTIONS
569
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_SERVER_FUNCTIONS
570
+ }`,
456
571
  },
457
572
  {
458
573
  blockedImport: USE_CLIENT_CONTEXTS,
459
574
  message: `${makeIntroForSpecificViolationMessage(
460
575
  USE_AGNOSTIC_CONDITIONS,
461
576
  USE_CLIENT_CONTEXTS
462
- )} (Special) Client Contexts Components cannot be used as component arguments for (Special) Agnostic Conditions Components since they only take Lineal Components as arguments in their making.`,
577
+ )} ${
578
+ jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_CONDITIONS][
579
+ USE_CLIENT_CONTEXTS
580
+ ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_CLIENT_CONTEXTS
581
+ }`,
463
582
  },
464
- // USE_AGNOSTIC_CONDITIONS allowed, because (Special) Agnostic Conditions Components, despite not being Lineal Components themselves, output components that can only be Lineal and compatible with their attributed rendering environments, making them acceptable arguments in the making of Agnostic Conditions Components.
583
+ // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_AGNOSTIC_CONDITIONS
465
584
  ],
466
585
  [USE_AGNOSTIC_STRATEGIES]: [
467
- // (Special) Agnostic Strategies Modules can import all known modules, except themselves since they cannot be imported as they are, only as and via Strategies. (Since Agnostic Strategies Modules cannot be imported as they are, there is no such things as a 'use agnostic strategies' importFileCommentedDirective.)
586
+ // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_STRATEGIES
468
587
  ],
469
588
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-use-agnostic",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "Highlights problematic server-client imports in projects made with the Fullstack React Architecture.",
5
5
  "keywords": [
6
6
  "eslint",