@md-code/config 0.0.1 → 0.0.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@md-code/config` are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.0.2] - 2026-11-29
9
+
10
+ ### Changed
11
+
12
+ - `base`: stops importing `@md-code/follow-architecture/ignore.js`. The list it read
13
+ (`IGNORE_PATHS`) is the scan scope of one repository — md-starter's apps, platform
14
+ packages, tooling scripts and JS files — and spreading it here shipped that scope
15
+ to every consumer. The tool now ships an empty `IGNORE_PATHS` too (0.3.3), and a
16
+ repository states its own scope once: the rule's `ignores` option and the CLI's
17
+ `--ignore` flags.
18
+
19
+ ### Removed
20
+
21
+ - The `Known limitation` note about `ignore.js` not being exported: the published
22
+ `@md-code/follow-architecture` does export it, and `base` no longer loads the tool.
package/README.md CHANGED
@@ -55,7 +55,7 @@ Names and what each one contains:
55
55
 
56
56
  | Name | Contents |
57
57
  | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
58
- | `base` | The rules everyone gets: `eslint:recommended` + typescript-eslint `recommended-type-checked` and `stylistic-type-checked` (type-aware, `project: true`), the `anti-trojan-source` and `security` plugins, `import` ordering and type-import rules, the repo-wide `ignores` (build outputs, configs, the architecture scan scope) |
58
+ | `base` | The rules everyone gets: `eslint:recommended` + typescript-eslint `recommended-type-checked` and `stylistic-type-checked` (type-aware, `project: true`), the `anti-trojan-source` and `security` plugins, `import` ordering and type-import rules, the repo-wide `ignores` (build outputs and configs) |
59
59
  | `architecture` | The `md-code/follow-architecture` rule, reading `architecture.yaml` from the linted project root. Built lazily: reading it without `@md-code/follow-architecture` installed throws `Cannot load the architecture config: install @md-code/follow-architecture` |
60
60
  | `browser` | `base` + `globals.browser` |
61
61
  | `node` | `base` + `globals.node` |
@@ -64,15 +64,13 @@ Names and what each one contains:
64
64
  | `products` | The three `@md-code/*-uniqueness` rules. Exposes `products.configure({ root, utilsFolder, componentsFolder, entitiesRoots })`. Empty (`[]`, and `configure()` returns `[]`) when the three tools are not installed, and always empty when `LINT_PRODUCTS=0` |
65
65
 
66
66
  `architecture` expects an `architecture.yaml` next to the linted project (the
67
- rule walks up from each file). With `@md-code/follow-architecture` installed,
68
- `base` also adds that tool's ignore paths to its `ignores`; without it the
69
- config simply carries no extra ignores. `base` and `architecture` are unaffected
70
- otherwise — the tool is never loaded for `tsconfig`, `stylelint` or the other
71
- ESLint configs.
72
-
73
- Known limitation: `base` and `architecture` load
74
- `@md-code/follow-architecture/ignore.js`, and the published `0.3.0` of that tool
75
- does not export it, so they need a release of `follow-architecture` that does.
67
+ rule walks up from each file). The tool ships no repository scope; the md-code
68
+ repositories state theirs ONCE in `eslint/scope.js` (`REPOSITORY_IGNORE`: the
69
+ apps, the platform packages, the tooling scripts, every JS file): `base` spreads
70
+ it into the flat `ignores`, the architecture rule gets it as its `ignores`
71
+ option, and a CLI run passes it as `--ignore` flags (md-starter's
72
+ `scripts/fa-ignore.mjs` prints them). Another repository replaces the list there.
73
+ `base` does not load `@md-code/follow-architecture` at all any more.
76
74
 
77
75
  ## tsconfig
78
76
 
@@ -71,9 +71,9 @@ const config = () => {
71
71
  {
72
72
  config: ARCH_CONFIG_FILE,
73
73
  ignoreDirs: ignore.IGNORE_DIRS,
74
- // The same list, for paths: the apps, the platform packages and the
75
- // tooling scripts are outside the contract, so the rule stays silent
76
- // on them even where ESLint still hands those files over.
74
+ // The tool ships no repository scope (`IGNORE_PATHS` is empty since 0.3.3):
75
+ // the apps, the platform packages and the tooling scripts are stated by
76
+ // the repository itself, which adds them here through `ignores`.
77
77
  ignores: ignore.IGNORE_PATHS,
78
78
  exportPath: overviewExportPath(),
79
79
  },
package/eslint/base.js CHANGED
@@ -6,18 +6,10 @@ const _import = require("eslint-plugin-import");
6
6
  const pluginSecurity = require("eslint-plugin-security");
7
7
  const path = require("node:path");
8
8
 
9
- // The architecture contract's scope, from the one place that states it: the CLI,
10
- // the ESLint rule and this config must ignore the same files, or a lint run pays
11
- // for files a scan run skips. `@md-code/follow-architecture` is an OPTIONAL peer
12
- // (see `README.md`): without it there is no contract to honour, so the extra
13
- // ignores are simply absent — everything else in this config still loads.
14
- const SCAN_SCOPE_PATHS = (() => {
15
- try {
16
- return require("@md-code/follow-architecture/ignore.js").IGNORE_PATHS ?? [];
17
- } catch {
18
- return [];
19
- }
20
- })();
9
+ // The repository's scan scope, from the one place that states it (`./scope.js`):
10
+ // the apps, the platform packages, the tooling scripts and every JS file. The
11
+ // tool ships none of it (`IGNORE_PATHS` is empty since 0.3.3).
12
+ const { REPOSITORY_IGNORE } = require("./scope.js");
21
13
 
22
14
  // In CommonJS, __dirname is already available, so no need to import fileURLToPath or define __filename
23
15
  const compat = new FlatCompat({
@@ -44,10 +36,7 @@ module.exports = [
44
36
  "**/.keystone",
