Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,32 @@ jobs:
persist-credentials: false
fetch-depth: 0

- name: Set Up pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Set Up NodeJs
uses: actions/setup-node@v4.0.2
uses: actions/setup-node@v5.0.0
with:
node-version-file: '.nvmrc'
cache: npm
cache: 'pnpm'

- name: Install Dependencies
run: npm ci
run: pnpm install

- name: Lint
run: npm run lint
run: pnpm run lint

- name: Test
run: npm test
run: pnpm run test

- name: Build
run: npm run build
run: pnpm run build

- name: Cache Deployment
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: actions/cache@v4.0.2
uses: actions/cache@v4.3.0
env:
cache-name: deployment-cache
with:
Expand All @@ -54,7 +59,7 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
npm run release:check
pnpm run release:check

Deploy:
needs: CheckRelease
Expand Down Expand Up @@ -85,7 +90,7 @@ jobs:

- name: Create Git Release
run: |
npm run release
pnpm run release

- name: Push Git Release
run: |
Expand All @@ -95,18 +100,18 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
pnpm config set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"

- name: Publish NPM Package
- name: Publish Package
id: publish
run: |
npm publish
pnpm publish

- name: Publish Release Notes
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
npm run release:post
pnpm run release:post

- name: Revert Git Release
if: failure() && steps.publish.outcome == 'failure'
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typings/
# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
# Optional module cache directory
.npm

# Optional eslint cache
Expand All @@ -66,7 +66,7 @@ typings/
# Optional REPL history
.node_repl_history

# Output of 'npm pack'
# Output of 'pnpm pack'
*.tgz

# Yarn Integrity file
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.10.0
v22.18.0
16 changes: 9 additions & 7 deletions CONTRIBUTING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ v20.10.0
After cloning the repository, install dependencies and build the project:

```
npm ci
pnpm install
```

Build the library and watch for changes:

```
npm start
pnpm run start
```

Link your local copy:

{/* TODO: pnpm link? */}

```
npm link
pnpm link
```

`markdown-inject` commands in any terminal will now run using your local copy.
Expand All @@ -35,13 +37,13 @@ npm link
This app ships with a local suite of [jest](https://jestjs.io/) tests, [eslint](https://eslint.org/) + [prettier](https://prettier.io/) configurations for code consistency and formatting, and [TypeScript](https://www.typescriptlang.org/) type validation. Each of these features can be validated using...

```bash
npm test
npm run lint
npm run build
pnpm run test
pnpm run lint
pnpm run build
```

A `validate` utility script chains these calls together, and is called on every commit.

```bash
npm run validate
pnpm run validate
```
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,16 @@ Add file or command output to markdown documents.

Download and invoke in one command:

```
```sh
npx markdown-inject
```

Local npm installation:
Local installation:

```
```sh
npm install markdown-inject --save-dev
```

or with Yarn:

```
yarn add markdown-inject --dev
```

Optionally, wire up `markdown-inject` to a git pre-commit hook tool like [husky](https://github.com/typicode/husky) to automatically update markdown injection as part of your workflow.

## Usage
Expand All @@ -36,7 +30,7 @@ Optionally, wire up `markdown-inject` to a git pre-commit hook tool like [husky]
CODEBLOCK_START
{
"type": "command",
"value": "npm run --silent markdown-inject -- --help",
"value": "pnpm run --silent markdown-inject -- --help",
"hideValue": true
}
-->
Expand Down
Loading