Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Node-18 (#27)
Browse files Browse the repository at this point in the history
* chore: improve tsconfig

* feat: prettier eslint

* chore: vscode prettier fix

* chore: eslint ignore

* chore: improve cli lint

* fix: lint error

* feat: node 18

* chore: changeset
  • Loading branch information
andykenward committed Jun 29, 2023
1 parent bc37585 commit e877494
Show file tree
Hide file tree
Showing 21 changed files with 446 additions and 203 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-colts-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@unlike/github-actions-core': minor
---

node 18 & esm only support
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "16"
"version": "18"
},
"ghcr.io/devcontainers-contrib/features/pnpm:2": {
"version": "latest"
Expand Down
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node_modules/
node_modules
packages/*/node_modules/
packages/*/dist/
packages/glob/__tests__/_temp
packages/*/__tests__/*/_temp
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
languages: ${{ matrix.language }}
- uses: unlike-ltd/github-actions/setup-pnpm@v0.0.2
with:
node-version: 16.x
node-version: 18.x
- name: Rebuild the dist/ directory
run: pnpm run build
- name: Perform CodeQL Analysis
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Setup Node.js Pnpm & install dependencies
uses: unlike-ltd/github-actions/setup-pnpm@v0.0.2
with:
node-version: 16.x
node-version: 18.x

- name: Creating .npmrc
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
version: [16.x, 18.x, 20.x]
version: [18.x, 20.x]
runs-on: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ yarn-error.log*
dist

*.xar
*.tgz
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"eslint.enable": true,
"eslint.validate": ["javascript", "typescript"],
"prettier.enable": true,
"prettier.prettierPath": "node_modules/prettier",
"javascript.preferences.importModuleSpecifierEnding": "js",
"typescript.preferences.importModuleSpecifierEnding": "js",
"search.exclude": {
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"clean": "turbo clean && rm -rf node_modules",
"format": "prettier --write \"**/*.{json,cjs,js,ts,yml,yaml}\"",
"format:check": "prettier -c \"**/*.{json,cjs,js,ts,yml,yaml}\"",
"lint": "eslint .",
"lint": "turbo lint && eslint .",
"lint:fix": "pnpm run lint --fix",
"lint:ls": "DEBUG=eslint:cli-engine pnpm run lint",
"test": "vitest run",
Expand All @@ -17,20 +17,21 @@
"release": "turbo run build && changeset publish"
},
"engines": {
"node": ">=16.20.0",
"node": ">=18.16.1",
"pnpm": ">=8.6.3"
},
"packageManager": "pnpm@8.6.3",
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@ianvs/prettier-plugin-sort-imports": "^4.0.2",
"@types/node": "16.18.36",
"@arethetypeswrong/cli": "^0.4.2",
"@changesets/cli": "2.26.2",
"@ianvs/prettier-plugin-sort-imports": "4.0.2",
"@types/node": "18.15.3",
"eslint": "8.43.0",
"eslint-config-custom": "workspace:*",
"prettier": "^2.8.8",
"prettier": "2.8.8",
"tsconfig": "workspace:*",
"turbo": "1.10.4",
"typescript": "5.1.3",
"turbo": "1.10.6",
"typescript": "5.1.6",
"vitest": "0.32.2"
}
}
16 changes: 8 additions & 8 deletions packages/core/__tests__/lib/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ describe('lib/utils', () => {
startLine: 5,
endLine: 5
})
expect(commandProperties.title).toBe('A title')
expect(commandProperties.file).toBe('root/test.txt')
expect(commandProperties.col).toBe(1)
expect(commandProperties.endColumn).toBe(2)
expect(commandProperties.line).toBe(5)
expect(commandProperties.endLine).toBe(5)
expect(commandProperties['title']).toBe('A title')
expect(commandProperties['file']).toBe('root/test.txt')
expect(commandProperties['col']).toBe(1)
expect(commandProperties['endColumn']).toBe(2)
expect(commandProperties['line']).toBe(5)
expect(commandProperties['endLine']).toBe(5)

