Skip to content

Releases: feature-sliced/filesystem

v3.0.1

18 Apr 21:51
7573911
Compare
Choose a tag to compare

Changed

  • The isCrossImportPublicApi now also recognizes ./sliceA/@x/sliceB/index.js as a valid public API for cross-imports

Thanks to @gwbaik9717 for this contribution!

v3.0.0

18 Mar 23:11
2e00dbd
Compare
Choose a tag to compare

This release adds support for having several index files, useful in full-stack frameworks that shouldn't mix client and server imports.

Changed

  • The isIndex function now recognizes dot-separated strings like index.client.js as valid index files, as long as the part until the first dot is index.

Added

  • The getIndexes function, similar to the previously existing getIndex, but now returning Array<File> instead of File | undefined

Removed

  • The getIndex function, that would either return a single index file or undefined has been removed in favor of getIndexes

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.