Skip to content

Releases: wkillerud/sassdoc-parser

v3.4.1

24 Jul 17:30
Compare
Choose a tag to compare

3.4.1 (2024-07-24)

Bug Fixes

  • include inline documentation for Parser (f048aaf)

v3.4.0

23 Jul 18:50
Compare
Choose a tag to compare

3.4.0 (2024-07-23)

Features

  • export Parser for performance-sensitive applications (38927db)

v3.3.0

07 Jul 17:06
Compare
Choose a tag to compare

3.3.0 (2024-07-07)

Features

  • initial release under new name (78446b6)

v3.2.0

07 Jul 16:53
Compare
Choose a tag to compare

3.2.0 (2024-07-07)

Features

  • support parsing indented syntax (with some minor limitations) (#13) (0f62d60)

v3.1.0

12 Mar 17:52
Compare
Choose a tag to compare

3.1.0 (2024-03-12)

Features

  • add sync version of the parse function (c68da1a)

v3.0.1

08 Feb 19:11
ff5b825
Compare
Choose a tag to compare

3.0.1 (2024-02-08)

Bug Fixes

  • include types for scss-comment-parser (ff5b825)

v3.0.0

08 Feb 18:59
e499708
Compare
Choose a tag to compare

3.0.0 (2024-02-08)

BREAKING CHANGES

  • Minimum supported Node version is 20
  • No API changes, but the module now exports both ESM and CJS versions.

ESM

18 Mar 14:06
0b54fd3
Compare
Choose a tag to compare
ESM

Breaking changes

  • The package is now an ES module.
  • Removed support for sending in a path or list of paths to parse. The parse function now behaves like the old parseString.

Migrating to use the ES module

This will depend on your setup. I'll link to a great overview by Sindre Sorhus:

Additionally, I found this discussion helpful:

I'm a user of this package myself, in a CommonJS project compiled with TypeScript. For reference, here is the commit for the upgrade:

Migrating from the old parse

The old parse function was a fairly trivial wrapper around parseString. Below, doParse does what the old parse function did. With this change, the package can more easily be used in the browser, should need be.

import fs from "node:fs/promises";
import { parse } from "scss-sassdoc-parser";

export async function doParse(path: string | string[]): Promise<ParseResult[]> {
  const paths = Array.isArray(path) ? path : [path];
  const result = await Promise.all(
    paths.map(async (src) => {
      const code = await fs.readFile(src, "utf-8");
      return await parse(code);
    }),
  );
  return result.flat();
}

const singlePathResult = await doParse("_helpers.scss");
const arrayOfPathsResult = await doParse(["_mixins.scss", "_functions.scss"]);

Migrating from the old parseString

Replace parseString with parse.

- import { parseString } from "scss-sassdoc-parser";
+ import { parse } from "scss-sassdoc-parser";

async function doParse() {
-  const result = await parseString(`
+  const result = await parse(`
/// Keeps it secret
/// @output Sets display to hidden
@mixin _keep-it-secret {
  display: hidden;
}
`);

doParse();

What's Changed

Full Changelog: v1.0.5...v2.0.0

Maintenance release

16 Jan 18:05
Compare
Choose a tag to compare
  • chore: update dependencies (#9)

Full Changelog: v1.0.4...v1.0.5

Type may be undefined

22 Dec 16:16
e107788
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.3...v1.0.4