Skip to content

Release create-markdown 2.0.2#4

Merged
BunsDev merged 4 commits intomainfrom
okcode/package-security-scan
Apr 6, 2026
Merged

Release create-markdown 2.0.2#4
BunsDev merged 4 commits intomainfrom
okcode/package-security-scan

Conversation

@BunsDev
Copy link
Copy Markdown
Owner

@BunsDev BunsDev commented Apr 6, 2026

Summary

  • Bumped all public create-markdown packages to 2.0.2 and synced version references in the README and docs.
  • Updated package exports and sideEffects metadata for cleaner downstream resolution and better tree-shaking.
  • Added workspace-local dev dependencies and tightened peer dependency ranges to >=2.0.2 where applicable.
  • Hardened the security audit script so strict-mode checks correctly resolve inherited tsconfig settings.
  • Refreshed changelogs and release notes for the 2.0.2 publish.

Testing

  • Not run (release metadata and packaging changes only).
  • Verified lockfile/package metadata updates are included in the diff.
  • Verified the security audit script was updated to use parsed TypeScript config resolution for strict-mode checks.

Note

Low Risk
Low risk metadata-only change; main potential impact is if any package has untracked side effects (especially CSS) that bundlers may now drop.

Overview
Adds sideEffects metadata across published packages to improve downstream tree-shaking: false for core, react, mdx, and create-markdown, and ['**/*.css'] for preview to preserve CSS imports.

Reviewed by Cursor Bugbot for commit 61fa528. Bugbot is set up for automated code reviews on this repo. Configure here.

- Add `sideEffects: false` to published package manifests
- Improve security audit tsconfig strictness detection
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
create-markdown Ready Ready Preview Apr 6, 2026 1:11am
create-markdown-docs Ready Ready Preview Apr 6, 2026 1:11am

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Unresolved git merge conflict markers in script
    • Removed conflict markers and the duplicate loadTsconfig block, keeping tsconfig assignment plus the existing TypeScript getParsedCommandLineOfConfigFile strict check.
  • ✅ Fixed: CSS exports will be tree-shaken with sideEffects false
    • Changed preview package sideEffects from false to ["**/*.css"] so CSS theme imports are treated as side-effectful and not dropped by tree-shaking.

Create PR

Or push these changes by commenting:

@cursor push ea7257e13a
Preview (ea7257e13a)
diff --git a/packages/preview/package.json b/packages/preview/package.json
--- a/packages/preview/package.json
+++ b/packages/preview/package.json
@@ -23,7 +23,7 @@
     "typescript"
   ],
   "type": "module",
-  "sideEffects": false,
+  "sideEffects": ["**/*.css"],
   "main": "./dist/index.cjs",
   "module": "./dist/index.js",
   "types": "./dist/index.d.ts",

