Skip to content

Commit

Permalink
chore: update deps, update nodejs import paths and eslint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-jerkovic committed Dec 15, 2023
1 parent b545dd8 commit 36be9f5
Show file tree
Hide file tree
Showing 18 changed files with 875 additions and 799 deletions.
4 changes: 2 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"useGitignore": true,
"cache": {
"useCache": true,
"cacheStrategy": "content",
"cacheLocation": "./.cspellcache"
"cacheLocation": "node_modules/.cache/cspell/.cspellcache",
"cacheStrategy": "content"
},
"ignorePaths": ["CHANGELOG.md"],
"ignoreWords": [
Expand Down
10 changes: 10 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/** @type { import('@types/eslint').ESLint.ConfigData } */
module.exports = {
extends: [require.resolve('@rimac-technology/style-guide/eslint/core')],
ignorePatterns: [
'*generated*',
'dist',
'!.*.js',
'!.*.cjs',
'!.*.mjs',
'!.*.ts',
],
overrides: [{ files: ['./src/**/*.{js,cjs,mjs,ts}'] }],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.lint.json',
Expand Down
53 changes: 10 additions & 43 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,52 +1,19 @@
# Yarn not using Zero-Installs
# Intellij
*.idea

# Dependencies
node_modules

# Yarn
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

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

# Dependency directories
node_modules/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# IntelliJ project files
.idea/

# Project
build/
lib/
dist/
# Generated
dist

# MacOS
.DS_Store

# Cspell
.cspellcache
**/.DS_Store
1 change: 1 addition & 0 deletions .packagerc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type { import('npm-package-json-lint').NpmPackageJsonLintOptions } */
module.exports = {
extends: '@rimac-technology/style-guide/package-json/core',
}
1 change: 1 addition & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @type { import('@types/prettier').Config } */
module.exports = {
...require('@rimac-technology/style-guide/prettier'),
}
18 changes: 9 additions & 9 deletions .releaserc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ module.exports = {
preset: 'angular',
releaseRules: [
{
type: 'refactor',
release: 'patch',
type: 'refactor',
},
{
type: 'chore',
release: 'patch',
type: 'chore',
},
],
},
Expand All @@ -35,31 +35,31 @@ module.exports = {
presetConfig: {
types: [
{
type: 'feat',
section: 'Features',
type: 'feat',
},
{
type: 'fix',
section: 'Bug Fixes',
type: 'fix',
},
{
type: 'refactor',
section: 'Code Refactoring',
type: 'refactor',
},
{
type: 'chore',
section: 'Other',
type: 'chore',
},
{
type: 'perf',
section: 'Performance Improvements',
type: 'perf',
},
{
type: 'revert',
section: 'Reverts',
type: 'revert',
},
],
}
},
},
],
'@semantic-release/changelog',
Expand Down
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 Rimac Technology
Copyright (c) 2023 Rimac Technology

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
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"postinstall": "husky install",
"lint": "yarn lint:cspell && yarn lint:prettier && yarn lint:package-json && yarn lint:eslint",
"lint:cspell": "cspell --no-progress --unique --no-summary '**'",
"lint:eslint": "eslint './src' --quiet --cache",
"lint:eslint": "eslint ./ --quiet --cache --cache-location node_modules/.cache/eslint/.eslintcache",
"lint:fix": "yarn lint:prettier --write && yarn lint:eslint --fix",
"lint:package-json": "npmPkgJsonLint --configFile .packagerc.cjs .",
"lint:prettier": "prettier --log-level warn --check './**/*{yaml,yml,json,md,graphql}'",
"lint:prettier": "prettier --cache --check './**/*{yaml,yml,json,md,graphql}'",
"prepack": "pinst --disable",
"postpack": "pinst --enable",
"release": "semantic-release"
Expand All @@ -40,31 +40,32 @@
}
},
"dependencies": {
"@aws-sdk/client-ecr": "^3.460.0",
"@aws-sdk/client-ecr": "^3.474.0",
"aggregate-error": "^5.0.0"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@rimac-technology/style-guide": "^9.2.0",
"@rimac-technology/style-guide": "^9.2.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^11.1.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.3",
"@semantic-release/npm": "^11.0.1",
"@semantic-release/github": "^9.2.5",
"@semantic-release/npm": "^11.0.2",
"@semantic-release/release-notes-generator": "^12.1.0",
"@types/node": "^20.10.0",
"@types/eslint": "^8.44.9",
"@types/node": "^20.10.4",
"commitizen": "^4.3.0",
"conventional-changelog-conventionalcommits": "^7.0.2",
"cspell": "^8.0.0",
"eslint": "^8.54.0",
"cspell": "^8.1.3",
"eslint": "^8.55.0",
"husky": "^8.0.3",
"npm-package-json-lint": "^7.1.0",
"pinst": "^3.0.0",
"prettier": "^3.1.0",
"semantic-release": "^22.0.8",
"prettier": "^3.1.1",
"semantic-release": "^22.0.12",
"tsup": "^8.0.1",
"typescript": "^5.3.2"
"typescript": "^5.3.3"
},
"peerDependencies": {
"semantic-release": ">=20"
Expand Down
6 changes: 3 additions & 3 deletions src/aws.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Buffer } from 'buffer'
import { Buffer } from 'node:buffer'

