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

misc: migrate to esm #923

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[*.ts]
root = true

[*]
indent_style = space
indent_size = 2
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

49 changes: 0 additions & 49 deletions .eslintrc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache: pnpm

- name: Install Dependencies
run: pnpm install --frozen-lockfile
Expand Down
12 changes: 6 additions & 6 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: "54 14 * * 3"
- cron: '54 14 * * 3'

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

steps:
- name: Checkout
Expand All @@ -38,4 +38,4 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
category: '/language:${{ matrix.language }}'
156 changes: 132 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,144 @@
# ignore pack
*.tgz
# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node

# ignore development
node_modules
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# ignore vim dotfiles
*.swp
*.swo
# node-waf configuration
.lock-wscript

# ignore idea directory
.idea/
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# TypeScript build files
build
# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# allow fixtures
!test/fixtures/**/*.js
test/fixtures/**/*-typescript.js
# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# allow JS config files
!*.config.js
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# allow JS script files
!script/_utils/runCommand.js
### Node Patch ###
# Serverless Webpack directories
.webpack/

# ignore tmp directory
tmp
# Optional stylelint cache

# ignore custom build files
packages/matchers/src/matchers.ts.expected
# SvelteKit build / generate output
.svelte-kit

# test coverage
coverage
# End of https://www.toptal.com/developers/gitignore/api/node
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

1 change: 0 additions & 1 deletion .node-version

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
}
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{ type: 'lib', ignores: ['**/fixtures', 'packages/matchers/src/matchers/generated.ts'], typescript: { tsconfigPath: 'tsconfig.json' } },
)
56 changes: 24 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "codemod",
"name": "codemod-esm",
"type": "module",
"private": true,
"workspaces": {
"packages": [
Expand All @@ -9,47 +10,38 @@
"**/@types/**"
]
},
"scripts": {
"prepare": "husky"
},
"devDependencies": {
"@antfu/eslint-config": "^3.11.2",
"@types/jest": "^29.5.14",
"@types/node": "^20.17.9",
"bun": "^1.1.38",
"esbuild": "^0.24.0",
"eslint": "^9.16.0",
"husky": "^9.1.7",
"lerna": "^8.1.9",
"lint-staged": "^15.2.10",
"prettier": "^3.4.2",
"rimraf": "^6.0.1",
"typescript": "^5.7.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -e $GIT_PARAMS"
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.md": [
"prettier --write"
"eslint --fix"
],
"*.ts": [
"eslint --fix"
],
"package.json": [
"sort-package-json"
"*.json": [
"eslint --fix"
]
},
"resolutions": {
"@babel/parser": "7.20.15"
},
"devDependencies": {
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"@types/node": "^18.14.0",
"@typescript-eslint/eslint-plugin": "^5.3.1",
"@typescript-eslint/parser": "^5.3.1",
"esbuild": "^0.13.13",
"esbuild-runner": "^2.2.1",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^8.0.0",
"jest": "^27.3.1",
"lerna": "^4.0.0",
"lint-staged": "^13.1.2",
"prettier": "^2.4.1",
"sort-package-json": "^1.53.1",
"typescript": "^4.4.4"
},
"scripts": {
"prepare": "husky install"
}
"packageManager": "[email protected]+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c"
}
3 changes: 0 additions & 3 deletions packages/cli/.eslintignore

This file was deleted.

Loading