Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
Include source foundations in build:all and clean:all
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Lynch committed Sep 30, 2021
1 parent 5b682af commit 8bf6a5a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/@guardian/source-foundations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"dist"
],
"scripts": {
"build": "rm -rf dist && rollup -c",
"build": "yarn clean && rollup -c",
"clean": "rm -rf dist",
"tsc": "tsc -b"
},
"devDependencies": {
Expand Down
11 changes: 10 additions & 1 deletion scripts/build-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@ const build = (dir: string) => {
});
};

const { foundations, icons, brand, helpers, kitchen, coreComponents } = paths;
const {
foundations,
sourceFoundations,
icons,
brand,
helpers,
kitchen,
coreComponents,
} = paths;

// Build these packages in the specified order
const prioritisedPackages = [
foundations,
sourceFoundations,
helpers,
icons,
brand,
Expand Down
11 changes: 7 additions & 4 deletions scripts/clean-all.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import execa from 'execa';
import { paths, getComponentPaths } from './paths';

const { foundations, icons, brand, helpers, kitchen } = paths;
const { foundations, icons, brand, helpers, kitchen, sourceFoundations } =
paths;

const clean = (dir: string) => {
return execa('yarn', ['--cwd', `${dir}`, 'run', 'clean'], {
stdio: 'inherit',
});
};
[foundations, icons, brand, helpers, kitchen].forEach((dir) => {
clean(dir);
});
[foundations, icons, brand, helpers, kitchen, sourceFoundations].forEach(
(dir) => {
clean(dir);
},
);

getComponentPaths().then((paths) => {
paths.forEach((path) => {
Expand Down
5 changes: 5 additions & 0 deletions scripts/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const statP = promisify(stat);

const root = join(__dirname, '..');
const foundations = join(__dirname, '../src/core/foundations');
const sourceFoundations = join(
__dirname,
'../packages/@guardian/source-foundations',
);
const icons = join(__dirname, '../src/core/icons');
const brand = join(__dirname, '../src/core/brand');
const helpers = join(__dirname, '../src/core/helpers');
Expand Down Expand Up @@ -60,6 +64,7 @@ export const getKitchenComponentPaths = () =>
export const paths = {
root,
foundations,
sourceFoundations,
icons,
brand,
helpers,
Expand Down

0 comments on commit 8bf6a5a

Please sign in to comment.