Skip to content

Commit

Permalink
chore: nx format:write update dirty files
Browse files Browse the repository at this point in the history
  • Loading branch information
andes-it committed Jun 18, 2024
1 parent 2606219 commit 7bf7d5e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 46 deletions.
90 changes: 45 additions & 45 deletions scripts/ci/cache/_generated_files.mjs
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 0 additions & 1 deletion scripts/ci/cache/_utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7bf7d5e

Please sign in to comment.