import {
ECRClient,
Expand All @@ -10,8 +10,8 @@ import type { VerifyConditionsContext } from 'semantic-release'
import type {
AWSConfigType,
AWSLoginValueType,
} from './aws.types'
import { getError } from './error'
} from './aws.types.js'
import { getError } from './error.js'

export class AWS {
public static loadConfig(context: VerifyConditionsContext): AWSConfigType {
Expand Down
8 changes: 4 additions & 4 deletions src/docker.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
exec,
execSync,
} from 'child_process'
} from 'node:child_process'

import AggregateError from 'aggregate-error'
import type { PublishContext } from 'semantic-release'

import type {
DockerConfigType,
DockerImageType,
} from './docker.types'
import { getError } from './error'
import type { PluginConfig } from './types'
} from './docker.types.js'
import { getError } from './error.js'
import type { PluginConfig } from './types.js'

export class Docker {
public static loadConfig(pluginConfig: PluginConfig, context: PublishContext): DockerConfigType {
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { prepare, } from './prepare'
export { publish, } from './publish'
export { verifyConditions, } from './verifyConditions'
export { prepare, } from './prepare.js'
export { publish, } from './publish.js'
export { verifyConditions, } from './verifyConditions.js'
6 changes: 3 additions & 3 deletions src/prepare.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import AggregateError from 'aggregate-error'
import type { PrepareContext } from 'semantic-release'

import { Docker } from './docker'
import { getError } from './error'
import type { PluginConfig } from './types'
import { Docker } from './docker.js'
import { getError } from './error.js'
import type { PluginConfig } from './types.js'

export async function prepare(pluginConfig: PluginConfig, context: PrepareContext): Promise<void> {
if (!pluginConfig.buildImage) {
Expand Down
10 changes: 5 additions & 5 deletions src/publish.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import AggregateError from 'aggregate-error'
import type { PublishContext } from 'semantic-release'

import { AWS } from './aws'
import type { AWSConfigType } from './aws.types'
import { Docker } from './docker'
import { getError } from './error'
import { AWS } from './aws.js'
import type { AWSConfigType } from './aws.types.js'
import { Docker } from './docker.js'
import { getError } from './error.js'
import type {
PluginConfig,
WithoutNullableKeysType,
} from './types'
} from './types.js'

export async function publish(pluginConfig: PluginConfig, context: PublishContext): Promise<void> {
const awsConfig = AWS.loadConfig(context) as WithoutNullableKeysType<AWSConfigType>
Expand Down
6 changes: 3 additions & 3 deletions src/verifyConditions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import AggregateError from 'aggregate-error'
import type { VerifyConditionsContext } from 'semantic-release'

import { AWS } from './aws'
import { getError } from './error'
import type { PluginConfig } from './types'
import { AWS } from './aws.js'
import { getError } from './error.js'
import type { PluginConfig } from './types.js'

export function verifyConditions(pluginConfig: PluginConfig, context: VerifyConditionsContext): void {
const errors = []
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
"skipLibCheck": true,
"esModuleInterop": true,
"lib": ["ES2023", "DOM", "DOM.ITERABLE"],
"moduleResolution": "node",
"moduleResolution": "Node16",
"forceConsistentCasingInFileNames": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true,
"strict": true,
"allowJs": true,
"outDir": "dist",
"target": "ES2022",
"module": "ESNext"
"module": "Node16"
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["./src/**/*.js", "./src/**/*.ts", "./**/*.mjs", ".*.js", ".*.ts"]
"extends": ["./tsconfig.json"],
"include": ["./**/*.js", "./**/*.ts", ".*.js", ".*.cjs", ".*.mjs", ".*.ts", "*.js", "*.cjs", "*.mjs", "*.ts"]
}
4 changes: 2 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'tsup'

export default defineConfig({
entry: ['src/index.ts'],
clean: true,
format: ['esm']
entry: ['src/index.ts'],
format: ['esm'],
})
Loading

0 comments on commit 36be9f5

Please sign in to comment.