Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change defaults for mangle and headerIds to false #2890

Merged
merged 1 commit into from
Aug 6, 2023

Conversation

UziTech
Copy link
Member

@UziTech UziTech commented Jul 29, 2023

Description

Change default for mangle and headerIds to false

This will prevent console logs by default.

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

@vercel
Copy link

vercel bot commented Jul 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 29, 2023 6:36am

@UziTech
Copy link
Member Author

UziTech commented Aug 6, 2023

@calculuschild any issue with merging this?

Copy link
Contributor

@calculuschild calculuschild left a comment

Choose a reason for hiding this comment

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

I have no problems with this.

@UziTech UziTech changed the title BREAKING CHANGE: change defaults for mangle and headerIds fix: change defaults for mangle and headerIds to false Aug 6, 2023
@UziTech UziTech merged commit 63a839b into markedjs:master Aug 6, 2023
10 checks passed
@UziTech UziTech deleted the change-defaults branch August 6, 2023 23:48
github-actions bot pushed a commit that referenced this pull request Aug 6, 2023
# [7.0.0](v6.0.0...v7.0.0) (2023-08-06)

### Bug Fixes

* change defaults for mangle and headerIds to false ([#2890](#2890)) ([63a839b](63a839b))

### BREAKING CHANGES

* change defaults for mangle and headerIds to false
github-merge-queue bot pushed a commit to microsoft/qsharp that referenced this pull request Oct 27, 2023
Updated all direct npm dependencies to `@latest`.

Observed changes:
- Prettier: now adds trailing commas to all lists.
prettier/prettier#11479
- Katas: `marked` now omits `id` attributes for header tags (confirmed
benign) markedjs/marked#2890
- Other trivial differences in JS emit through `esbuild`.

I was really hoping this would be a trivial process, but sadly it
wasn't. For posterity, here's what the process ended up being:

```js
const { execSync } = require("node:child_process");

function run(command) {
  console.log(`running command ${command}`);
  return execSync(command);
}

const deps = JSON.parse(run(`npm ls --package-lock-only --json`));

// Do these in this order first, otherwise @typescript-eslint/eslint-plugin
// gets really upset about the peer dependency missing
run("npm install @typescript-eslint/parser@latest");
run("npm install @typescript-eslint/eslint-plugin@latest");

// Update all direct deps to @latest
for (const depName of Object.keys(deps.dependencies)) {
  if (!depName.startsWith("qsharp")) {
    run(`npm install ${depName}@latest`);
  }
}

// Update indirect deps in package-lock.json
run("npm update");

// This fixes the workspace names in package-lock.json,
// which for some reason get erased above
run("npm install");

```

Ran `./build.py` to confirm the repo still built, discovered formatting
changes.

To reformat with new Prettier defaults:

```bash
npm run prettier:fix
```

Since we pulled a lot of JS tooling updates, I ran a quick script to
save the built artifacts so I could diff the JS output:

```bash
#!/bin/bash

set -e

# clean repo
git clean -fdx
rm -rf baseline-compare/
mkdir baseline-compare

# build
./build.py --wasm --npm --vscode --no-check --no-test

# npm
mkdir -p baseline-compare/npm
pushd npm
npm pack --pack-destination .
popd
tar -xzf npm/qsharp-lang-0.0.0.tgz -C baseline-compare/npm

# vsix
npm install -g @vscode/vsce
pushd vscode
vsce package --pre-release
popd
unzip vscode/qsharp-lang-vscode-dev-0.0.0.vsix -d baseline-compare/vscode

# commit baseline
cp package-lock.json baseline-compare/
git add baseline-compare/
git commit -m "Baseline for $(git rev-parse HEAD)"
```

Ran this script first on `main`, then with the updated `package.json` &
`package-lock.json`. Used `git` to diff the `baseline-compare` changes.
Confirmed they looked harmless.
johnshaughnessy added a commit to johnshaughnessy/ai-guide that referenced this pull request Jan 3, 2024
Otherwise, headerIds are disabled by default:

    markedjs/marked#2890

Supposedly, there is a way to to use a configuration file:

    marked -c .marked.json -o "${NEW_PATH%.md}-content.html" "${file}"

with .marked.json:

{
  "headerIds": true
}

But I could not get this working with the latest version of marked (11).
johnshaughnessy added a commit to johnshaughnessy/ai-guide that referenced this pull request Jan 3, 2024
Otherwise, headerIds are disabled by default:

    markedjs/marked#2890

Supposedly, there is a way to to use a configuration file:

    marked -c .marked.json -o "${NEW_PATH%.md}-content.html" "${file}"

with .marked.json:

{
  "headerIds": true
}

But I could not get this working with the latest version of marked (11).
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.

Erroneous warnings about deprecated options when using parse()
3 participants