Repository navigation
Releases
v0.12.3
Patch Changes
- #272
bc1b213- With the registry, the move suggestions now read the names in the auto-import and component dirs that each layer adds withimports.dirsorcomponents, and check a move whose destination is in such a dir. Before, a move could give a file the same name as a file in such a dir of another layer.
v0.12.1
v0.12.0
Minor Changes
-
#256
51a7c93- Report overridden auto-imports with the new shadowed-auto-import rule (warn by default). Run "nuxi prepare" after the update to write the registry again. -
#246
6d8f722- Report overridden pages with the new shadowed-page rule (warn by default). Run "nuxi prepare" after the update to write the registry again.
Patch Changes
-
#253
ec77545- The GitHub Action now shows an error when the nuxt-layerscope CLI is too old for an option that the action gives to it. The error says to update nuxt-layerscope in the project, or to change theversioninput. The CI guide now advisesstrict-baseline. -
#251
866c769-check --update-baseline,init --baselineand the DevTools tab now make the folder of the baseline file when it does not exist. When layerscope cannot make the folder or write the file, the error names the file and the reason, for exampleCannot write /app/ci/layerscope-baseline.json (EACCES). -
#258
5286c08- The DevTools tab now shows the result of the new config when the config changes while a check runs. An ignore, a remove or an undo after a file or config change now shows a full new run. An ignore or a remove no longer writes to the baseline file of the old config when the config changed during a run: the tab asks you to try again. The tab also shows a change in the list of fixed baseline entries when nothing else changes. -
#252
f041ee5-driftnow follows a moved file that has a relative import through a symbolic link, when the link and its target did not move. Before,driftmade the path to the real file, so the accepted finding counted as added and fixed. Nowdriftkeeps the path through the link, for example../a/x.v2for a link toa/foo.ts, or../a/lib.v2/useCartfor a link to a directory. -
#254
4ae60fe-initnow makes the folder of the config file when it does not exist. Wheninitcannot write the config file, the error names the file and the reason. Wheninit --baselinecannot write the baseline, the config is already written. The error says so and tells you to run the same command again with--force. -
#245
6a2ff02-init --forcenow keeps theexpose,pathandsourcekeys of each old layer, and uses them in its analysis. So the baseline also has the findings thatexposecauses. When a layer in the old config has one of these keys andinitcannot find that layer,initstops and writes nothing. Remove or fix that entry, and runinitagain. An old layer entry that has onlyallowis not kept. -
#244
8a50fc4- layerscope no longer suggests a move of a script file (.ts,.tsx,.js,.jsx,.mjs,.mts,.cjsor.cts) into a layer that setsimports.dirsto a list that is not empty, or turnsimports.scanoff. Such a layer can scan the dir that the file goes to, also when only explicit imports use the file, and Nuxt then uses only one of two auto-imports with the same name. Before, only a file that was used as an auto-import got this check. -
#257
e82dbbf- layerscope no longer suggests a move of a file when a layer other than the owner and the target has an auto-import or a component with the same name, in the dirs that Nuxt scans by default. Nuxt then uses only one of the files, for most dirs the one of the layer that comes first. So after the move, the file of that other layer could take the name, and the code that uses the name would get another file. layerscope does not compare the layer order, so such a layer stops the move also when the target comes first. Oneexport * froma package in an auto-import dir of any layer now stops every move of a file with auto-import names.
v0.11.1
Patch Changes
-
#239
98eb05a-checkwith file arguments,--staged,--changedor--sinceand no source file to check now reads the config and the baseline, and exits2when it cannot read them. Before, it exited0without reading them in the text and github formats, and the json, sarif and gitlab formats gave an empty report for any error, for example a syntax error in the config or a damaged baseline. A missing or old.nuxtstill gives exit0; in the json, sarif and gitlab formats the report is empty and has a note. -
#238
04eb8ea-fixrewrites animport()in a template at the position that the template compiler gives, not at the first match of its text. Before, a string such as"import('./a')"before the realimport('./a')got the rewrite, and the real import kept the old path. When the quotes of the path are an HTML character reference, such as",fixnow stops and tells you to use'or"as the quote. Animport()that layerscope cannot place exactly in a template expression, for example when the same expression has an HTML character reference such as&&, is not rewritten now (before, it often was):fixstops and says how to change the template.
v0.11.0
Minor Changes
- #236
6f447e7- Report overridden layouts and route middleware with the new shadowed-layout and shadowed-middleware rules (warn by default). Run "nuxi prepare" after the update to write the registry again.
Patch Changes
-
#222
944e7f5- The action reads the inputsprepare,strict-baselineandcommentwithout case, as it readsfail-on-growth. Before, a value such asTruewas read asfalse, with no error. -
#234
71654e3- The action reads drift growth only from the growth line of the report, as a whole line. Before, the text(--fail-on-growth).anywhere in the report, for example in a file path, counted as growth. The docs now say which commitfail-on-growthcompares with: the latest commit of the base branch on a pull request, the commit before the push on a push, and the base of the merge group in a merge queue. -
#226
2c10e5a- Move suggestions andfixread the auto-import dirscomposables/,utils/,shared/utils/andshared/types/as Nuxt reads them: only the files at the top level. Before, layerscope also read theindexfile of each sub dir, such ascomposables/cart/index.ts. Nuxt does not read that file, so a move there broke the auto-import. Such a file now gets no move. A name in such a file of a target layer is no longer a name conflict.server/utilsdoes not change, because Nitro reads it at any depth. -
#229
8db7465---configwith an empty value, a number or a second--confignow stops with a clear message and exit code 2. Before, it gave an error such as "input.replace is not a function". When layerscope cannot read a folder on the path of the config file, it now says so and stops. Before, it said "Config file not found", or it ran with no config. In the JS API,analyze({ baseline: false })now applies no baseline. -
#231
105a645-driftgives git only the files of the project when it looks for renamed files, so it is faster in a large repository. When git skips its rename check because more files changed than its rename limit,driftnow prints a note. Before, the files thatfixmoved then counted as added and fixed, with no message. -
#223
6b6a00d-init --forcekeeps the config keys that it does not write, such asbaseline,rulesandignore, and its analysis uses them. Before, it wrote onlylayersandbuildDir, socheckread the default baseline file again and reported the accepted findings.init --force --baselinewrites the file that the keptbaselinekey names. A note tells you when the new config drops the expose, path or source keys of a layer. A value that is not plain data stopsinit --forcewith an error. -
#224
9f29a96-fixmakes a correct path for an import through a link whose name has a dot, such as./x.v2for a link tofoo.ts. Before, the new path had the name of the target with the dot part of the link name, such as../b/foo.v2, and that path did not resolve. A link name with the same name as its target, such as./foo.v2for a link tofoo.ts, still keeps the dot part. -
#235
3d3af90- A registry whose recordednuxt.configoptions are not an object, for exampleconfig: nullin a damaged file, now stops with a clear message, instead of a crash or a run that silently ignored the options. Only the project options (preset,layers,rules,ignore,globalsandtypeImports) are read from the registry, as the module writes them. Other keys in a hand-edited registry, such asbaseline, are not read. -
#232
e1be090- SARIF and GitLab reports now keep the fingerprint of each finding the same on every run, also for two findings of one use that differ only in their target file or message. Before, the two could swap fingerprints when the order of the targets changed. After the update, such an alert can show the other target one time. -
#228
3fb7c01-resolveComponent()directly in a top-levelconstof<script setup>, as inconst C = resolveComponent('MyButton')with<component :is="C">, no longer gives a dynamic component warning.unusedno longer marks every unused component as possibly used for such a file. -
#225
15f5d05- An import of a layer by its package name now finds the file whenexportsormainnames it without an extension, or with.jsfor a.tsfile, as Vite does. An import of a path thatexportssets tonullno longer resolves to a file. A layerpackage.jsonwith an invalidexports, a leading BOM or comment lines now stops the run with an error that names the file, when the layer is imported by its package name. Before, layerscope did not see the problem, and such an import did not resolve. -
#233
db4efcb- Move suggestions andfixfind the file of a relativeexport * fromin an auto-import dir as unimport finds it:x.mts,x/index.mts,x.cts, and so on, in the order of unimport. Before, they used the import resolver, so they could read the names of another file than Nuxt reads, or of a file that Nuxt does not read, such as./y.jsfory.ts. -
#230
e95bf79- With--strict-baselineand only fixed baseline entries, the text report no longer shows the green "No problems" line above the line that fails the check. The hint for fixed entries, in the text report and in the GitHub annotations, now gives the full--update-baselinecommand with the same root,--config,--source,--baselineand--prepareas the run. A value that starts with-is written as--config=-c.tsin that command, so the command runs as shown. -
#227
730e14b- Without the registry (--source types, or whenautofalls back to the generated.d.tsfiles), the stale check skips a component file that Nuxt ignores (ignore,ignorePrefixor.nuxtignore) in the defaultcomponents/dirs. It reads the ignore rules with the@nuxt/kitof the project. Before, such a file, for examplecomponents/-Draft.vue, gave "missing from components.d.ts" and exit code 2 on each run.
v0.10.0
Minor Changes
-
#200
6b193f4- The action accepts growth on a pull request with the labellayerscope: accept growth: thefail-on-growthstep then passes with a notice. A push and a merge queue run do not read the label. -
#199
32b00e1- Adddrift --fail-on-growthand the action inputfail-on-growth. They fail when the code has errors that the baseline on the base branch does not have, also when the pull request adds them to the baseline. Before, the drift report showed the growth but could not fail the job. -
#185
94a14f1- Addcheck --strict-baselineand the action inputstrict-baseline. They fail the check when the baseline has fixed entries, so a fixed violation cannot come back while its entry is still in the file. The message tells you to runlayerscope check --update-baseline. Without the option, fixed entries are listed as before and do not fail the check.
Patch Changes
-
#184
dc0f0f9- Arguments after--are used as positional arguments, for example a root that starts with-. Before, layerscope ignored them. A command line that has words after--can now stop with an error, orcheckcan read them as the root and the files. Remove the words that are not a root or a file. -
#195
14fb71c-driftfollows the tracked files that git renames between the base ref and the working tree. A renamed file with accepted violations no longer counts as added and fixed. A new violation in it still counts as added.driftfollows a rename only when git finds at least 50% of the file the same, or 30% when the file moves to the same place in another layer, asfixmoves it. So an unrelated file at the same place in another layer can take the accepted entries of a deleted file that name no target layer, such asunresolved-referenceentries.driftalso finds a renamed baseline file in the root at its old path on the base ref. A copy, a move to another layer for a finding that names a target layer, a rename that git does not find, an alias import of a renamed file, and a relative import that is not in the form thatfixwrites still count as added and fixed. If git fails while it lists the renames,driftstops with exit code2. -
#189
7b48459- Thefixline about other findings no longer says that they have suggestions. Some findings have none, for exampleunresolved-reference,shadowed-componentandlayer-cycle. The line now ends with "Runlayerscope checkto see them." -
#194
2e3737c-initcounts code that it cannot read apart from unresolved references. JSON findings for such code haveunread: true. -
#198
749a76d-layerscope initsays "No references found." when the project has no references. Before, it said "All 0 references resolved." -
#197
41e4448- When layerscope drops a planned move, the "leave" suggestion of its findings no longer says that no layer can hold the file. It says that the plan drops the move. -
#201
059b3a0-fixand the move suggestions ofcheckread the names of a file with mlly, the parser that Nuxt uses. Type exports (export type,export interface) andexport * as nameare names, and so are the other forms that Nuxt reads, for exampleexport const a = 1, b = 2. A relativeexport * fromis read. Anexport * froma package or an alias, or one whose path does not resolve, can export any name, so it conflicts with any auto-import on the other side of a move. A default export keeps the case of its file name, unless the name has-,_or.. The.tsx,.jsx,.ctsand.cjsfiles in the target are read too, and so are the server utils in sub dirs of the target, as Nitro reads them. -
#193
16e427e- Thefixnote about the files thatcheckandfixskip now says that they do not check the imports in these files. Before, it said that they do not read them, but layerscope loadsnuxt.config.*to find the layers. -
#196
06e47cc-fixkeeps a name with a dot when it rewrites an import to a file that it found through a symbolic link, or with a name in another letter case. Before, the end of the name was added again:./x.moduleforx.module.tsgotx.module.module, and./lib.v2forlib.v2/index.tsgotlib.v2/index.v2. -
#190
9d5536b-checkreadsimport()in a template. Animport()with a fixed path is now an import, so it can givelayer-boundaryfindings and it counts as a use inunusedandwhy. Animport()with a path that is not a fixed string is reported byunresolved-reference, andunusedlists the file as unread. -
#188
dc0de58- The DevTools Unused view shows the "possibly used" banner only when it lists a component. -
#180
eb4b360-unusedmarks global components "possibly used at runtime". When the project uses Nuxt Content, which can render any component by its name from a content file,unusedmarks every component. Each unused entry has a newglobalfield, andblindSpotshas a newnuxt-contentkind. With--source types,unusedfinds only thecomponents/global/dir and the.globalsuffix, and finds Nuxt Content only whenmodulesnames it as a string. The registry has new fields, so runnuxi prepareonce after the update. -
#186
f49b9b3-unusedshows thesharedcontext for an auto-import inshared/. Before, it showedapp. The DevTools Unused view shows each row aslayerscope unusedshows it, withexposedand "possibly used at runtime".
v0.9.0
Minor Changes
-
#175
1a996f4- A newbaselinekey inlayerscope.config.tsnames the baseline file once.check(also with--update-baseline,--summaryand--watch),drift,fix,mcpand the GitHub Action use it.init --baselinedoes not use it. The--baselineoption and thebaselineinput of the action override it. Thebaselineinput of the action now has no default value, so the key applies.analyze()acceptsbaseline: truefor the file of the config. -
#172
f3e73b4---configis now relative to the project root, as--baselineis. Before, it was relative to the current directory. This changes a run with a root argument, for examplelayerscope check apps/shop --config layerscope.config.ts, and theconfiginput of the GitHub Action with arootinput. It applies to every command that takes--config, andinitwrites the file there. TheconfigFileoption ofanalyze()is now relative torootDirtoo. An absolute path does not change.
Patch Changes
-
#174
052099f- Check a use of a component against each of its files when Nuxt keeps more than one file with the same name, for examplePair.client.vuein one layer andPair.server.vuein another layer. Nuxt uses one file in the browser and one file on the server. Before, layerscope checked only one of the files, so a use of a layer that is not allowed could get no finding.why,unusedand the DevTools trace now list each file. Thecan_useMCP tool answers with the first file that is not allowed. Socheckcan report new findings after the update, also for a file that Nuxt does not use for a given use. -
#177
315779a- Resolve more component uses as Nuxt does. These are now uses of the component:resolveComponent()with a template literal that has no${},resolveComponent()with a kebab-case name such as'cart-summary', andh(CartSummary)in a.vue,.jsxor.tsxfile outside theserver/dir, also when an import or a local binding has that name. Before,unresolved-referencereported the first two and anh()name with no binding as warnings, so a use of a layer that is not allowed got nolayer-boundaryfinding. -
#175
1a996f4- The DevTools tab reads and writes the baseline file that thebaselinekey oflayerscope.config.tsnames. Before, the tab always wrotelayerscope-baseline.json, so with another baseline file CI did not read what the tab wrote. The static snapshot of the tab uses the same file. Undo restores the file that the change wrote, also when the config names another file after the change. -
#170
a100d07- The stale check skips the new files that Nuxt ignores (ignore,ignorePrefixand.nuxtignore) in component dirs and in the auto-import dirs of the app. Before, a new test file such ascomposables/useCart.spec.tsstoppedcheck --watchand the MCP server untilnuxi prepare. Nitro auto-imports such files from its dirs, such asserver/utilsandshared/utils, so the check still reports them there. The registry has new fields, so runnuxi prepareonce after the update. -
#179
6ebfb50- Fix twounresolved-referencemessages. A component that Nuxt does not have is nowNuxt has no component <X>; before, the message namedcomponents.d.tsalso when the source was the registry. A name that is an auto-import only in another context, or that is a component, now says so and no longer tells you to add it toglobals, which would hide a real dependency. -
#176
ef84e57-unusedcounts<NuxtIsland name="X">as a use of the island componentX. Before, an island component that only<NuxtIsland>rendered was listed as unused.<NuxtIsland :name>andresolveDynamicComponent(x)with a value that is not a fixed string mark unused components as "possibly used at runtime".checkalso reads<NuxtIsland name="X">, so an island of another layer can give alayer-boundaryfinding.checksees this only with the registry, because the generated .d.ts files do not list island components. -
#181
38951c3-unusedandcheckread component tags in JSX (.tsxand.jsxfiles, and<script lang="tsx">and<script lang="jsx">blocks) outside theserver/dir, such as<CartBadge />and<cart-badge />. Before, a component that only JSX used was listed as unused. A JSX tag that Nuxt has no component for now gives anunresolved-referencefinding, as a template tag does.
v0.8.1
Patch Changes
-
#156
fa655fc- The stale check now stops with exit code 2 when it cannot open a component dir or an auto-import dir, for example because it has no read access, or cannot reach a file that the generated types refer to. Before, layerscope treated such a dir as empty, so it did not find a new component there and could use an old registry with no error. It also reported such a file as deleted. The message shows the path and the error code. A dir or file that does not exist is handled as before. -
#161
c4b1441-driftnow finds the--baselinefile in the same way ascheck, so an absolute path and a path with backslashes now work.driftstops with exit code 2 and a message when the baseline is outside the git repository, or when the baseline is a symbolic link on the base ref. Before,driftcounted the base as empty with no message, or said that the link is not valid JSON. On a file system that ignores case,driftnow also finds a baseline file name in the wrong case. -
#164
31c3ecf-driftnow counts only the findings of rules that the current config sets toerror. Before,driftcounted a warning on the base as added on each pull request when the base baseline did not have it. -
#165
f437aac- Check an explicit import of an npm or workspace layer by its package name, for example@acme/ui-layer/app/composables/useAcme, and arequire()of it. Before, such an import was always allowed. The import resolves to the file in the layer, with theexportsof the layer'spackage.jsonwhen it has them. A path that the layer does not have or does not export is reported byunresolved-reference. An import of a layer by its package name that Node cannot find from the importing file is now reported byunresolved-reference. A layer with apackage.jsonthat exists but cannot be read, or that is not valid JSON, now stops the run with an error. -
#166
5b094c5- Undernuxi dev, the module now writes the registry again after you add or delete a file, also when Nuxt does not generate its templates again, for example after you add a server util. Before,check --watchand the MCP server stopped with the stale error untilnuxi prepareran, and the DevTools tab kept the old symbols. After you delete a server util or remove its exports, the registry no longer lists its auto-imports. -
#161
c4b1441-checkreports (SARIF and GitLab),driftandfixnow find the git repository when the name of its dir ends with a space. -
#160
a34fcfb-check --watchand the MCP server now run the stale check on each run, not only when the generated files change. A new component or auto-import file, or a deleted one, now gives the stale error untilnuxi preparewrites the generated files again. Undernuxi dev, the layerscope module writes the registry again after such a change. Before this change,check --watchand the MCP server kept the old symbol table with no error. -
#163
728c67d-check --watchnow checks again after it starts to watch a layer dir outside the project root. A file saved in such a dir during the first check is now in the report. An error from the file watcher no longer stops the watch, also an error at the start for a dir that it cannot read. layerscope prints a warning, and the watch goes on.
v0.8.0
Minor Changes
-
#150
6b98d05- The GitHub Action writes the findings of the check to the job summary, up to 200 findings, because GitHub shows at most 10 error and 10 warning annotations for each step. The new option--summary <file>ofcheckwrites that list. It works only with--format github. -
#138
6eb05c0-layerscope unusednow lists what it does not count. It lists each file that layerscope could not read in full: a parse error, an unread template, animport()orrequire()with a path that is not a fixed string, or animport.meta.glob(). When such a file exists, the report does not say that every symbol is referenced.The last line of the text report names the other uses that are not counted: test files, files that match
ignore, and files in layers installed as packages. The JSON report has a newblindSpotsfield, and the DevTools Unused view shows the same data.findBlindSpotsis a new export ofnuxt-layerscope/api. -
#142
4a7fdc5-layerscope unusedcounts more uses. It now counts the uses innuxt.config.*, in the Nuxtmodules/dir, in files of extra auto-import and component dirs, and in the project files that counted files import.
A symbol that only one of these files uses is no longer listed as unused.check,fixandwhydo not change: they do not read these files.analyzehas a newextraFilesoption (defaultfalse) that turns this on forunusedand the DevTools Unused view. -
#146
7ffda4e-layerscope unuseddoes not list the symbols of a layer outside the project root that is not installed as a package, such as a workspace package, because another app can use them. The text report names these layers in a second line. When a layer is not listed, an empty list says "No unused symbol found in the listed layers." and not that every symbol is referenced.The JSON report has a new
outside-rootentry inblindSpots, andfindBlindSpotsreturns the same new kind. The DevTools Unused view shows the same lines. In the view data,blindSpotLineis nowblindSpotLines, a list. -
#144
3a97f57-layerscope unusedcounts atypeof xin a type, such asReturnType<typeof useCart>, and animport typewhentypeImportsis'ignore'.checkdoes not change.
Patch Changes
-
#140
4d69b7b- The drift step of the GitHub Action no longer makes a shallow or full clone shallower. It now finds the base commit for pull requests, pushes and merge queues, and fetches it when the clone does not have it. If the event has no base commit, or the fetch fails, the step skips the report and prints a notice. -
#143
c56ab6b- The drift comment of the GitHub Action now posts one comment for each root. Later runs update the comment that the same account wrote, so steps with different roots no longer overwrite each other, and the action no longer edits a comment that another account wrote. If drift fails, the comment says so. On apull_requestevent from a fork, or when the action cannot post the comment, it prints a notice or a warning. A failed comment does not fail the step. A newcommentoutput says what the action did. -
#145
29e516a- The GitHub Action runs the nuxt-layerscope version of its own release when the project does not install it, so a tag pins the CLI too. The step that posts the comment is separate from the steps that run the CLI, so the action does not give its token to the CLI. -
#151
d08d5dc- The stale check now finds a new auto-import file, such as a composable that overrides one of a lower layer. layerscope stops with exit code 2 and asks you to run "nuxi prepare" again. This check uses the registry of the module. Thetypessource does not check auto-import files.The registry has a new
importDirsfield. A registry that an earlier release wrote does not have it. With--source auto, layerscope then falls back to the.d.tsfiles and prints a note. With--source registry, it stops with exit code 2. Run "nuxi prepare" again.When the module cannot read the auto-import dirs of Nuxt, it prints a warning with the reason and writes
importDirs: null. Then layerscope prints a note and does not check auto-import files. -
#139
b218ee0- Fix path checks on case-insensitive file systems and on Windows. Layerscope now uses the real case of a path and forward slashes.--preparenow startsnpxon Windows and shows the error when it cannot start. -
#152
00c2411-check --watchuses the shared test for layers outside the project root, so a project root of/works.
v0.7.0
Minor Changes
-
#137
91a4ae1-fix --applymakes the planned moves. It usesgit mvfor a file that git tracks, and it rewrites the relative imports in the importers and in the moved file.Before the first change, it checks the plan again. It stops, and changes nothing, when:
- the git working tree has changes or untracked files, or the root is not in a git repository;
- git does not track a file to move or edit, or a file is in a submodule;
- a file is marked assume-unchanged or skip-worktree, a target is outside the git repository or in another repository, or two moves have the same target;
- a file or a target dir has a symbolic link in its path, or a file has more than one hard link;
- a file to edit is not UTF-8 text, or is not what the plan says;
- a target path exists, or two target paths differ only in letter case;
- git would refuse a move, for example a target outside a sparse checkout.
See the CLI reference for all checks.
--allow-dirtyskips the git checks (repository, clean tree, tracked files, submodules). If a step fails,fixstops and lists what is done and what is not. It then tells you to usegit statusandgit diffto see the changes and git to undo them.fixneeds one of--dry-runand--apply, not both.--allow-dirtyworks only with--apply.fixalso counts the baseline entries that name a moved file, because they do not match after the move. -
#125
78508c0-fixplans moves that you can trust more. The root layer can be a move target. A target must permit every user and each dependency of the file, withallowandexpose. The new path is checked: no file is there, no other move uses it, and Nuxt finds the file there. A move that breakschecktogether with another move is dropped.fixlists only the imports that change, and keeps the extension, the query and theindexstyle of each specifier. It uses the baseline, and it has the new--baselineoption. The footer says to runlayerscope check --prepare, and one line counts the findings that have no move. The SARIF and GitLab reports now have the suggestion of each finding. Theleavesuggestion for a use of a feature layer byrootsays to change the code. -
#122
ca4f916- check now reads TypeScript syntax in a template when the component has a TypeScript script. It reports code that it cannot read as unresolved-reference findings: a template that it cannot parse, a template with a lang other than HTML or with src, a dynamic import() or require(), and import.meta.glob(). It no longer drops this code silently. An import() or require() with a template literal that has no ${} is now read as a fixed path, so it can give new layer-boundary findings. -
#128
3fc449a- layerscope now checks files in dirs namedmodulesthat are not the Nuxt modules dir, for exampleapp/modules/in Nuxt 4 andserver/modules/. Before, it skipped amodules/orpublic/dir at the top of each scanned dir. Now it skips only themodulesandpublicdirs that Nuxt uses for each layer (dir.modulesanddir.public). Alayerscope.config.*file is now skipped only in the layer root, so such a file inapp/orserver/is checked. layerscope can report new findings in these dirs, for example layer-boundary and unused findings. Review them, or update your baseline.registry.jsonnow stores themodulesandpublicdirs of each layer. Runnuxi prepareonce after you update. Until then,checkandunusedread the generated.d.tsfiles,--source registrystops with an error, and the ESLint and oxlint plugins do not load the project. -
#134
c727c6d- layerscope now checks the files in aserverDir,srcDiror shared dir outside the layer root, for exampleserverDir: '../api'. Before,check,unusedand the ESLint and oxlint plugins skipped them with no note. An import of such a file counted as an import from outside every layer. layerscope can report new findings in these files, for example layer-boundary and unused findings. Review them, or update your baseline.check --watchnow also watches such a dir.A file outside the project root has a path that starts with
../in reports and in the baseline. For a file outside its layer root, the path that theonlyandexposeglobs match starts with../too, for example../api/utils/**. A source dir that is outside its layer root but inside the project root now belongs to its layer, not to the root layer. In ESLint and oxlint, set therootoption for files outside the project root. -
#124
92ff133- A baselined layer cycle now stays accepted when the file of its first use changes. This is the case when you delete that file, or add a use in a file that sorts earlier. Alayer-cycleentry in the baseline now matches by its chain of layers, not by its file. Old baselines still match, with one exception. layerscope now picks the cycle in a fixed way. When two cycles of the same length go through one layer, it always shows the same one. In that case layerscope can report a baselined cycle as new once after the upgrade. Runlayerscope check --update-baselineto accept it. Entries for the same cycle in an old baseline are merged into one entry with acount. The text output no longer adds the target layer to a cycle entry. The SARIF and GitLab fingerprints oflayer-cyclefindings change once.
Patch Changes
-
#132
6d4db9f- layerscope now names the file in every error about an invalid baseline file: an empty file, a file that is not JSON, or a directory. A file from a newer layerscope now tells you to update layerscope, not to create the file again.driftnow stops with an error when the baseline at the base ref is an empty file, is not JSON, or is a directory. Before, it read such a file as an empty baseline, and every finding showed as added.--baseline ""is refused with a clear message. A baseline file that cannot be read, for example because of its permissions, now stops the run with an error. Before, it was read as no baseline. -
#131
59c4a75-fixlists each import of a moved file, also when a file imports the same file more than once. Before, it listed only the first import. The suggestion ofcheck(alsosuggestion.impact.importsin JSON output and the MCPsuggesttool) now counts each import to update, so the number can be higher than before.fix --dry-runnow shows the column of each import. -
a7328a2-init --dry-run,check --update-baselineandfix --dry-runnow work when you write the flag before the root. Before, the flag took the root as its value, so the command did not use the root.init --dry-run appworked on the current dir, and it could writelayerscope.config.tsthere.check --update-baseline appchecked the current dir and wrote no baseline.fix --dry-run appstopped with an error.