diff --git a/scripts/security-audit.sh b/scripts/security-audit.sh
--- a/scripts/security-audit.sh
+++ b/scripts/security-audit.sh
@@ -464,144 +464,8 @@
 
 for pkg_dir in packages/*/; do
   pkg_name="$(basename "$pkg_dir")"
-<<<<<<< Updated upstream
   tsconfig="$pkg_dir/tsconfig.json"
-=======
-  IS_STRICT="$(node - "$tsconfig" <<'NODE'
-const fs = require('fs');
-const path = require('path');
 
-function stripJsonComments(input) {
-  const source = input.replace(/^\uFEFF/, '');
-  let result = '';
-  let inString = false;
-  let stringQuote = '';
-  let escaping = false;
-  let inLineComment = false;
-  let inBlockComment = false;
-
-  for (let i = 0; i < source.length; i += 1) {
-    const char = source[i];
-    const next = source[i + 1];
-
-    if (inLineComment) {
-      if (char === '\n') {
-        inLineComment = false;
-        result += char;
-      }
-      continue;
-    }
-
-    if (inBlockComment) {
-      if (char === '*' && next === '/') {
-        inBlockComment = false;
-        i += 1;
-      }
-      continue;
-    }
-
-    if (inString) {
-      result += char;
-      if (escaping) {
-        escaping = false;
-      } else if (char === '\\') {
-        escaping = true;
-      } else if (char === stringQuote) {
-        inString = false;
-        stringQuote = '';
-      }
-      continue;
-    }
-
-    if ((char === '"' || char === "'")) {
-      inString = true;
-      stringQuote = char;
-      result += char;
-      continue;
-    }
-
-    if (char === '/' && next === '/') {
-      inLineComment = true;
-      i += 1;
-      continue;
-    }
-
-    if (char === '/' && next === '*') {
-      inBlockComment = true;
-      i += 1;
-      continue;
-    }
-
-    result += char;
-  }
-
-  return result;
-}
-
-function loadTsconfig(tsconfigPath, visited = new Set()) {
-  const resolvedPath = path.resolve(tsconfigPath);
-  if (visited.has(resolvedPath)) {
-    throw new Error(`Circular tsconfig extends detected: ${resolvedPath}`);
-  }
-
-  visited.add(resolvedPath);
-
-  const raw = fs.readFileSync(resolvedPath, 'utf8');
-  const parsed = JSON.parse(stripJsonComments(raw));
-  const baseConfig = parsed.extends
-    ? loadExtendedTsconfig(parsed.extends, path.dirname(resolvedPath), visited)
-    : {};
-
-  return {
-    ...baseConfig,
-    ...parsed,
-    compilerOptions: {
-      ...(baseConfig.compilerOptions || {}),
-      ...(parsed.compilerOptions || {}),
-    },
-  };
-}
-
-function loadExtendedTsconfig(extendsValue, configDir, visited) {
-  const candidates = [];
-
-  if (extendsValue.startsWith('.')) {
-    candidates.push(path.resolve(configDir, extendsValue));
-  } else if (path.isAbsolute(extendsValue)) {
-    candidates.push(extendsValue);
-  } else {
-    candidates.push(path.resolve(configDir, extendsValue));
-  }
-
-  for (const candidate of [...candidates]) {
-    if (!candidate.endsWith('.json')) {
-      candidates.push(`${candidate}.json`);
-    }
-  }
-
-  for (const candidate of candidates) {
-    if (fs.existsSync(candidate)) {
-      return loadTsconfig(candidate, visited);
-    }
-  }
-
-  throw new Error(`Unable to resolve extended tsconfig: ${extendsValue}`);
-}
-
-try {
-  const config = loadTsconfig(process.argv[2]);
-  if (config.compilerOptions?.strict === true) {
-    process.stdout.write('true');
-  } else {
-    process.stdout.write('false');
-  }
-} catch {
-  process.stdout.write('unknown');
-}
-NODE
-)"
->>>>>>> Stashed changes
-
   if [ ! -f "$tsconfig" ]; then
     record_warn "$pkg_name: no tsconfig.json found"
     continue

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 25008df. Configure here.

cursoragent and others added 2 commits April 6, 2026 00:59
…effects

Remove accidental conflict markers and duplicate strict-check block from
security-audit.sh, keeping tsconfig assignment and TypeScript API parsing.

Set preview package sideEffects to **/*.css so theme CSS imports are not
tree-shaken by bundlers.
Keep the tsconfig variable assignment and the TypeScript API-based
parser (getParsedCommandLineOfConfigFile) which natively handles
extends resolution. Remove the conflicting custom Node.js tsconfig
resolver that was accidentally committed with merge-conflict markers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@BunsDev
Copy link
Copy Markdown
Owner Author

BunsDev commented Apr 6, 2026

@cursor push ea7257e

…effects

Remove accidental conflict markers and duplicate strict-check block from
security-audit.sh, keeping tsconfig assignment and TypeScript API parsing.

Set preview package sideEffects to **/*.css so theme CSS imports are not
tree-shaken by bundlers.

Applied via @cursor push command
@BunsDev BunsDev merged commit 0fc800a into main Apr 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants