Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jbudz committed Oct 3, 2022
1 parent 4d28a8b commit 134fd87
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scripts/yarn_deduplicate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

require('../src/setup_node_env');
require('../src/dev/yarn_deduplicate');
22 changes: 22 additions & 0 deletions src/dev/yarn_deduplicate/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { resolve } from 'path';
import { writeFileSync, readFileSync } from 'fs';
import { fixDuplicates } from 'yarn-deduplicate';
import { REPO_ROOT } from '@kbn/utils';

const yarnLockFile = resolve(REPO_ROOT, 'yarn.lock');
const yarnLock = readFileSync(yarnLockFile, 'utf-8');
const output = fixDuplicates(yarnLock, {
useMostCommon: false,
excludeScopes: ['@types'],
excludePackages: ['axe-core'],
});

writeFileSync(yarnLockFile, output);

0 comments on commit 134fd87

Please sign in to comment.