Skip to content

Commit

Permalink
feat(*): publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
iLya Raylyan authored and iLya Raylyan committed Feb 2, 2020
1 parent 031e048 commit bc584e2
Show file tree
Hide file tree
Showing 7 changed files with 823 additions and 782 deletions.
5 changes: 5 additions & 0 deletions bin/build-root-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

package_name=$(echo $1 | awk -F- '{print $3}')
mkdir -p ../../dist/$package_name
cp -r dist/ ../../dist/$package_name
16 changes: 16 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

lerna exec --parallel -- rm -rf dist
lerna exec --parallel -- NODE_ENV=production babel \
--root-mode upward \
--extensions '.ts,.tsx' src -d dist \
--copy-files \
--no-copy-ignored \
--ignore **/*.stories.tsx,**/*.test.tsx
lerna exec --parallel -- tsc --p tsconfig.json
lerna exec --parallel -- postcss dist/*.css -d dist
lerna exec --parallel -- cp package.json dist/package.json
rm -rf dist
lerna exec --parallel -- $(pwd)/bin/build-root-package.sh \$LERNA_PACKAGE_NAME
cp -r packages/vars dist
cp package.json dist/package.json
10 changes: 10 additions & 0 deletions bin/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

lerna version --no-push
yarn build
lerna publish from-git --contents dist
yarn publish dist --no-git-tag-version
cp dist/package.json package.json
git add package.json
git commit -m 'update version'
git push
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@alfa/core-components",
"version": "0.1.0",
"private": true,
"name": "@alfalab/core-components",
"version": "0.0.1",
"license": "ISC",
"repository": {
"type": "git",
"url": "git+https://github.com/alfa-laboratory/core-components.git"
Expand All @@ -11,19 +11,12 @@
},
"homepage": "https://github.com/alfa-laboratory/core-components#readme",
"scripts": {
"build:clean": "lerna exec --parallel -- rm -rf dist",
"build:types": "lerna exec --parallel -- tsc --p tsconfig.json",
"build:package": "lerna exec --parallel -- cp package.json dist/package.json",
"build:postcss": "lerna exec --parallel -- postcss dist/*.css -d dist",
"build:compile": "lerna exec --parallel -- NODE_ENV=production babel --root-mode upward --extensions '.ts,.tsx' src -d dist --copy-files --ignore **/*.stories.tsx,**/*.test.tsx",
"build": "yarn build:clean && yarn build:compile && (yarn build:types & yarn build:postcss & yarn build:package)",
"build": "./bin/build.sh",
"start": "start-storybook -p 9009 -c .storybook",
"build-storybook": "build-storybook -o build",
"update-colors": "node ./tools/update-colors.js",
"bootstrap": "lerna bootstrap",
"prepublish": "yarn build",
"publish:packages": "lerna publish --contents dist --no-push",
"postinstall": "yarn bootstrap"
"postinstall": "lerna bootstrap",
"pub": "./bin/publish.sh"
},
"eslintConfig": {
"extends": "react-app"
Expand Down Expand Up @@ -76,5 +69,8 @@
"storybook-addon-designs": "^5.1.2",
"ts-loader": "^6.2.1",
"typescript": "~3.7.5"
},
"publishConfig": {
"access": "public"
}
}
4 changes: 2 additions & 2 deletions packages/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@alfalab/core-components-button",
"version": "0.0.61-alpha.0",
"description": "",
"gitHead": "c756cab6982503b7142c014a1f4a8834d21a7bdb",
"gitHead": "f054fef20200664c65e2501ef1f916c555cdf05d",
"keywords": [],
"license": "ISC",
"main": "index.js",
Expand All @@ -12,4 +12,4 @@
"peerDependencies": {
"react": "^16.9.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/button/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ export const Button: React.FC<Props> = ({
{children}
</button>
);
};
};
1,546 changes: 780 additions & 766 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit bc584e2

Please sign in to comment.