@produtype/core 1.8.1 → 1.8.2

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.
@@ -104,10 +104,29 @@ async function detectEnv(ctx) {
104
104
  apiKey: [],
105
105
  unknown: [],
106
106
  };
107
- const hasEnvExample = ctx.files.all.includes('.env.example');
107
+ /**
108
+ * The template has more than one spelling, and one exact string knew one of them.
109
+ *
110
+ * immich ships `docker/example.env` — the name reversed, and one directory down,
111
+ * which is where a compose deployment keeps it — and was told at `medium` that it
112
+ * reads environment variables without publishing a template. The check was
113
+ * `files.all.includes('.env.example')`: the right idea matched against a single
114
+ * literal at the root.
115
+ *
116
+ * The vocabulary is small and conventional, so it is written out: `.env` followed
117
+ * by example, sample, template, dist or defaults, the same words in front of `.env`
118
+ * instead, and the `.env.local.example` shape a monorepo uses per application.
119
+ *
120
+ * `.env` itself is deliberately not in it, and neither is `.env.production`: the
121
+ * first is the real file — a different finding when it is committed — and the second
122
+ * is one environment's values rather than a blank somebody fills in.
123
+ */
124
+ const ENV_TEMPLATE = /(^|\/)(?:\.?env(?:\.[a-z0-9-]+)?\.(?:example|sample|template|dist|defaults)|(?:example|sample|template)\.env)$/i;
125
+ const envTemplates = ctx.files.all.filter((file) => ENV_TEMPLATE.test(file));
126
+ const hasEnvExample = envTemplates.length > 0;
108
127
  const hasEnv = ctx.files.all.includes('.env');
109
- if (hasEnvExample)
110
- evidence.push({ type: 'file', value: '.env.example' });
128
+ for (const file of envTemplates.slice(0, 3))
129
+ evidence.push({ type: 'file', value: file, file });
111
130
  if (hasEnv)
112
131
  evidence.push({ type: 'file', value: '.env' });
113
132
  const sourceFiles = ctx.files.source;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@produtype/core",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Deterministic CLI and library that analyzes a web application repository and reports how far it is from production-ready for the kind of product it is meant to be.",
5
5
  "license": "MIT",
6
6
  "bin": {