expect(commandProperties.startColumn).toBeUndefined()
expect(commandProperties.startLine).toBeUndefined()
expect(commandProperties['startColumn']).toBeUndefined()
expect(commandProperties['startLine']).toBeUndefined()
})
})
})
12 changes: 3 additions & 9 deletions packages/core/__tests__/variables.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import type {SpyInstance} from 'vitest'

import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'

import {
beforeAll,
beforeEach,
describe,
expect,
SpyInstance,
test,
vi
} from 'vitest'
import {beforeAll, beforeEach, describe, expect, test, vi} from 'vitest'

import {
addPath,
Expand Down
27 changes: 8 additions & 19 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,9 @@
"type": "module",
"sideEffects": false,
"exports": {
"node": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"types": "./dist/esm/index.d.ts",
"main": "./dist/esm/index.js",
"files": [
"dist"
],
Expand All @@ -39,23 +27,24 @@
"directory": "packages/core"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
"build": "rm -rf dist && tsup-node",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
"clean": "rm -rf .turbo node_modules dist",
"lint": "tsc --noEmit",
"test": "echo \"Error: run tests from root\" && exit 1"
},
"bugs": {
"url": "https://github.com/unlike-ltd/github-actions-toolkit/issues"
},
"engines": {
"node": ">=v16.20.0"
"node": ">=18.16.1"
},
"dependencies": {
"@actions/http-client": "^2.1.0"
},
"devDependencies": {
"@types/node": "16.18.36",
"@types/node": "18.15.3",
"tsconfig": "workspace:*",
"tsup": "7.1.0",
"typescript": "5.1.3"
"typescript": "5.1.6"
}
}
5 changes: 4 additions & 1 deletion packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "tsconfig/base.json",
"include": ["./src"],
"compilerOptions": {
"noEmit": true
},
"include": ["./src", "./__tests__"],
"exclude": ["./dist", "node_modules"]
}
12 changes: 3 additions & 9 deletions packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,15 @@ export default defineConfig(() => {
treeshake: false,
dts: true,
platform: 'node',
target: 'node16.20.0',
target: 'node18.16.1',
shims: true
}

const esm: Options = {
...common,
format: 'esm',
outDir: './dist/esm'
outDir: './dist'
}

const cjs: Options = {
...common,
format: 'cjs',
outDir: './dist/cjs'
}

return [esm, cjs]
return [esm]
})
2 changes: 1 addition & 1 deletion packages/eslint-config-custom/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const config = {
'plugin:@typescript-eslint/recommended',
'plugin:unicorn/all',
'turbo',
'prettier'
'plugin:prettier/recommended'
],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
Expand Down
9 changes: 5 additions & 4 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"clean": "rm -rf .turbo && rm -rf node_modules"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "5.60.0",
"@typescript-eslint/parser": "5.60.0",
"eslint-config-prettier": "^8.8.0",
"eslint-config-turbo": "^1.10.6",
"@typescript-eslint/eslint-plugin": "5.60.1",
"@typescript-eslint/parser": "5.60.1",
"eslint-config-prettier": "8.8.0",
"eslint-config-turbo": "1.10.6",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-unicorn": "47.0.0",
"eslint-plugin-vitest": "0.2.6"
},
Expand Down
4 changes: 1 addition & 3 deletions packages/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
"display": "Default",
"extends": [
"@tsconfig/strictest/tsconfig.json",
"@tsconfig/node16/tsconfig.json",
"@tsconfig/esm/tsconfig.json"
"@tsconfig/node18/tsconfig.json"
],
"compilerOptions": {
"moduleResolution": "node16",
"resolveJsonModule": true
},
"exclude": ["node_modules"]
Expand Down
3 changes: 1 addition & 2 deletions packages/tsconfig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"clean": "rm -rf .turbo && rm -rf node_modules"
},
"dependencies": {
"@tsconfig/esm": "1.0.3",
"@tsconfig/node16": "1.0.4",
"@tsconfig/node18": "18.2.0",
"@tsconfig/strictest": "2.0.1"
}
}
Loading

0 comments on commit e877494

Please sign in to comment.