@powerlines/plugin-env 0.14.27 → 0.15.0

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.
@@ -440,7 +440,124 @@ function EnvBuiltin(props) {
440
440
  get initializer() {
441
441
  return [__alloy_js_core.code`createEnv(${defaultConfig || "{}"} as Partial<Env>);`];
442
442
  }
443
- })
443
+ }),
444
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
445
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
446
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
447
+ "export": true,
448
+ "const": true,
449
+ name: "isCI",
450
+ doc: "Detect if the application is running in a CI environment.",
451
+ initializer: __alloy_js_core.code`Boolean(
452
+ env.CI ||
453
+ env.RUN_ID ||
454
+ env.AGOLA_GIT_REF ||
455
+ env.AC_APPCIRCLE ||
456
+ env.APPVEYOR ||
457
+ env.CODEBUILD ||
458
+ env.TF_BUILD ||
459
+ env.bamboo_planKey ||
460
+ env.BITBUCKET_COMMIT ||
461
+ env.BITRISE_IO ||
462
+ env.BUDDY_WORKSPACE_ID ||
463
+ env.BUILDKITE ||
464
+ env.CIRCLECI ||
465
+ env.CIRRUS_CI ||
466
+ env.CF_BUILD_ID ||
467
+ env.CM_BUILD_ID ||
468
+ env.CI_NAME ||
469
+ env.DRONE ||
470
+ env.DSARI ||
471
+ env.EARTHLY_CI ||
472
+ env.EAS_BUILD ||
473
+ env.GERRIT_PROJECT ||
474
+ env.GITEA_ACTIONS ||
475
+ env.GITHUB_ACTIONS ||
476
+ env.GITLAB_CI ||
477
+ env.GOCD ||
478
+ env.BUILDER_OUTPUT ||
479
+ env.HARNESS_BUILD_ID ||
480
+ env.JENKINS_URL ||
481
+ env.LAYERCI ||
482
+ env.MAGNUM ||
483
+ env.NETLIFY ||
484
+ env.NEVERCODE ||
485
+ env.PROW_JOB_ID ||
486
+ env.RELEASE_BUILD_ID ||
487
+ env.RENDER ||
488
+ env.SAILCI ||
489
+ env.HUDSON ||
490
+ env.SCREWDRIVER ||
491
+ env.SEMAPHORE ||
492
+ env.SOURCEHUT ||
493
+ env.STRIDER ||
494
+ env.TASK_ID ||
495
+ env.RUN_ID ||
496
+ env.TEAMCITY_VERSION ||
497
+ env.TRAVIS ||
498
+ env.VELA ||
499
+ env.NOW_BUILDER ||
500
+ env.APPCENTER_BUILD_ID ||
501
+ env.CI_XCODE_PROJECT ||
502
+ env.XCS || false
503
+ );
504
+ `
505
+ }),
506
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
507
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
508
+ (0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDoc, {
509
+ heading: "Detect the \\`mode\\` of the current runtime environment.",
510
+ get children() {
511
+ return (0, __alloy_js_core_jsx_runtime.createComponent)(require_tsdoc.TSDocRemarks, { children: __alloy_js_core.code`The \`mode\` is determined by the \`MODE\` environment variable, or falls back to the \`NEXT_PUBLIC_VERCEL_ENV\`, \`NODE_ENV\`, or defaults to \`production\`. While the value can potentially be any string, Storm Software generally only allows a value in the following list:
512
+ - \`production\`
513
+ - \`test\`
514
+ - \`development\`` });
515
+ }
516
+ }),
517
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
518
+ "export": true,
519
+ "const": true,
520
+ name: "mode",
521
+ initializer: __alloy_js_core.code`String(env.MODE) || "production"; `
522
+ }),
523
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
524
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
525
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
526
+ "export": true,
527
+ "const": true,
528
+ name: "isProduction",
529
+ doc: "Detect if the application is running in \\\"production\\\\\" mode",
530
+ initializer: __alloy_js_core.code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
531
+ }),
532
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
533
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
534
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
535
+ "export": true,
536
+ "const": true,
537
+ name: "isTest",
538
+ doc: "Detect if the application is running in \"test\" mode",
539
+ initializer: __alloy_js_core.code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
540
+ }),
541
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
542
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
543
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
544
+ "export": true,
545
+ "const": true,
546
+ name: "isDevelopment",
547
+ doc: "Detect if the application is running in \"development\" mode",
548
+ initializer: __alloy_js_core.code`["dev", "development"].includes(mode.toLowerCase()); `
549
+ }),
550
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
551
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
552
+ (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
553
+ "export": true,
554
+ "const": true,
555
+ name: "isDebug",
556
+ doc: "Detect if the application is running in \"debug\" mode",
557
+ initializer: __alloy_js_core.code`Boolean(isDevelopment && env.DEBUG); `
558
+ }),
559
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
560
+ (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
444
561
  ];
445
562
  }
446
563
  }));
