@theguild/remark-npm2yarn
Advanced tools
Comparing version 0.0.2-alpha-20230707135638-3baa9f2 to 0.1.0-alpha-20230709124250-c89d6c9
@@ -8,2 +8,3 @@ import { Root } from 'mdast'; | ||
tabNamesProp: string; | ||
storageKey: string; | ||
} | ||
@@ -10,0 +11,0 @@ ], Root>; |
import convert from "npm-to-yarn"; | ||
import { visit } from "unist-util-visit"; | ||
import { PACKAGE_MANAGERS } from "./constants.js"; | ||
const META_PLACEHOLDER = "npm2yarn"; | ||
const PACKAGE_MANAGERS = ["pnpm", "yarn", "npm"]; | ||
const TABS_NAME = "$Tabs"; | ||
@@ -26,2 +26,4 @@ const TAB_NAME = "$Tab"; | ||
throw new Error("remarkNpm2Yarn: `tabNamesProp` option is required"); | ||
if (!opts?.storageKey) | ||
throw new Error("remarkNpm2Yarn: `storageKey` option is required"); | ||
const IMPORT_AST = { | ||
@@ -75,2 +77,7 @@ type: "mdxjsEsm", | ||
} | ||
}, | ||
{ | ||
type: "mdxJsxAttribute", | ||
name: "storageKey", | ||
value: opts.storageKey | ||
} | ||
@@ -77,0 +84,0 @@ ] |
{ | ||
"name": "@theguild/remark-npm2yarn", | ||
"version": "0.0.2-alpha-20230707135638-3baa9f2", | ||
"version": "0.1.0-alpha-20230709124250-c89d6c9", | ||
"type": "module", | ||
@@ -25,7 +25,10 @@ "description": "Remark plugin for transforming npm bash commands to yarn/pnpm with tabs", | ||
"npm-to-yarn": "^2.0.0", | ||
"unist-util-visit": "^5.0.0" | ||
"unist-util-visit": "^4.1.2" | ||
}, | ||
"devDependencies": { | ||
"@types/mdast": "3.0.11", | ||
"@types/react": "^18.2.12", | ||
"nextra": "2.7.1", | ||
"nextra-theme-docs": "2.7.1", | ||
"react": "^18.2.0", | ||
"unified": "10.1.2" | ||
@@ -32,0 +35,0 @@ }, |
@@ -22,4 +22,5 @@ # `@theguild/remark-mermaid` | ||
remark.use(remarkNpm2Yarn, { | ||
packageName: '<string>', // nextra/components | ||
tabNamesProp: '<string>' // items | ||
packageName: '<string>', // e.g. 'nextra/components' | ||
tabNamesProp: '<string>', // e.g. 'items' | ||
storageKey: '<string>' // local storage key, e.g. 'selectedPackageManager' | ||
}) | ||
@@ -26,0 +27,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5411
9
135
33
6
+ Added@types/unist@2.0.11(transitive)
+ Addedunist-util-is@5.2.1(transitive)
+ Addedunist-util-visit@4.1.2(transitive)
+ Addedunist-util-visit-parents@5.1.3(transitive)
- Removed@types/unist@3.0.3(transitive)
- Removedunist-util-is@6.0.0(transitive)
- Removedunist-util-visit@5.0.0(transitive)
- Removedunist-util-visit-parents@6.0.1(transitive)
Updatedunist-util-visit@^4.1.2