@stencil/core 2.15.0 → 2.15.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/cli/index.cjs +72 -55
- package/cli/index.js +72 -55
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +109 -32
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +1 -1
- package/dev-server/client/index.js +3 -3
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +1 -1
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +13 -3
- package/mock-doc/index.d.ts +4 -0
- package/mock-doc/index.js +13 -3
- package/mock-doc/package.json +1 -1
- package/package.json +4 -2
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +11 -11
- package/sys/node/node-fetch.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +8 -8
- package/testing/package.json +1 -1
package/cli/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil CLI (CommonJS) v2.15.
|
|
2
|
+
Stencil CLI (CommonJS) v2.15.1 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -259,15 +259,16 @@ const pathComponents = (path, rootLength) => {
|
|
|
259
259
|
* @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
|
|
260
260
|
*/
|
|
261
261
|
const validateComponentTag = (tag) => {
|
|
262
|
+
// we want to check this first since we call some String.prototype methods below
|
|
263
|
+
if (typeof tag !== 'string') {
|
|
264
|
+
return `Tag "${tag}" must be a string type`;
|
|
265
|
+
}
|
|
262
266
|
if (tag !== tag.trim()) {
|
|
263
267
|
return `Tag can not contain white spaces`;
|
|
264
268
|
}
|
|
265
269
|
if (tag !== tag.toLowerCase()) {
|
|
266
270
|
return `Tag can not contain upper case characters`;
|
|
267
271
|
}
|
|
268
|
-
if (typeof tag !== 'string') {
|
|
269
|
-
return `Tag "${tag}" must be a string type`;
|
|
270
|
-
}
|
|
271
272
|
if (tag.length === 0) {
|
|
272
273
|
return `Received empty tag value`;
|
|
273
274
|
}
|
|
@@ -329,9 +330,19 @@ const parseFlags = (args, sys) => {
|
|
|
329
330
|
});
|
|
330
331
|
return flags;
|
|
331
332
|
};
|
|
333
|
+
/**
|
|
334
|
+
* Parse command line arguments that are whitelisted via the BOOLEAN_ARG_OPTS,
|
|
335
|
+
* STRING_ARG_OPTS, and NUMBER_ARG_OPTS arrays in this file. Handles leading
|
|
336
|
+
* dashes on arguments, aliases that are defined for a small number of argument
|
|
337
|
+
* types, and parsing values for non-boolean arguments (e.g. port number).
|
|
338
|
+
*
|
|
339
|
+
* @param flags a ConfigFlags object
|
|
340
|
+
* @param args an array of command-line arguments to parse
|
|
341
|
+
* @param knownArgs an array to which all recognized, legal arguments are added
|
|
342
|
+
*/
|
|
332
343
|
const parseArgs = (flags, args, knownArgs) => {
|
|
333
|
-
|
|
334
|
-
const alias =
|
|
344
|
+
BOOLEAN_ARG_OPTS.forEach((booleanName) => {
|
|
345
|
+
const alias = ARG_OPTS_ALIASES[booleanName];
|
|
335
346
|
const flagKey = configCase(booleanName);
|
|
336
347
|
if (typeof flags[flagKey] !== 'boolean') {
|
|
337
348
|
flags[flagKey] = null;
|
|
@@ -359,8 +370,8 @@ const parseArgs = (flags, args, knownArgs) => {
|
|
|
359
370
|
}
|
|
360
371
|
});
|
|
361
372
|
});
|
|
362
|
-
|
|
363
|
-
const alias =
|
|
373
|
+
STRING_ARG_OPTS.forEach((stringName) => {
|
|
374
|
+
const alias = ARG_OPTS_ALIASES[stringName];
|
|
364
375
|
const flagKey = configCase(stringName);
|
|
365
376
|
if (typeof flags[flagKey] !== 'string') {
|
|
366
377
|
flags[flagKey] = null;
|
|
@@ -403,8 +414,8 @@ const parseArgs = (flags, args, knownArgs) => {
|
|
|
403
414
|
}
|
|
404
415
|
}
|
|
405
416
|
});
|
|
406
|
-
|
|
407
|
-
const alias =
|
|
417
|
+
NUMBER_ARG_OPTS.forEach((numberName) => {
|
|
418
|
+
const alias = ARG_OPTS_ALIASES[numberName];
|
|
408
419
|
const flagKey = configCase(numberName);
|
|
409
420
|
if (typeof flags[flagKey] !== 'number') {
|
|
410
421
|
flags[flagKey] = null;
|
|
@@ -448,50 +459,56 @@ const parseArgs = (flags, args, knownArgs) => {
|
|
|
448
459
|
};
|
|
449
460
|
const configCase = (prop) => {
|
|
450
461
|
prop = dashToPascalCase(prop);
|
|
451
|
-
return prop.charAt(0).toLowerCase() + prop.
|
|
462
|
+
return prop.charAt(0).toLowerCase() + prop.slice(1);
|
|
452
463
|
};
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
464
|
+
const BOOLEAN_ARG_OPTS = [
|
|
465
|
+
'build',
|
|
466
|
+
'cache',
|
|
467
|
+
'check-version',
|
|
468
|
+
'ci',
|
|
469
|
+
'compare',
|
|
470
|
+
'debug',
|
|
471
|
+
'dev',
|
|
472
|
+
'devtools',
|
|
473
|
+
'docs',
|
|
474
|
+
'e2e',
|
|
475
|
+
'es5',
|
|
476
|
+
'esm',
|
|
477
|
+
'headless',
|
|
478
|
+
'help',
|
|
479
|
+
'log',
|
|
480
|
+
'open',
|
|
481
|
+
'prerender',
|
|
482
|
+
'prerender-external',
|
|
483
|
+
'prod',
|
|
484
|
+
'profile',
|
|
485
|
+
'service-worker',
|
|
486
|
+
'screenshot',
|
|
487
|
+
'serve',
|
|
488
|
+
'skip-node-check',
|
|
489
|
+
'spec',
|
|
490
|
+
'ssr',
|
|
491
|
+
'stats',
|
|
492
|
+
'update-screenshot',
|
|
493
|
+
'verbose',
|
|
494
|
+
'version',
|
|
495
|
+
'watch',
|
|
496
|
+
];
|
|
497
|
+
const NUMBER_ARG_OPTS = ['max-workers', 'port'];
|
|
498
|
+
const STRING_ARG_OPTS = [
|
|
499
|
+
'address',
|
|
500
|
+
'config',
|
|
501
|
+
'docs-json',
|
|
502
|
+
'emulate',
|
|
503
|
+
'log-level',
|
|
504
|
+
'root',
|
|
505
|
+
'screenshot-connector',
|
|
506
|
+
];
|
|
507
|
+
const ARG_OPTS_ALIASES = {
|
|
508
|
+
config: 'c',
|
|
509
|
+
help: 'h',
|
|
510
|
+
port: 'p',
|
|
511
|
+
version: 'v',
|
|
495
512
|
};
|
|
496
513
|
const getNpmConfigEnvArgs = (sys) => {
|
|
497
514
|
// process.env.npm_config_argv
|
|
@@ -513,7 +530,7 @@ const getNpmConfigEnvArgs = (sys) => {
|
|
|
513
530
|
const dependencies = [
|
|
514
531
|
{
|
|
515
532
|
name: "@stencil/core",
|
|
516
|
-
version: "2.15.
|
|
533
|
+
version: "2.15.1",
|
|
517
534
|
main: "compiler/stencil.js",
|
|
518
535
|
resources: [
|
|
519
536
|
"package.json",
|
|
@@ -1453,7 +1470,7 @@ describe('${name}', () => {
|
|
|
1453
1470
|
/**
|
|
1454
1471
|
* Convert a dash case string to pascal case.
|
|
1455
1472
|
*/
|
|
1456
|
-
const toPascalCase = (str) => str.split('-').reduce((res, part) => res + part[0].toUpperCase() + part.
|
|
1473
|
+
const toPascalCase = (str) => str.split('-').reduce((res, part) => res + part[0].toUpperCase() + part.slice(1), '');
|
|
1457
1474
|
|
|
1458
1475
|
const taskTelemetry = async (config, sys, logger) => {
|
|
1459
1476
|
const prompt = logger.dim(sys.details.platform === 'windows' ? '>' : '$');
|
package/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil CLI v2.15.
|
|
2
|
+
Stencil CLI v2.15.1 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
const toLowerCase = (str) => str.toLowerCase();
|
|
5
5
|
const dashToPascalCase = (str) => toLowerCase(str)
|
|
@@ -235,15 +235,16 @@ const pathComponents = (path, rootLength) => {
|
|
|
235
235
|
* @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
|
|
236
236
|
*/
|
|
237
237
|
const validateComponentTag = (tag) => {
|
|
238
|
+
// we want to check this first since we call some String.prototype methods below
|
|
239
|
+
if (typeof tag !== 'string') {
|
|
240
|
+
return `Tag "${tag}" must be a string type`;
|
|
241
|
+
}
|
|
238
242
|
if (tag !== tag.trim()) {
|
|
239
243
|
return `Tag can not contain white spaces`;
|
|
240
244
|
}
|
|
241
245
|
if (tag !== tag.toLowerCase()) {
|
|
242
246
|
return `Tag can not contain upper case characters`;
|
|
243
247
|
}
|
|
244
|
-
if (typeof tag !== 'string') {
|
|
245
|
-
return `Tag "${tag}" must be a string type`;
|
|
246
|
-
}
|
|
247
248
|
if (tag.length === 0) {
|
|
248
249
|
return `Received empty tag value`;
|
|
249
250
|
}
|
|
@@ -305,9 +306,19 @@ const parseFlags = (args, sys) => {
|
|
|
305
306
|
});
|
|
306
307
|
return flags;
|
|
307
308
|
};
|
|
309
|
+
/**
|
|
310
|
+
* Parse command line arguments that are whitelisted via the BOOLEAN_ARG_OPTS,
|
|
311
|
+
* STRING_ARG_OPTS, and NUMBER_ARG_OPTS arrays in this file. Handles leading
|
|
312
|
+
* dashes on arguments, aliases that are defined for a small number of argument
|
|
313
|
+
* types, and parsing values for non-boolean arguments (e.g. port number).
|
|
314
|
+
*
|
|
315
|
+
* @param flags a ConfigFlags object
|
|
316
|
+
* @param args an array of command-line arguments to parse
|
|
317
|
+
* @param knownArgs an array to which all recognized, legal arguments are added
|
|
318
|
+
*/
|
|
308
319
|
const parseArgs = (flags, args, knownArgs) => {
|
|
309
|
-
|
|
310
|
-
const alias =
|
|
320
|
+
BOOLEAN_ARG_OPTS.forEach((booleanName) => {
|
|
321
|
+
const alias = ARG_OPTS_ALIASES[booleanName];
|
|
311
322
|
const flagKey = configCase(booleanName);
|
|
312
323
|
if (typeof flags[flagKey] !== 'boolean') {
|
|
313
324
|
flags[flagKey] = null;
|
|
@@ -335,8 +346,8 @@ const parseArgs = (flags, args, knownArgs) => {
|
|
|
335
346
|
}
|
|
336
347
|
});
|
|
337
348
|
});
|
|
338
|
-
|
|
339
|
-
const alias =
|
|
349
|
+
STRING_ARG_OPTS.forEach((stringName) => {
|
|
350
|
+
const alias = ARG_OPTS_ALIASES[stringName];
|
|
340
351
|
const flagKey = configCase(stringName);
|
|
341
352
|
if (typeof flags[flagKey] !== 'string') {
|
|
342
353
|
flags[flagKey] = null;
|
|
@@ -379,8 +390,8 @@ const parseArgs = (flags, args, knownArgs) => {
|
|
|
379
390
|
}
|
|
380
391
|
}
|
|
381
392
|
});
|
|
382
|
-
|
|
383
|
-
const alias =
|
|
393
|
+
NUMBER_ARG_OPTS.forEach((numberName) => {
|
|
394
|
+
const alias = ARG_OPTS_ALIASES[numberName];
|
|
384
395
|
const flagKey = configCase(numberName);
|
|
385
396
|
if (typeof flags[flagKey] !== 'number') {
|
|
386
397
|
flags[flagKey] = null;
|
|
@@ -424,50 +435,56 @@ const parseArgs = (flags, args, knownArgs) => {
|
|
|
424
435
|
};
|
|
425
436
|
const configCase = (prop) => {
|
|
426
437
|
prop = dashToPascalCase(prop);
|
|
427
|
-
return prop.charAt(0).toLowerCase() + prop.
|
|
438
|
+
return prop.charAt(0).toLowerCase() + prop.slice(1);
|
|
428
439
|
};
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
440
|
+
const BOOLEAN_ARG_OPTS = [
|
|
441
|
+
'build',
|
|
442
|
+
'cache',
|
|
443
|
+
'check-version',
|
|
444
|
+
'ci',
|
|
445
|
+
'compare',
|
|
446
|
+
'debug',
|
|
447
|
+
'dev',
|
|
448
|
+
'devtools',
|
|
449
|
+
'docs',
|
|
450
|
+
'e2e',
|
|
451
|
+
'es5',
|
|
452
|
+
'esm',
|
|
453
|
+
'headless',
|
|
454
|
+
'help',
|
|
455
|
+
'log',
|
|
456
|
+
'open',
|
|
457
|
+
'prerender',
|
|
458
|
+
'prerender-external',
|
|
459
|
+
'prod',
|
|
460
|
+
'profile',
|
|
461
|
+
'service-worker',
|
|
462
|
+
'screenshot',
|
|
463
|
+
'serve',
|
|
464
|
+
'skip-node-check',
|
|
465
|
+
'spec',
|
|
466
|
+
'ssr',
|
|
467
|
+
'stats',
|
|
468
|
+
'update-screenshot',
|
|
469
|
+
'verbose',
|
|
470
|
+
'version',
|
|
471
|
+
'watch',
|
|
472
|
+
];
|
|
473
|
+
const NUMBER_ARG_OPTS = ['max-workers', 'port'];
|
|
474
|
+
const STRING_ARG_OPTS = [
|
|
475
|
+
'address',
|
|
476
|
+
'config',
|
|
477
|
+
'docs-json',
|
|
478
|
+
'emulate',
|
|
479
|
+
'log-level',
|
|
480
|
+
'root',
|
|
481
|
+
'screenshot-connector',
|
|
482
|
+
];
|
|
483
|
+
const ARG_OPTS_ALIASES = {
|
|
484
|
+
config: 'c',
|
|
485
|
+
help: 'h',
|
|
486
|
+
port: 'p',
|
|
487
|
+
version: 'v',
|
|
471
488
|
};
|
|
472
489
|
const getNpmConfigEnvArgs = (sys) => {
|
|
473
490
|
// process.env.npm_config_argv
|
|
@@ -489,7 +506,7 @@ const getNpmConfigEnvArgs = (sys) => {
|
|
|
489
506
|
const dependencies = [
|
|
490
507
|
{
|
|
491
508
|
name: "@stencil/core",
|
|
492
|
-
version: "2.15.
|
|
509
|
+
version: "2.15.1",
|
|
493
510
|
main: "compiler/stencil.js",
|
|
494
511
|
resources: [
|
|
495
512
|
"package.json",
|
|
@@ -1429,7 +1446,7 @@ describe('${name}', () => {
|
|
|
1429
1446
|
/**
|
|
1430
1447
|
* Convert a dash case string to pascal case.
|
|
1431
1448
|
*/
|
|
1432
|
-
const toPascalCase = (str) => str.split('-').reduce((res, part) => res + part[0].toUpperCase() + part.
|
|
1449
|
+
const toPascalCase = (str) => str.split('-').reduce((res, part) => res + part[0].toUpperCase() + part.slice(1), '');
|
|
1433
1450
|
|
|
1434
1451
|
const taskTelemetry = async (config, sys, logger) => {
|
|
1435
1452
|
const prompt = logger.dim(sys.details.platform === 'windows' ? '>' : '$');
|
package/cli/package.json
CHANGED