Skip to content

Commit

Permalink
chore: use a script for removing examples directory
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jun 14, 2021
1 parent 5f7ae21 commit 91b94c8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -100,7 +100,7 @@
"lint": "eslint . --cache --ext js,jsx,ts,tsx,md",
"lint:prettier": "prettier '**/*.{md,yml,yaml}' 'website/**/*.{css,js}' --write --ignore-path .gitignore",
"lint:prettier:ci": "prettier '**/*.{md,yml,yaml}' 'website/**/*.{css,js}' --check --ignore-path .gitignore",
"remove-examples": "rimraf examples/",
"remove-examples": "node ./scripts/remove-examples.js",
"test-types": "yarn jest --config jest.config.types.js",
"test-ci": "yarn jest-coverage --color -i --config jest.config.ci.js && yarn test-leak && node ./scripts/mapCoverage.js && codecov",
"test-ci-partial": "yarn test-ci-partial:parallel -i",
Expand Down
22 changes: 22 additions & 0 deletions scripts/remove-examples.js
@@ -0,0 +1,22 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

const {writeFileSync} = require('fs');
const {resolve} = require('path');
const rimraf = require('rimraf');

const configFile = require.resolve('../jest.config');

const config = require(configFile);

delete config.projects;

writeFileSync(configFile, `module.exports = ${JSON.stringify(config)};\n`);

rimraf.sync(resolve(__dirname, '../examples/'));

0 comments on commit 91b94c8

Please sign in to comment.