Skip to content

Commit

Permalink
Packages publish updates (#62)
Browse files Browse the repository at this point in the history
* feat: Updated Shared, client, react packages package.json to publish

* feat: Updated package.json and added env script for widget

* feat: Removed workspace prefix from packages usage
  • Loading branch information
chavda-bhavik authored Nov 16, 2022
1 parent ccf92e0 commit 3507034
Show file tree
Hide file tree
Showing 11 changed files with 530 additions and 69 deletions.
8 changes: 4 additions & 4 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "@impler/api",
"version": "0.1.0",
"main": "index.js",
"author": "knovator",
"license": "MIT",
"private": false,
"private": true,
"scripts": {
"prebuild": "rimraf dist",
"preinstall": "pnpm build",
Expand All @@ -21,8 +20,8 @@
},
"dependencies": {
"@aws-sdk/client-s3": "^3.185.0",
"@impler/dal": "workspace:^0.1.0",
"@impler/shared": "workspace:^0.1.0",
"@impler/dal": "^0.1.0",
"@impler/shared": "^0.1.0",
"@nestjs/common": "^9.1.2",
"@nestjs/core": "^9.1.2",
"@nestjs/platform-express": "^9.1.2",
Expand All @@ -41,6 +40,7 @@
"xlsx": "^0.18.5"
},
"devDependencies": {
"@nestjs/cli": "^9.1.5",
"@types/chai": "^4.3.4",
"@types/express": "^4.17.14",
"@types/mocha": "^10.0.0",
Expand Down
5 changes: 2 additions & 3 deletions apps/queue-manager/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@impler/queue-manager",
"version": "0.1.0",
"main": "index.js",
"author": "knovator",
"license": "MIT",
"private": true,
Expand All @@ -18,8 +17,8 @@
"lint:fix": "pnpm lint -- --fix"
},
"dependencies": {
"@impler/dal": "workspace:^0.1.0",
"@impler/shared": "workspace:^0.1.0",
"@impler/dal": "^0.1.0",
"@impler/shared": "^0.1.0",
"axios": "^0.26.1",
"dotenv": "^16.0.2",
"envalid": "^7.3.1"
Expand Down
6 changes: 4 additions & 2 deletions apps/widget-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "@impler/widget-demo",
"private": true,
"version": "0.1.0",
"author": "knovator",
"license": "MIT",
"private": true,
"type": "module",
"scripts": {
"start": "vite",
Expand All @@ -11,7 +13,7 @@
"preview": "vite preview"
},
"dependencies": {
"@impler/react": "workspace:^0.1.0",
"@impler/react": "^0.1.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
Expand Down
29 changes: 29 additions & 0 deletions apps/widget/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Recreate config file
rm -rf ./env-config.js
touch ./env-config.js

# Add assignment
echo "window._env_ = {" >> ./env-config.js

# Read each line in .env file
# Each line represents key=value pairs
while read -r line || [[ -n "$line" ]];
do
# Split env variables by character `=`
if printf '%s\n' "$line" | grep -q -e '='; then
varname=$(printf '%s\n' "$line" | sed -e 's/=.*//')
varvalue=$(printf '%s\n' "$line" | sed -e 's/^[^=]*=//')
fi

# Read value of current variable if exists as Environment variable
value=$(printf '%s\n' "${!varname}")
# Otherwise use value from .env file
[[ -z $value ]] && value=${varvalue}

# Append configuration property to JS file
echo " $varname: \"$value\"," >> ./env-config.js
done < .env

echo "}" >> ./env-config.js
13 changes: 10 additions & 3 deletions apps/widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"name": "@impler/widget",
"version": "0.1.0",
"author": "knovator",
"license": "MIT",
"private": true,
"scripts": {
"start": "cross-env PORT=3500 BROWSER=none craco start",
Expand All @@ -12,7 +14,11 @@
"eject": "craco eject",
"lint": "eslint src",
"storybook": "start-storybook -p 6006 -s public",
"build-storybook": "build-storybook -s public"
"build-storybook": "build-storybook -s public",
"envsetup": "chmod +x ./env.sh && ./env.sh && mv env-config.js ./public/env-config.js",
"envsetup:docker": "chmod +x ./env.sh && ./env.sh && mv ./env-config.js ./build/env-config.js",
"start:static:build": "pnpm envsetup:docker && http-server build -p 4500 --proxy http://localhost:4500?",
"start:docker": "pnpm build && pnpm start:static:build"
},
"browserslist": {
"production": [
Expand All @@ -34,8 +40,8 @@
"dependencies": {
"@craco/craco": "^6.4.5",
"@emotion/react": "^11.10.5",
"@impler/client": "workspace:^0.1.0",
"@impler/shared": "workspace:^0.1.0",
"@impler/client": "^0.1.0",
"@impler/shared": "^0.1.0",
"@mantine/core": "^5.6.3",
"@mantine/dropzone": "^5.6.3",
"@mantine/notifications": "5.6.3",
Expand All @@ -45,6 +51,7 @@
"axios": "^0.26.1",
"cross-env": "^7.0.3",
"file-saver": "^2.0.5",
"http-server": "^14.1.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.39.1",
Expand Down
6 changes: 2 additions & 4 deletions libs/dal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@impler/dal",
"version": "0.1.0",
"description": "",
"author": "knovator",
"license": "MIT",
"private": true,
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -15,9 +16,6 @@
"lint": "eslint src",
"lint:fix": "eslint src --fix"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"class-transformer": "^0.5.1",
"mongoose": "^6.6.1",
Expand Down
13 changes: 4 additions & 9 deletions libs/embed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
"name": "@impler/embed",
"version": "0.1.0",
"private": true,
"description": "",
"keywords": [],
"license": "MIT",
"author": "knovator",
"main": "dist/embed.umd.min.js",
"module": "dist/embed.es5.min.js",
"typings": "dist/types/embed.d.ts",
"files": ["dist"],
"repository": {
"type": "git",
"url": ""
},
"scripts": {
"lint": "eslint src",
"lint:fix": "pnpm lint --fix",
Expand All @@ -21,12 +16,11 @@
"build:dev": "tsc && cross-env ENVIRONMENT=dev rollup -c rollup.config.js -w",
"build:prod": "tsc && cross-env ENVIRONMENT=production rollup -c rollup.config.js",
"start:dev": "node index.js",
"start:docker": "pnpm build && node index.js",
"start:docker": "node index.js",
"start": "node index.js",
"dev": "concurrently \"pnpm build:dev\" \"pnpm start:dev\"",
"precommit": "lint-staged"
},
"license": "MIT",
"engines": {
"node": ">=6.0.0"
},
Expand All @@ -47,6 +41,7 @@
"@rollup/plugin-json": "^5.0.1",
"@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-replace": "^5.0.0",
"@rollup/plugin-typescript": "^9.0.1",
"@types/lodash.camelcase": "^4.3.7",
"@types/node": "^18.7.18",
"concurrently": "^7.4.0",
Expand Down
17 changes: 12 additions & 5 deletions libs/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"name": "@impler/shared",
"version": "0.1.0",
"description": "",
"private": true,
"main": "dist/index.js",
"description": "Reusable types and classes to shared between apps and libraries",
"license": "MIT",
"author": "knovator",
"repository": "https://github.com/knovator/impler.io",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"keywords": ["impler", "knovator", "chavda-bhavik"],
"files": ["dist", "package.json"],
"scripts": {
"start": "npm run start:dev",
"preinstall": "pnpm build",
Expand All @@ -16,14 +20,17 @@
"lint": "eslint src",
"lint:fix": "pnpm lint -- --fix"
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@types/node": "^18.7.18",
"rimraf": "^3.0.2",
"typescript": "^4.8.3"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.185.0",
"axios": "^0.26.1",
"rimraf": "^3.0.2"
"axios": "^0.26.1"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": ["prettier --ignore-path .eslintignore --write"],
Expand Down
32 changes: 18 additions & 14 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
"name": "@impler/client",
"version": "0.1.0",
"repository": "https://github.com/knovator/impler.io",
"description": "API client to be used in end user environments",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"author": "knovator",
"repository": "https://github.com/knovator/impler.io",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"keywords": [
"impler"
"impler",
"knovator",
"chavda-bhavik"
],
"files": [
"dist",
"package.json"
],
"scripts": {
"start": "npm run start:dev",
Expand All @@ -28,23 +35,20 @@
"publishConfig": {
"access": "public"
},
"engines": {
"node": ">=10"
},
"devDependencies": {
"@types/node": "^18.11.9",
"rimraf": "^3.0.2",
"typedoc": "^0.23.20",
"typescript": "4.8.4"
},
"prettier": {
"singleQuote": true
},
"files": [
"dist"
],
"dependencies": {
"@impler/shared": "workspace:^0.1.0",
"@impler/shared": "^0.1.0",
"axios": "^0.26.1"
},
"engines": {
"node": ">=10"
},
"prettier": {
"singleQuote": true
}
}
28 changes: 20 additions & 8 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
{
"name": "@impler/react",
"version": "0.1.0",
"description": "React library to show widget in client applications",
"license": "MIT",
"author": "knovator",
"repository": "https://github.com/knovator/impler.io",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"keywords": [
"impler",
"knovator",
"chavda-bhavik"
],
"files": [
"dist",
"package.json"
],
"scripts": {
"lint": "eslint src",
"lint:fix": "pnpm lint --fix",
Expand All @@ -10,16 +26,12 @@
"build": "rollup -c",
"build:watch": "rollup -c -w"
},
"license": "MIT",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"peerDependencies": {
"react": ">=16.8.0"
},
"types": "dist/index.d.ts",
"devDependencies": {
"@babel/core": "^7.19.6",
"@rollup/plugin-commonjs": "^23.0.1",
Expand All @@ -38,7 +50,7 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@impler/shared": "workspace:^0.1.0",
"@impler/shared": "^0.1.0",
"styled-components": "^5.3.6"
}
}
Loading

0 comments on commit 3507034

Please sign in to comment.