Skip to content

Commit

Permalink
Merge pull request #23 from eslint-kit/v11
Browse files Browse the repository at this point in the history
Updates for v11
  • Loading branch information
risen228 authored Jul 19, 2024
2 parents 81314a6 + b181566 commit d9192c3
Show file tree
Hide file tree
Showing 18 changed files with 12,641 additions and 7,743 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = configure({
presets.imports(),
presets.node(),
presets.prettier(),
presets.typescript(),
presets.typescript({ enforceUsingType: true }),
],
})
33 changes: 0 additions & 33 deletions .github/workflows/cache-build.yml

This file was deleted.

33 changes: 11 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ jobs:
git config --global user.email "<>"
- name: Checkout to tag
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
fetch-depth: 0

- name: Extract version
id: tag
uses: olegtarasov/get-tag@v2.1.1
with:
tagRegex: 'v(?<full>(?<version>[0-9.]*)(?:-(?<rc>.*))?)'
- name: Parse version from tag
id: version
uses: release-kit/semver@v2

- name: Get release branch name
id: release-branch
run: echo "::set-output name=name::${{ steps.tag.outputs.rc != null && 'release/${{ steps.tag.outputs.rc }}' || 'release/latest' }}"
run: echo "::set-output name=name::${{ steps.version.outputs.prerelease != null && 'release/${{ steps.version.outputs.prerelease }}' || 'release/latest' }}"

- name: Checkout/create release branch
run: git checkout ${{ steps.release-branch.outputs.name }} || git checkout -b ${{ steps.release-branch.outputs.name }}
Expand All @@ -52,20 +50,11 @@ jobs:
force: true
unprotect_reviews: true

- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/

- name: Check build cache
id: cache
uses: actions/cache@v3
- uses: actions/setup-node@v4
with:
path: dist
key: ${{ hashFiles('./yarn.lock', './src/**', './rollup.config.js', './jest.config.js') }}
node-version: 20

- name: Create a new build
if: steps.cache.outputs.cache-hit != 'true'
run: |
yarn install --frozen-lockfile
yarn test
Expand All @@ -74,17 +63,17 @@ jobs:
- name: Set version from release
uses: reedyuk/npm-version@1.0.1
with:
version: ${{ steps.tag.outputs.full }}
version: ${{ steps.version.outputs.full }}

- name: Create NPM config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish latest
if: ${{ steps.tag.outputs.rc == null }}
if: ${{ steps.version.outputs.prerelease == '' }}
run: npm publish

- name: Publish RC
if: ${{ steps.tag.outputs.rc != null }}
run: npm publish --tag ${{ steps.tag.outputs.rc }}
if: ${{ steps.version.outputs.prerelease != '' }}
run: npm publish --tag ${{ steps.version.outputs.prerelease }}
15 changes: 3 additions & 12 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,13 @@ jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/

- name: Use build cache
id: cache
uses: actions/cache@v3
with:
path: dist
key: ${{ hashFiles('./yarn.lock', './src/**', './rollup.config.js', './jest.config.js') }}
node-version: 20

- name: Create a new build
if: steps.cache.outputs.cache-hit != 'true'
run: |
yarn install --frozen-lockfile
yarn test
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@ lerna-debug.log*

# Project
.env
src/zod-generated
src/zod-generated

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 2 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node = "~20"
yarn = "4.2.2"
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Evgeny Z.
Copyright (c) 2022 Evgenii Z.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 9 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
"name": "eslint-kit-cli",
"version": "0.0.0-set-by-ci",
"description": "Setup ESLint and Prettier with just one CLI command",
"author": "Evgeny Zakharov <risenforces@gmail.com>",
"author": "Evgenii Zakharov <to@risen.dev>",
"repository": "git@github.com:eslint-kit/eslint-kit-cli.git",
"license": "MIT",
"files": [
"dist/*"
],
"bin": {
"eslint-kit-cli": "dist/main.js"
},
"bin": "dist/main.js",
"jest": {
"moduleFileExtensions": [
"js",
Expand Down Expand Up @@ -71,15 +69,16 @@
"@types/jest": "27.5.0",
"@types/jscodeshift": "^0.11.5",
"@types/node": "^16.0.0",
"eslint": "^8.41.0",
"eslint-kit": "^10.0.0",
"eslint": "^8.56.0",
"eslint-kit": "^11.0.0",
"jest": "28.0.3",
"prettier": "^3.0.0",
"source-map-support": "^0.5.20",
"ts-jest": "28.0.1",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.0.0",
"typescript": "^4.3.5",
"prettier": "^3.0.0"
}
}
"typescript": "^4.7.4"
},
"packageManager": "yarn@4.2.2"
}
2 changes: 1 addition & 1 deletion src/modules/commands/init.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class InitCommand implements CommandRunner {
extensions.add('js').add('mjs').add('cjs')

if (await this.meta.hasTypeScript()) {
presets.push(builder.preset('typescript'))
presets.push(builder.preset('typescript', { enforceUsingType: true }))
extensions.add('ts').add('mts')
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/lib/exceptions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpException } from '@nestjs/common'

interface Extend {
type Extend = {
code: string
message: string
}
Expand Down
4 changes: 2 additions & 2 deletions src/shared/lib/fs/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs/promises'
import path from 'path'

export interface PackageJson {
export type PackageJson = {
version: string
type?: 'module' | 'commonjs'
dependencies?: Record<string, string>
Expand All @@ -13,7 +13,7 @@ export interface PackageJson {
_moduleAliases?: Record<string, string>
}

export interface Jsconfig {
export type Jsconfig = {
compilerOptions?: {
baseUrl?: string
paths?: Record<string, string[]>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/lib/package-managers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ export enum PackageManager {
PNPM = 'pnpm',
}

export interface ProjectDependency {
export type ProjectDependency = {
name: string
version?: string
}

export interface PackageManagerCommands {
export type PackageManagerCommands = {
install: string
add: string
update: string
Expand Down
6 changes: 3 additions & 3 deletions src/shared/versions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum Versions {
ESLintKitMajor = '10',
ESLintKit = '^10.0.0',
ESLint = '^8.41.0',
ESLintKitMajor = '11',
ESLintKit = '^11.0.0',
ESLint = '^8.56.0',
Prettier = '^3.0.0',
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"@app": ["./src"],
"@app/*": ["./src/*"]
}
}
},
"include": ["src", ".eslintrc.cjs"]
}
Loading

0 comments on commit d9192c3

Please sign in to comment.