From 7bf7d5ef85884b59cd1044ab8ad3f8ad54a5bf2a Mon Sep 17 00:00:00 2001 From: andes-it Date: Tue, 18 Jun 2024 11:22:31 +0000 Subject: [PATCH] chore: nx format:write update dirty files --- scripts/ci/cache/_generated_files.mjs | 90 +++++++++++++-------------- scripts/ci/cache/_utils.mjs | 1 - 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/scripts/ci/cache/_generated_files.mjs b/scripts/ci/cache/_generated_files.mjs index c7dc7a875317..58c534db8187 100644 --- a/scripts/ci/cache/_generated_files.mjs +++ b/scripts/ci/cache/_generated_files.mjs @@ -1,51 +1,51 @@ -// @ts-check -import { createHash } from 'node:crypto'; -import { readFile } from 'node:fs/promises'; -import { glob } from 'glob'; -import { ROOT } from './_common.mjs'; -import { resolve } from 'node:path'; +// @ts-check +import { createHash } from 'node:crypto' +import { readFile } from 'node:fs/promises' +import { glob } from 'glob' +import { ROOT } from './_common.mjs' +import { resolve } from 'node:path' const patterns = [ - 'scripts/codegen.js', - 'libs/cms/src/lib/generated/contentfulTypes.d.ts', - 'apps/air-discount-scheme/web/i18n/withLocale.tsx', - 'apps/air-discount-scheme/web/components/AppLayout/AppLayout.tsx', - 'apps/air-discount-scheme/web/components/Header/Header.tsx', - 'apps/air-discount-scheme/web/screens/**/*.tsx', - 'libs/application/types/src/lib/ApplicationTypes.ts', - '**/codegen.yml', - '**/*.model.ts', - '**/*.enum.ts', - '**/queries/**/*', - '**/mutations/**/*', - '**/fragments/**/*', - '**/*.resolver.ts', - '**/*.service.ts', - '**/*.dto.ts', - '**/*.input.ts', - '**/*.module.ts', - '**/*.controller.ts', - '**/*.union.ts', - '**/*.graphql.tsx?', - '**/*.graphql', - '**/clientConfig.*', - 'libs/judicial-system/**' -]; + 'scripts/codegen.js', + 'libs/cms/src/lib/generated/contentfulTypes.d.ts', + 'apps/air-discount-scheme/web/i18n/withLocale.tsx', + 'apps/air-discount-scheme/web/components/AppLayout/AppLayout.tsx', + 'apps/air-discount-scheme/web/components/Header/Header.tsx', + 'apps/air-discount-scheme/web/screens/**/*.tsx', + 'libs/application/types/src/lib/ApplicationTypes.ts', + '**/codegen.yml', + '**/*.model.ts', + '**/*.enum.ts', + '**/queries/**/*', + '**/mutations/**/*', + '**/fragments/**/*', + '**/*.resolver.ts', + '**/*.service.ts', + '**/*.dto.ts', + '**/*.input.ts', + '**/*.module.ts', + '**/*.controller.ts', + '**/*.union.ts', + '**/*.graphql.tsx?', + '**/*.graphql', + '**/clientConfig.*', + 'libs/judicial-system/**', +] export async function getGeneratedFilesHash() { - const hash = createHash('sha1'); - const files = await glob(patterns, { - cwd: ROOT, - nodir: true - }); - console.log(`Files to hash:`) - for (const _file of files) { - console.log(_file); - const file = resolve(ROOT, _file); - const content = await readFile(file, 'utf8'); - hash.update(content); - } + const hash = createHash('sha1') + const files = await glob(patterns, { + cwd: ROOT, + nodir: true, + }) + console.log(`Files to hash:`) + for (const _file of files) { + console.log(_file) + const file = resolve(ROOT, _file) + const content = await readFile(file, 'utf8') + hash.update(content) + } - const finalHash = hash.digest('hex'); - return finalHash; + const finalHash = hash.digest('hex') + return finalHash } diff --git a/scripts/ci/cache/_utils.mjs b/scripts/ci/cache/_utils.mjs index 14234682d066..82eedce63726 100644 --- a/scripts/ci/cache/_utils.mjs +++ b/scripts/ci/cache/_utils.mjs @@ -6,7 +6,6 @@ import { spawn } from 'node:child_process' import { resolve, join } from 'node:path' import { readFile, readdir, stat } from 'node:fs/promises' - export async function getNodeVersionString() { const content = await getPackageJSON() const nodeVersion = content?.engines?.node