@@ -438,7 +438,124 @@ function EnvBuiltin(props) {
438
438
  get initializer() {
439
439
  return [code`createEnv(${defaultConfig || "{}"} as Partial<Env>);`];
440
440
  }
441
- })
441
+ }),
442
+ createIntrinsic("hbr", {}),
443
+ createIntrinsic("hbr", {}),
444
+ createComponent(VarDeclaration, {
445
+ "export": true,
446
+ "const": true,
447
+ name: "isCI",
448
+ doc: "Detect if the application is running in a CI environment.",
449
+ initializer: code`Boolean(
450
+ env.CI ||
451
+ env.RUN_ID ||
452
+ env.AGOLA_GIT_REF ||
453
+ env.AC_APPCIRCLE ||
454
+ env.APPVEYOR ||
455
+ env.CODEBUILD ||
456
+ env.TF_BUILD ||
457
+ env.bamboo_planKey ||
458
+ env.BITBUCKET_COMMIT ||
459
+ env.BITRISE_IO ||
460
+ env.BUDDY_WORKSPACE_ID ||
461
+ env.BUILDKITE ||
462
+ env.CIRCLECI ||
463
+ env.CIRRUS_CI ||
464
+ env.CF_BUILD_ID ||
465
+ env.CM_BUILD_ID ||
466
+ env.CI_NAME ||
467
+ env.DRONE ||
468
+ env.DSARI ||
469
+ env.EARTHLY_CI ||
470
+ env.EAS_BUILD ||
471
+ env.GERRIT_PROJECT ||
472
+ env.GITEA_ACTIONS ||
473
+ env.GITHUB_ACTIONS ||
474
+ env.GITLAB_CI ||
475
+ env.GOCD ||
476
+ env.BUILDER_OUTPUT ||
477
+ env.HARNESS_BUILD_ID ||
478
+ env.JENKINS_URL ||
479
+ env.LAYERCI ||
480
+ env.MAGNUM ||
481
+ env.NETLIFY ||
482
+ env.NEVERCODE ||
483
+ env.PROW_JOB_ID ||
484
+ env.RELEASE_BUILD_ID ||
485
+ env.RENDER ||
486
+ env.SAILCI ||
487
+ env.HUDSON ||
488
+ env.SCREWDRIVER ||
489
+ env.SEMAPHORE ||
490
+ env.SOURCEHUT ||
491
+ env.STRIDER ||
492
+ env.TASK_ID ||
493
+ env.RUN_ID ||
494
+ env.TEAMCITY_VERSION ||
495
+ env.TRAVIS ||
496
+ env.VELA ||
497
+ env.NOW_BUILDER ||
498
+ env.APPCENTER_BUILD_ID ||
499
+ env.CI_XCODE_PROJECT ||
500
+ env.XCS || false
501
+ );
502
+ `
503
+ }),
504
+ createIntrinsic("hbr", {}),
505
+ createIntrinsic("hbr", {}),
506
+ createComponent(TSDoc, {
507
+ heading: "Detect the \\`mode\\` of the current runtime environment.",
508
+ get children() {
509
+ return createComponent(TSDocRemarks, { children: code`The \`mode\` is determined by the \`MODE\` environment variable, or falls back to the \`NEXT_PUBLIC_VERCEL_ENV\`, \`NODE_ENV\`, or defaults to \`production\`. While the value can potentially be any string, Storm Software generally only allows a value in the following list:
510
+ - \`production\`
511
+ - \`test\`
512
+ - \`development\`` });
513
+ }
514
+ }),
515
+ createComponent(VarDeclaration, {
516
+ "export": true,
517
+ "const": true,
518
+ name: "mode",
519
+ initializer: code`String(env.MODE) || "production"; `
520
+ }),
521
+ createIntrinsic("hbr", {}),
522
+ createIntrinsic("hbr", {}),
523
+ createComponent(VarDeclaration, {
524
+ "export": true,
525
+ "const": true,
526
+ name: "isProduction",
527
+ doc: "Detect if the application is running in \\\"production\\\\\" mode",
528
+ initializer: code`["prd", "prod", "production"].includes(mode.toLowerCase()); `
529
+ }),
530
+ createIntrinsic("hbr", {}),
531
+ createIntrinsic("hbr", {}),
532
+ createComponent(VarDeclaration, {
533
+ "export": true,
534
+ "const": true,
535
+ name: "isTest",
536
+ doc: "Detect if the application is running in \"test\" mode",
537
+ initializer: code`["tst", "test", "testing", "stg", "stage", "staging"].includes(mode.toLowerCase()) || env.TEST; `
538
+ }),
539
+ createIntrinsic("hbr", {}),
540
+ createIntrinsic("hbr", {}),
541
+ createComponent(VarDeclaration, {
542
+ "export": true,
543
+ "const": true,
544
+ name: "isDevelopment",
545
+ doc: "Detect if the application is running in \"development\" mode",
546
+ initializer: code`["dev", "development"].includes(mode.toLowerCase()); `
547
+ }),
548
+ createIntrinsic("hbr", {}),
549
+ createIntrinsic("hbr", {}),
550
+ createComponent(VarDeclaration, {
551
+ "export": true,
552
+ "const": true,
553
+ name: "isDebug",
554
+ doc: "Detect if the application is running in \"debug\" mode",
555
+ initializer: code`Boolean(isDevelopment && env.DEBUG); `
556
+ }),
557
+ createIntrinsic("hbr", {}),
558
+ createIntrinsic("hbr", {})
442
559
  ];
443
560
  }
444
561
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-env",
3
- "version": "0.14.27",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
6
6
  "repository": {
@@ -211,5 +211,5 @@
211
211
  },
212
212
  "devDependencies": { "@types/node": "^24.10.4", "vite": "8.0.0-beta.2" },
213
213
  "publishConfig": { "access": "public" },
214
- "gitHead": "f27028746c0657470a2c93af2e3224565ae7fd61"
214
+ "gitHead": "41988f81e266a609148fcac22a535e5f12bbeb5f"
215
215
  }