refactor: update dev dependencies (#204)

* refactor: update typescript to 4.9.4

* refactor: update jest to 29.2.5

* fix: add missing moduleResolution for ncc

* refactor: update @tsconfig/node16 to 1.0.3

* refactor: update prettier to 2.8.1

* refactor: update eslint and parsers/plugins to latest

* refactor: update semantic-release and plugins to latest

* refactor: update conventional-changelog-conventionalcommits to 5.0.0

* refactor: update @types/node to 16.18.11

* refactor: enable unknown errors when caught
This commit is contained in:
Cedric van Putten authored and GitHub committed 2023-01-04 08:09:19 -08:00
1 parent 830e647327
commit 5a73f07f49
14 files changed
+9562 -9503

No files matched your search

-4
View File
@@ -1,4 +0,0 @@
module.exports = {
ignorePatterns: ['build/**', 'node_modules/**'],
extends: ['universe/node'],
};
-9
View File
@@ -1,9 +0,0 @@
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"bracketSameLine": true,
"trailingComma": "es5",
"arrowParens": "avoid",
"endOfLine": "auto"
}
+5 -5
View File
@@ -18,7 +18,7 @@
* **command:** clean up the readme code example ([0811162](https://github.com/expo/expo-github-action/commit/0811162597bbb2719038d9bac02bd074a5d6d124))
* update the release steps in the contribution guide ([b3b45ee](https://github.com/expo/expo-github-action/commit/b3b45ee53f1b6ce7e1db84a06047941fbea5c236))
### [7.1.1](https://github.com/expo/expo-github-action/compare/7.1.0...7.1.1) (2022-03-17)
## [7.1.1](https://github.com/expo/expo-github-action/compare/7.1.0...7.1.1) (2022-03-17)
### Bug fixes
@@ -54,7 +54,7 @@
* skip steps if auth is unavailable ([bb7c723](https://github.com/expo/expo-github-action/commit/bb7c72336b557c49ca0a0e84025e1b4cce23ce2e))
* update github action author name ([#166](https://github.com/expo/expo-github-action/issues/166)) ([520d959](https://github.com/expo/expo-github-action/commit/520d9594e099c7b2475d8b376303466a187bcafa))
### [7.0.3](https://github.com/expo/expo-github-action/compare/7.0.2...7.0.3) (2022-02-14)
## [7.0.3](https://github.com/expo/expo-github-action/compare/7.0.2...7.0.3) (2022-02-14)
### Bug fixes
@@ -74,14 +74,14 @@
* simplify expo cli versioning to latest ([#161](https://github.com/expo/expo-github-action/issues/161)) ([2e1fe6a](https://github.com/expo/expo-github-action/commit/2e1fe6ac53c6fd536ea5691410d73df35384fd07))
### [7.0.2](https://github.com/expo/expo-github-action/compare/7.0.1...7.0.2) (2022-01-25)
## [7.0.2](https://github.com/expo/expo-github-action/compare/7.0.1...7.0.2) (2022-01-25)
### Code changes
* **preview-comment:** auto-fill the github token ([#156](https://github.com/expo/expo-github-action/issues/156)) ([204dfed](https://github.com/expo/expo-github-action/commit/204dfed23cb6416041ee5c918c7a6e3a5dbf8955))
### [7.0.1](https://github.com/expo/expo-github-action/compare/7.0.0...7.0.1) (2022-01-17)
## [7.0.1](https://github.com/expo/expo-github-action/compare/7.0.0...7.0.1) (2022-01-17)
### Bug fixes
@@ -192,7 +192,7 @@
* update readme for v6 release ([#101](https://github.com/expo/expo-github-action/issues/101)) ([8b43bae](https://github.com/expo/expo-github-action/commit/8b43bae073f280d4fa76aa174642ad46febe985c))
* update upstream reference in contributing guide ([76ce4de](https://github.com/expo/expo-github-action/commit/76ce4de80ea89b343404cdabadc922882af80487))
### [5.5.1](https://github.com/expo/expo-github-action/compare/5.5.0...5.5.1) (2021-06-17)
## [5.5.1](https://github.com/expo/expo-github-action/compare/5.5.0...5.5.1) (2021-06-17)
### Bug fixes
+1677 -1680
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+4824 -4802
View File
File diff suppressed because it is too large. Load diff
+28 -15
View File
@@ -29,22 +29,35 @@
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@tsconfig/node16": "^1.0.2",
"@types/jest": "^27.4.0",
"@types/node": "^16.11.19",
"@typescript-eslint/eslint-plugin": "^5.9.1",
"@typescript-eslint/parser": "^5.9.1",
"@vercel/ncc": "^0.33.1",
"conventional-changelog-conventionalcommits": "^4.6.3",
"eslint": "^8.6.0",
"eslint-config-universe": "^10.0.0",
"jest": "^27.4.7",
"prettier": "^2.5.1",
"semantic-release": "^19.0.3",
"ts-jest": "^27.1.2",
"typescript": "^4.5.4"
"@tsconfig/node16": "^1.0.3",
"@types/jest": "^29.2.5",
"@types/node": "^16.18.11",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@vercel/ncc": "^0.36.0",
"conventional-changelog-conventionalcommits": "^5.0.0",
"eslint": "^8.31.0",
"eslint-config-universe": "^11.1.1",
"jest": "^29.3.1",
"prettier": "^2.8.1",
"semantic-release": "^19.0.5",
"ts-jest": "^29.0.3",
"typescript": "^4.9.4"
},
"eslintConfig": {
"extends": "universe/node",
"ignorePatterns": ["build/**", "node_modules/**"]
},
"prettier": {
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"bracketSameLine": true,
"trailingComma": "es5",
"arrowParens": "avoid",
"endOfLine": "auto"
}
}
+4 -5
View File
@@ -27,7 +27,7 @@ export async function restoreFromCache(name: string, version: string, manager: s
const dir = toolPath(name, version)!;
if (!cacheIsAvailable()) {
warning(`Remote cache is not available, skipping restore from cache...`);
warning(`Skipped restoring from remote cache, not available.`);
return undefined;
}
@@ -46,7 +46,7 @@ export async function restoreFromCache(name: string, version: string, manager: s
*/
export async function saveToCache(name: string, version: string, manager: string) {
if (!cacheIsAvailable()) {
warning(`Remote cache is not available, skipping saving to cache...`);
warning(`Skipped saving to remote cache, not available.`);
return undefined;
}
@@ -66,11 +66,10 @@ export async function saveToCache(name: string, version: string, manager: string
* - ReserveCacheError
* - "cache service url not found"
*/
export function handleCacheError(error: Error): void {
export function handleCacheError(error: Error | unknown): void {
const isReserveCacheError = error instanceof ReserveCacheError;
const isCacheUnavailable = error.message.toLowerCase().includes('cache service url not found');
if (isReserveCacheError || isCacheUnavailable) {
if (isReserveCacheError) {
warning('Skipped remote cache, encountered error:');
warning(error.message);
} else {
+6 -4
View File
@@ -4,6 +4,8 @@ import { which } from '@actions/io';
import { ok as assert } from 'assert';
import { URL } from 'url';
import { errorMessage } from './utils';
export type CliName = 'expo' | 'eas';
export type Command = {
@@ -96,7 +98,7 @@ export async function projectOwner(cli: CliName = 'expo'): Promise<string> {
try {
({ stdout } = await getExecOutput(await which(cli), ['whoami'], { silent: true }));
} catch (error) {
throw new Error(`Could not fetch the project owner, reason:\n${error.message | error}`);
throw new Error(`Could not fetch the project owner, reason:\n${errorMessage(error)}`);
}
if (!stdout) {
@@ -117,7 +119,7 @@ export async function runCommand(cmd: Command) {
silent: false,
}));
} catch (error) {
throw new Error(`Could not run command ${cmd.args.join(' ')}, reason:\n${error.message | error}`);
throw new Error(`Could not run command ${cmd.args.join(' ')}, reason:\n${errorMessage(error)}`);
}
return [stdout.trim(), stderr.trim()];
@@ -132,7 +134,7 @@ export async function easBuild(cmd: Command): Promise<BuildInfo[]> {
silent: false,
}));
} catch (error) {
throw new Error(`Could not run command eas build, reason:\n${error.message | error}`);
throw new Error(`Could not run command eas build, reason:\n${errorMessage(error)}`);
}
return JSON.parse(stdout);
@@ -149,7 +151,7 @@ export async function projectInfo(dir: string): Promise<ProjectInfo> {
silent: true,
}));
} catch (error) {
throw new Error(`Could not fetch the project info from ${dir}, reason:\n${error.message || error}`);
throw new Error(`Could not fetch the project info from ${dir}, reason:\n${errorMessage(error)}`);
}
const { name, slug, owner } = JSON.parse(stdout);
+2 -1
View File
@@ -1,6 +1,7 @@
import { exec, getExecOutput } from '@actions/exec';
import { mkdirP } from '@actions/io';
import { errorMessage } from './utils';
import { cacheTool, tempPath } from './worker';
/**
@@ -14,7 +15,7 @@ export async function resolvePackage(name: string, range: string): Promise<strin
try {
({ stdout } = await getExecOutput('npm', ['info', `${name}@${range}`, 'version', '--json'], { silent: true }));
} catch (error) {
throw new Error(`Could not resolve ${name}@${range}, reason:\n${error.message || error}`);
throw new Error(`Could not resolve ${name}@${range}, reason:\n${errorMessage(error)}`);
}
// thanks npm, for returning a "" json string value for invalid versions
+16
View File
@@ -1,3 +1,7 @@
/**
* Replace all template variables in a string.
* This uses the notation of `{varname}`, which can be defined as object.
*/
export function template(template: string, replacements: Record<string, string>) {
let result = template;
for (const name in replacements) {
@@ -5,3 +9,15 @@ export function template(template: string, replacements: Record<string, string>)
}
return result;
}
export function errorMessage(error: Error | unknown): string {
if (error instanceof Error) {
return error.message;
}
if (typeof error === 'string') {
return error;
}
return 'Unknown error';
}
+3 -1
View File
@@ -4,6 +4,8 @@ import { ok as assert } from 'assert';
import os from 'os';
import path from 'path';
import { errorMessage } from './utils';
export { find as findTool, cacheDir as cacheTool } from '@actions/tool-cache';
/**
@@ -54,7 +56,7 @@ export async function patchWatchers(): Promise<void> {
} catch (error) {
warning(`Looks like we can't patch watchers/inotify limits, you might encouter the 'ENOSPC' error.`);
warning('For more info: https://github.com/expo/expo-github-action/issues/20, encountered error:');
warning(error.message);
warning(errorMessage(error));
}
}
+10 -11
View File
@@ -1,13 +1,12 @@
{
"extends": "./node_modules/@tsconfig/node16/tsconfig.json",
"compilerOptions": {
"outDir": "./build",
"rootDir": "./src",
"useUnknownInCatchVariables": false
},
"exclude": [
"build",
"node_modules",
"tests/**"
]
"extends": "@tsconfig/node16",
"compilerOptions": {
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"build",
"node_modules",
"tests/**"
]
}
+1366 -1343
View File
File diff suppressed because it is too large. Load diff