Releases: wkillerud/sassdoc-parser
Releases · wkillerud/sassdoc-parser
v3.4.1
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.1
v3.0.0
ESM
Breaking changes
- The package is now an ES module.
- Removed support for sending in a path or list of paths to
parse
. Theparse
function now behaves like the oldparseString
.
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
- chore: update dependencies by @wkillerud in #9
- chore: move to esm by @wkillerud in #10
Full Changelog: v1.0.5...v2.0.0
Maintenance release
- chore: update dependencies (#9)
Full Changelog: v1.0.4...v1.0.5
Type may be undefined
What's Changed
- chore: update dependencies by @wkillerud in #7
- fix: type may be undefined by @wkillerud in #8
Full Changelog: v1.0.3...v1.0.4