Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Sec-ant/prettier-plugin-embed
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.4.15
Choose a base ref
...
head repository: Sec-ant/prettier-plugin-embed
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.5.0
Choose a head ref
Loading
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -26,6 +26,15 @@
"contributions": [
"code"
]
},
{
"login": "JounQin",
"name": "JounQin",
"avatar_url": "https://avatars.githubusercontent.com/u/8336744?v=4",
"profile": "https://www.1stg.me",
"contributions": [
"code"
]
}
]
}
4 changes: 0 additions & 4 deletions .codesandbox/ci.json

This file was deleted.

18 changes: 18 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup
description: Setup the environment

runs:
using: composite
steps:
- name: Setup PNPM
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0

- name: Setup Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: .node-version
cache: pnpm

- name: Install Dependencies
shell: bash
run: pnpm i
24 changes: 0 additions & 24 deletions .github/dependabot.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/preview-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Preview Release

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
preview-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/setup

- name: Bump Version
run: pnpm -s changeset version

- name: Build
run: pnpm -s prepublishOnly

- name: Publish Preview Release
run: pnpx pkg-pr-new publish --compact
69 changes: 10 additions & 59 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ on:
push:
branches:
- main
- channel/*

permissions:
contents: write
@@ -24,74 +25,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- name: Install Dependencies
run: npm ci

- name: Get Commit ID
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get-commit-id
run: |
echo "short-commit-id=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
echo "commit-id=$(git rev-parse $GITHUB_SHA)" >> $GITHUB_OUTPUT
- name: Setup
uses: ./.github/actions/setup

- name: Get Package Name
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get-package-name
run: echo "package-name=$(npm pkg get name | jq -r)" >> $GITHUB_OUTPUT

- name: Get Normalized Package Name
if: ${{ github.event_name == 'workflow_dispatch' }}
id: get-normalized-package-name
uses: frabert/replace-string-action@v2
with:
pattern: "^.*?([^/]+)$"
string: ${{ steps.get-package-name.outputs.package-name }}
replace-with: "$1"

- name: Patch package.json
if: ${{ github.event_name == 'workflow_dispatch' }}
run: npm pkg set version=${{ steps.get-commit-id.outputs.short-commit-id }}

- name: Build and Pack
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
npm run prepublishOnly
npm pack
- name: Draft Release
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ steps.get-normalized-package-name.outputs.replaced }}-${{ steps.get-commit-id.outputs.short-commit-id }}.tgz"
artifactContentType: application/gzip
body: "This is a draft release of ${{ steps.get-package-name.outputs.package-name }}: ${{ steps.get-commit-id.outputs.short-commit-id }}."
commit: ${{ steps.get-commit-id.outputs.commit-id }}
tag: "draft"
draft: true
name: "draft"
removeArtifacts: true
- name: Test
run: pnpm -s test

- name: Get Next Package Version
if: ${{ github.event_name != 'workflow_dispatch' }}
id: package-version
run: echo "version=$(npx changeset status --output=release.json && jq -r '.releases[0].newVersion // '$(npm pkg get version)'' release.json && rm release.json)" >> $GITHUB_OUTPUT
run: echo "version=$(pnpm -s changeset status --output=release.json && jq -r '.releases[0].newVersion // '$(npm pkg get version)'' release.json && rm release.json)" >> $GITHUB_OUTPUT

- name: Create Release Pull Request or Publish to NPM
if: ${{ github.event_name != 'workflow_dispatch' }}
id: changesets
uses: changesets/action@v1
uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 # v1.4.9
with:
version: npm run bump
publish: npx changeset publish
publish: pnpm -s changeset publish
commit: "chore(release): v${{ steps.package-version.outputs.version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.CHANGESET_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup
uses: ./.github/actions/setup

- name: Test
run: pnpm -s test
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"*.{js,ts,cjs,mjs,cts,mts,d.cts,d.mts,jsx,tsx,json,jsonc}": [
"biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true"
"biome check --write --no-errors-on-unmatched --files-ignore-unknown=true"
],
"*.{md,yml,yaml,css,html}": ["prettier --write"]
}
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public-hoist-pattern[]=@changesets/config
public-hoist-pattern[]=sh-syntax
public-hoist-pattern[]=sql-formatter
public-hoist-pattern[]=sql-parser-cst
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .simple-git-hooks.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"pre-commit": "npx lint-staged"
"pre-commit": "pnpm -s lint-staged"
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# prettier-plugin-embed

## 0.5.0

### Minor Changes

- 15dd288: feat: support shorthand for CallExpression as tag

## 0.4.15

### Patch Changes
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1113,6 +1113,7 @@ Bug fixes, new language support and tests are welcome. Please have a look at the
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://upleveled.io"><img src="https://avatars.githubusercontent.com/u/1935696?v=4?s=100" width="100px;" alt="Karl Horky"/><br /><sub><b>Karl Horky</b></sub></a><br /><a href="#code-karlhorky" title="Code">💻</a> <a href="#doc-karlhorky" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://math-atlas.vercel.app"><img src="https://avatars.githubusercontent.com/u/64682375?v=4?s=100" width="100px;" alt="Kelvin Soh"/><br /><sub><b>Kelvin Soh</b></sub></a><br /><a href="#code-kelvinsjk" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.1stg.me"><img src="https://avatars.githubusercontent.com/u/8336744?v=4?s=100" width="100px;" alt="JounQin"/><br /><sub><b>JounQin</b></sub></a><br /><a href="#code-JounQin" title="Code">💻</a></td>
</tr>
</tbody>
</table>
16 changes: 10 additions & 6 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": ["./tests/code/**/*"],
"ignore": ["./tests/**/fixtures/**/*"],
"ignoreUnknown": true
},
"organizeImports": {
@@ -21,9 +21,6 @@
},
"style": {
"noNonNullAssertion": "off"
},
"nursery": {
"useImportType": "error"
}
}
},
@@ -35,13 +32,20 @@
},
"overrides": [
{
"include": ["*.jsonc"],
"include": ["*.json"],
"json": {
"parser": {
"allowComments": true,
"allowTrailingCommas": true
}
}
},
{
"include": ["package.json", ".all-contributorsrc"],
"json": {
"formatter": {
"lineWidth": 1
}
}
}
]
}
Loading