Skip to content

Releases: feature-sliced/filesystem

v2.4.0

01 Oct 18:43
ec63053
Compare
Choose a tag to compare

Added

  • New constant in the definitions:
    export const crossReferenceToken = "@x"

v2.3.0

28 Sep 10:47
4679935
Compare
Choose a tag to compare

Added

  • Two new functions: isIndex and isCrossImportPublicApi. Check out the README for the docs
  • A bunch of tests for existing functions to make sure nothing breaks later when no one's watching

v2.2.5

30 Jun 21:19
0d7e6c1
Compare
Choose a tag to compare

Fixed

  • Fixed resolveImport returning Unix path separators / on Windows. Now, OS path separators are respected

v2.2.4

08 Jun 18:45
d6d1d35
Compare
Choose a tag to compare

Fixed

  • Added support for projects using TypeScript 4 with moduleResolution: "node". TypeScript 5 requires that this should be "node10", but we're not picky.

v2.2.3

04 Jun 17:35
540cfc8
Compare
Choose a tag to compare

Fixed

  • Removed a console.log that managed to sneak into the last release

v2.2.2

04 Jun 17:30
44a11fb
Compare
Choose a tag to compare

Fixed

  • resolveImport previously wouldn't accept a result of parsing tsconfig.json because some values first need to be converted through their specific enum. Meaning that you can now do this:
const tsCompilerOptions = {
  moduleResolution: "Bundler" as const,  // previously this had to be ts.ModuleResolutionKind.Bundler
  baseUrl: ".",
  paths: {
    "~/*": ["./src/*"],
  },
};

resolveImport(
  "~/shared/ui",
  "src/pages/home/ui/HomePage.tsx",
  tsCompilerOptions,
  fs.fileExists,
);

Which is a lot easier! Shame on the API of TypeScript for requiring such hacks, but what can you do /shrug.

v2.2.1

30 May 15:55
009b685
Compare
Choose a tag to compare

Fixed

v2.2.0

18 May 23:33
ee36d72
Compare
Choose a tag to compare

Added

  1. Definitions layerSequence, unslicedLayers, and conventionalSegmentNames to semantically describe FSD rules and keep a single source of truth
  2. The isSlice function is now exported, it determines if a folder is a slice based on whether it contains any conventional (or other, configurable) segments

Changed

  1. The getAllSlices function now augments the slice object with the layerName property, which is the name of the layer the slice is in.

v2.1.0

18 May 18:03
a123b95
Compare
Choose a tag to compare

Added

  • A new FSD-aware traversal function, getAllSegments

v2.0.0

17 May 23:14
1a53e08
Compare
Choose a tag to compare

Added

  • New type definitions: File and Folder, bare minimum objects to represent a file system.
  • Functions to traverse a folder like an FSD root (see README for documentation):
    • getLayers
    • getSlices
    • getSegments
    • getAllSlices
    • isSliced
    • getIndex

Changed

  • The FsdRoot type is now simply an alias for Folder.

Removed

  • The locateInFsdRoot function is no longer available, it is replaced with a more ergonomic set of functions to traverse a folder as an FSD root.
  • A bunch of now redundant type definitions are removed: SliceName, SegmentName, Layer, SlicedLayer, UnslicedLayer, UnslicedLayerName, Slice, Segment, FileLocation. Instead, layers, slices, and segments are now simply folders (segments can also be files).