45
37
  "**/dist",
46
38
  "**/yanm-lock.yaml",
47
- "**/*.js",
48
- // Everything outside the architecture contract: the apps, the platform
49
- // packages only they consume, the tooling scripts and every JS file.
50
- ...SCAN_SCOPE_PATHS,
39
+ ...REPOSITORY_IGNORE,
51
40
  ],
52
41
  },
53
42
  // Extend recommended configurations
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ // THE SCAN SCOPE OF THE md-starter REPOSITORY, stated once. The tool
4
+ // (`@md-code/follow-architecture`) ships none of it — `IGNORE_PATHS` there is
5
+ // empty — so the two callers that skip files read THIS list: the flat global
6
+ // `ignores` in `base.js` (every lint pass) and the architecture rule's `ignores`
7
+ // option (`packages/follow-architecture/eslint.products.config.mjs`); the CLI
8
+ // run gets the same entries as `--ignore` flags through
9
+ // `scripts/fa-ignore.mjs`. One list, three callers: a second copy would be a
10
+ // second scope, and a lint run and a scan run would quietly disagree.
11
+ //
12
+ // Paths and globs against the repo root: the deployable apps, the platform
13
+ // packages only they consume, the tooling scripts, every JS file (the
14
+ // repository's sources are TypeScript — a `.js`, `.cjs` or `.mjs` here is a
15
+ // config or a build artifact, not contract code), and the generated output and
16
+ // working folders of this repository (`dist`, `coverage`, `.artifacts`, …).
17
+ const REPOSITORY_IGNORE = Object.freeze([
18
+ "apps/**",
19
+ "packages/api/**",
20
+ "packages/native/**",
21
+ "packages/cli/**",
22
+ "packages/infrastructure/**",
23
+ "packages/stylelint/**",
24
+ "scripts/**",
25
+ "**/*.js",
26
+ "**/*.cjs",
27
+ "**/*.mjs",
28
+ "**/dist/**",
29
+ "**/build/**",
30
+ "**/out/**",
31
+ "**/coverage/**",
32
+ "**/.next/**",
33
+ "**/.keystone/**",
34
+ "**/.vscode-test/**",
35
+ ".artifacts/**",
36
+ ".turbo/**",
37
+ ".changeset/**",
38
+ ".agent/**",
39
+ "reports/**",
40
+ "screenshots/**",
41
+ ]);
42
+
43
+ module.exports = { REPOSITORY_IGNORE };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@md-code/config",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "private": false,
5
5
  "description": "Shared ESLint, Stylelint and TypeScript presets, imported by subpath.",
6
6
  "license": "Apache-2.0",
@@ -14,10 +14,13 @@
14
14
  "files": [
15
15
  "eslint/",
16
16
  "stylelint/",
17
- "tsconfig/"
17
+ "tsconfig/",
18
+ "CHANGELOG.md"
18
19
  ],
19
20
  "exports": {
20
21
  "./eslint": "./eslint/index.js",
22
+ "./eslint/*": "./eslint/*.js",
23
+ "./eslint/scope.js": "./eslint/scope.js",
21
24
  "./stylelint": "./stylelint/index.cjs",
22
25
  "./tsconfig/*.json": "./tsconfig/*.json",
23
26
  "./package.json": "./package.json"