Merge pull request #45 from DeterminateSystems/prettier-config

Add prettier config
This commit is contained in:
Luc Perkins 2024-04-22 12:52:33 -03:00 committed by GitHub
commit ab33fc26af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 46 additions and 34 deletions

View file

@ -21,7 +21,7 @@ jobs:
- name: Install pnpm dependencies - name: Install pnpm dependencies
run: nix develop --command pnpm install run: nix develop --command pnpm install
- name: Check formatting - name: Check formatting
run: nix develop --command pnpm run format run: nix develop --command pnpm run check-fmt
- name: Lint - name: Lint
run: nix develop --command pnpm run lint run: nix develop --command pnpm run lint
- name: Build - name: Build

View file

@ -1,2 +1,2 @@
dist
pnpm-lock.yaml pnpm-lock.yaml

48
dist/index.js generated vendored
View file

@ -86777,24 +86777,22 @@ var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => { (() => {
;// CONCATENATED MODULE: external "node:fs/promises"
const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
// EXTERNAL MODULE: external "node:os"
var external_node_os_ = __nccwpck_require__(612);
;// CONCATENATED MODULE: external "node:path"
const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
;// CONCATENATED MODULE: external "node:child_process"
const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process");
;// CONCATENATED MODULE: external "node:fs"
const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
// EXTERNAL MODULE: external "node:util"
var external_node_util_ = __nccwpck_require__(7261);
// EXTERNAL MODULE: external "http"
var external_http_ = __nccwpck_require__(3685);
// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/core.js // EXTERNAL MODULE: ./node_modules/.pnpm/@actions+core@1.10.1/node_modules/@actions/core/lib/core.js
var core = __nccwpck_require__(9093); var core = __nccwpck_require__(9093);
// EXTERNAL MODULE: ./node_modules/.pnpm/tail@2.2.6/node_modules/tail/lib/tail.js ;// CONCATENATED MODULE: external "node:fs"
var tail = __nccwpck_require__(3707); const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
// EXTERNAL MODULE: external "node:os"
var external_node_os_ = __nccwpck_require__(612);
// EXTERNAL MODULE: external "node:util"
var external_node_util_ = __nccwpck_require__(7261);
// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/exec.js
var exec = __nccwpck_require__(7775);
// EXTERNAL MODULE: external "os"
var external_os_ = __nccwpck_require__(2037);
;// CONCATENATED MODULE: external "node:crypto"
const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");
// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+cache@3.2.4/node_modules/@actions/cache/lib/cache.js
var cache = __nccwpck_require__(6878);
;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.2.0/node_modules/@sindresorhus/is/dist/index.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.2.0/node_modules/@sindresorhus/is/dist/index.js
const typedArrayTypeNames = [ const typedArrayTypeNames = [
'Int8Array', 'Int8Array',
@ -88491,8 +88489,6 @@ const timer = (request) => {
;// CONCATENATED MODULE: external "node:url" ;// CONCATENATED MODULE: external "node:url"
const external_node_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url"); const external_node_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url");
;// CONCATENATED MODULE: external "node:crypto"
const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto");
;// CONCATENATED MODULE: ./node_modules/.pnpm/normalize-url@8.0.1/node_modules/normalize-url/index.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/normalize-url@8.0.1/node_modules/normalize-url/index.js
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain'; const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';
@ -93746,12 +93742,10 @@ const got = source_create(defaults);
// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+exec@1.1.1/node_modules/@actions/exec/lib/exec.js ;// CONCATENATED MODULE: external "node:fs/promises"
var exec = __nccwpck_require__(7775); const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
// EXTERNAL MODULE: external "os" ;// CONCATENATED MODULE: external "node:path"
var external_os_ = __nccwpck_require__(2037); const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
// EXTERNAL MODULE: ./node_modules/.pnpm/@actions+cache@3.2.4/node_modules/@actions/cache/lib/cache.js
var cache = __nccwpck_require__(6878);
;// CONCATENATED MODULE: external "node:stream/promises" ;// CONCATENATED MODULE: external "node:stream/promises"
const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises");
;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@56a244c061429692b1c7d80fc068d684db3ae4d2_nqhbjyaof246q4gvygpbo6m4na/node_modules/detsys-ts/dist/index.js ;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@56a244c061429692b1c7d80fc068d684db3ae4d2_nqhbjyaof246q4gvygpbo6m4na/node_modules/detsys-ts/dist/index.js
@ -94619,6 +94613,12 @@ function mungeDiagnosticEndpoint(inputUrl) {
* Copyright (c) 2018-2020 [Samuel Carreira] * Copyright (c) 2018-2020 [Samuel Carreira]
*/ */
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map
// EXTERNAL MODULE: external "http"
var external_http_ = __nccwpck_require__(3685);
;// CONCATENATED MODULE: external "node:child_process"
const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process");
// EXTERNAL MODULE: ./node_modules/.pnpm/tail@2.2.6/node_modules/tail/lib/tail.js
var tail = __nccwpck_require__(3707);
;// CONCATENATED MODULE: ./dist/index.js ;// CONCATENATED MODULE: ./dist/index.js
// src/index.ts // src/index.ts

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -8,6 +8,7 @@
"scripts": { "scripts": {
"build": "tsup", "build": "tsup",
"format": "prettier --write .", "format": "prettier --write .",
"check-fmt": "prettier --check .",
"lint": "eslint src/**/*.ts", "lint": "eslint src/**/*.ts",
"package": "ncc build", "package": "ncc build",
"all": "pnpm run format && pnpm run lint && pnpm run build && pnpm run package" "all": "pnpm run format && pnpm run lint && pnpm run build && pnpm run package"

12
prettier.config.cjs Normal file
View file

@ -0,0 +1,12 @@
/** @type {import('prettier').Config} */
module.exports = {
plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")],
semi: true,
singleQuote: false,
tabWidth: 2,
trailingComma: "all",
useTabs: false,
// Import sorting
importOrderSeparation: true,
importOrderSortSpecifiers: true,
};

View file

@ -1,15 +1,14 @@
import * as core from "@actions/core";
import { IdsToolbox } from "detsys-ts";
import got from "got";
import * as http from "http";
import { SpawnOptions, exec, spawn } from "node:child_process";
import { openSync, readFileSync } from "node:fs";
import * as fs from "node:fs/promises"; import * as fs from "node:fs/promises";
import * as os from "node:os"; import * as os from "node:os";
import * as path from "node:path"; import * as path from "node:path";
import { spawn, exec, SpawnOptions } from "node:child_process";
import { openSync, readFileSync } from "node:fs";
import { inspect, promisify } from "node:util"; import { inspect, promisify } from "node:util";
import * as http from "http";
import * as core from "@actions/core";
import { Tail } from "tail"; import { Tail } from "tail";
import got from "got";
import { IdsToolbox } from "detsys-ts";
const ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR"; const ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR";