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: unjs/magic-regexp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.0
Choose a base ref
...
head repository: unjs/magic-regexp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.8.0
Choose a head ref
Loading
Showing with 7,448 additions and 5,029 deletions.
  1. +0 −2 .eslintignore
  2. +0 −29 .eslintrc.cjs
  3. +47 −0 .github/CODE_OF_CONDUCT.md
  4. +1 −0 .github/FUNDING.yml
  5. +2 −2 .github/ISSUE_TEMPLATE/---bug-report.yml
  6. +2 −2 .github/ISSUE_TEMPLATE/---documentation.yml
  7. +2 −2 .github/ISSUE_TEMPLATE/---feature-suggestion.yml
  8. +7 −7 .github/workflows/ci.yml
  9. +10 −10 .github/workflows/codeql.yml
  10. +24 −0 .github/workflows/performance.yml
  11. +2 −2 .github/workflows/release.yml
  12. +0 −4 .husky/pre-commit
  13. +2 −1 build.config.ts
  14. +3 −1 docs/components/content/Logo.vue
  15. +0 −1 docs/content/1.index.md
  16. +16 −16 docs/content/2.getting-started/2.usage.md
  17. +13 −14 docs/content/2.getting-started/3.examples.md
  18. +26 −0 docs/content/2.getting-started/5.converter.md
  19. +6 −2 docs/nuxt.config.ts
  20. +5 −8 docs/package.json
  21. +10 −10 docs/tokens.config.ts
  22. +8 −0 eslint.config.mjs
  23. +23 −0 examples/date.ts
  24. +19 −0 examples/email.ts
  25. +36 −0 examples/semver.ts
  26. +26 −0 examples/time.ts
  27. +105 −0 examples/url.ts
  28. +1 −3 lint-staged.config.cjs
  29. +3 −2 nuxt.mjs
  30. +38 −45 package.json
  31. +5 −3 playground/index.mjs
  32. +6,113 −4,533 pnpm-lock.yaml
  33. +2 −2 pnpm-workspace.yaml
  34. +325 −0 src/converter.ts
  35. +39 −33 src/core/inputs.ts
  36. +25 −22 src/core/internal.ts
  37. +8 −8 src/core/types/escape.ts
  38. +1 −1 src/core/types/join.ts
  39. +4 −3 src/core/types/magic-regexp.ts
  40. +19 −19 src/core/types/sources.ts
  41. +9 −9 src/core/wrap.ts
  42. +14 −16 src/further-magic.ts
  43. +8 −6 src/index.ts
  44. +27 −25 src/transform.ts
  45. +6 −0 tea.yaml
  46. +6 −5 test/augments.test.ts
  47. +210 −0 test/converter.test.ts
  48. +30 −29 test/experimental.test.ts
  49. +6 −2 test/flags.test.ts
  50. +24 −23 test/index.test.ts
  51. +47 −46 test/inputs.test.ts
  52. +71 −71 test/transform.test.ts
  53. +3 −2 test/utils/index.ts
  54. +4 −4 tsconfig.json
  55. +5 −4 vite.config.ts → vitest.config.ts
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

29 changes: 0 additions & 29 deletions .eslintrc.cjs

This file was deleted.

47 changes: 47 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributor Covenant Code of Conduct

## Our pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our standards

Examples of behavior that contributes to creating a positive environment include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [daniel@roe.dev](mailto:daniel@roe.dev). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [danielroe]
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/---bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "\U0001F41B Bug report"
name: 🐛 Bug report
description: Something's not working
labels: ["bug"]
labels: [bug]
assignees: danielroe
body:
- type: textarea
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/---documentation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "\U0001F4DA Documentation"
name: 📚 Documentation
description: How do I ... ?
labels: ["documentation"]
labels: [documentation]
assignees: danielroe
body:
- type: textarea
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/---feature-suggestion.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "\U0001F195 Feature suggestion"
name: 🆕 Feature suggestion
description: Suggest an idea
labels: ["enhancement"]
labels: [enhancement]
assignees: danielroe
body:
- type: textarea
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- run: corepack enable
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
cache: "pnpm"
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile
@@ -30,12 +30,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- run: corepack enable
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
cache: "pnpm"
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile
@@ -50,4 +50,4 @@ jobs:
run: pnpm test -- --coverage

- name: 🟩 Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
20 changes: 10 additions & 10 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: "CodeQL"
name: CodeQL

on:
push:
branches: [ "main" ]
branches: [main]
pull_request:
branches: [ "main" ]
branches: [main]
schedule:
- cron: "2 2 * * 0"
- cron: '2 2 * * 0'

jobs:
analyze:
@@ -20,22 +20,22 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ javascript ]
language: [javascript]

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
category: '/language:${{ matrix.language }}'
24 changes: 24 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: performance

on:
pull_request:

jobs:
check-performance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 16
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install --frozen-lockfile

- name: TSC diagnostics diff
uses: beerose/tsc-diagnostics-diff-action@49bf67cb35cae2ba688d1e7dffe5f14acbb62406
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
leave-comment: true
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -12,12 +12,12 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0

- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

3 changes: 2 additions & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
declaration: true,
rollup: { emitCJS: true },
entries: ['./src/index', './src/transform', './src/further-magic'],
entries: ['./src/index', './src/transform', './src/converter', './src/further-magic'],
externals: ['magic-regexp', 'type-level-regexp'],
})
4 changes: 3 additions & 1 deletion docs/components/content/Logo.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<template>
<div class="font-bold flex flex-row items-center gap-2">🦄 magic-regexp</div>
<div class="font-bold flex flex-row items-center gap-2">
🦄 magic-regexp
</div>
</template>
1 change: 0 additions & 1 deletion docs/content/1.index.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ secondary:
snippet: npm install magic-regexp
---


#title
🦄 magic-regexp

Loading