Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to monorepo #264

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Master Build
on:
push:
branches: [ master ]
branches: [master]

jobs:
build:
Expand All @@ -10,15 +10,16 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 20
- name: install, build, and test
run: |
yarn
yarn build
yarn test
env:
CI: true
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 20
- name: install, build, and test
run: |
yarn
cd packages/repluggable
yarn build
yarn test
env:
CI: true
18 changes: 14 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 20
- run: yarn
- run: yarn build
- run: yarn test
- name: Install dependencies
run: yarn install

- name: Build package
run: |
cd packages/repluggable
yarn build

- name: Run tests
run: |
cd packages/repluggable
yarn test

- name: Bump version
run: |
git reset --hard
cd packages/repluggable
echo yarn version "0.0.0-pr$PR_ID.$BUILD_NUMBER"
yarn version "0.0.0-pr$PR_ID.$BUILD_NUMBER"
git status -vv
Expand All @@ -30,8 +40,8 @@ jobs:

- name: npm publish
run: |
cd packages/repluggable
echo PR package tag is [pr$PR_ID.$BUILD_NUMBER]
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added .npmrc file in the root instead

npm publish --tag "pr$PR_ID.$BUILD_NUMBER"
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- name: Bump version
run: |
git reset --hard
cd packages/repluggable
yarn version ${{ github.event.inputs.yarnVersionArgs }}
export NEW_RELEASE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
echo New Release Version is: [$NEW_RELEASE_VERSION]
Expand All @@ -48,7 +49,7 @@ jobs:

- name: npm publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
cd packages/repluggable
npm publish
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't run npm set registry on a package level.
Adding this file will enable us to publish to the public npm registry without calling npm set registry in the action

1 change: 0 additions & 1 deletion .yarnversion

This file was deleted.

71 changes: 14 additions & 57 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"name": "repluggable",
"version": "1.302.61",
"name": "repluggable-monorepo",
"version": "1.0.0",
"license": "MIT",
"description": "Allows composition of a React-with-Redux application entirely from a list of pluggable packages",
"main": "dist/src/index.js",
"module": "dist/es/src/index.js",
"unpkg": true,
"author": {
"name": "Wix.com",
"email": "[email protected]"
Expand All @@ -14,63 +11,23 @@
"type": "git",
"url": "https://github.com/wix/repluggable"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"versionBumpStrategy": "patch"
},
"files": [
"*"
"workspaces": [
"packages/*"
],
"scripts": {
"start": "webpack-dev-server --hot --config webpack.local.config.js",
"build": "rm -rf dist && yarn build-cjs && yarn build-es && yarn build-bundle-dev && yarn build-bundle-prod",
"build-cjs": "tsc --outDir dist --module commonjs",
"build-es": "tsc --outDir dist/es --module esNext",
"build-bundle-dev": "webpack --config webpack.dev.config.js",
"build-bundle-prod": "webpack --config webpack.prod.config.js",
"test": "jest --coverage",
"posttest": "tslint --project .",
"lintfix": "tslint --fix --project ."
},
"dependencies": {
"react-test-renderer": "^18.0.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"tslib": "^2.0.0"
"start": "yarn workspace repluggable start",
"build": "yarn workspace repluggable build",
"build-cjs": "yarn workspace repluggable build-cjs",
"build-es": "yarn workspace repluggable build-es",
"build-bundle-dev": "yarn workspace repluggable build-bundle-dev",
"build-bundle-prod": "yarn workspace repluggable build-bundle-prod",
"test": "yarn workspace repluggable test",
"posttest": "yarn workspace repluggable posttest",
"lintfix": "yarn workspace repluggable lintfix"
},
"devDependencies": {
"@types/jest": "^26.0.15",
"@types/lodash": "^4.14.162",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@types/react-test-renderer": "^18.0.0",
"@types/webpack-env": "^1.15.3",
"case-sensitive-paths-webpack-plugin": "^2.3.0",
"husky": "^4.3.0",
"jest": "^26.6.0",
"jest-teamcity-reporter": "^0.9.0",
"lint-staged": "^10.4.2",
"lodash": "^4.17.20",
"prettier": "^2.1.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^8.0.0",
"terser-webpack-plugin": "^4.1.0",
"ts-jest": "^26.4.1",
"ts-loader": "^8.0.6",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-consistent-codestyle": "^1.16.0",
"tslint-eslint-rules": "^5.4.0",
"tslint-microsoft-contrib": "^6.2.0",
"tslint-no-unused-expression-chai": "^0.1.4",
"tslint-plugin-prettier": "^2.3.0",
"tslint-react": "^5.0.0",
"tslint-react-hooks": "^2.2.2",
"typescript": "^5.4.2",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
"lint-staged": "^10.4.2"
},
"resolutions": {
"node-forge": "^1.0.0"
Expand Down
24 changes: 24 additions & 0 deletions packages/repluggable-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "repluggable-core",
"version": "1.0.0",
"license": "MIT",
"description": "Allows composition of a React-with-Redux application entirely from a list of pluggable packages",
"main": "src/index.js",
"unpkg": true,
"author": {
"name": "Wix.com",
"email": "[email protected]"
},
"scripts": {
"build": "echo build core...",
"test": "echo test core..."
},
"repository": {
"type": "git",
"url": "https://github.com/wix/repluggable"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"versionBumpStrategy": "patch"
}
}
1 change: 1 addition & 0 deletions packages/repluggable-core/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const x = 1
File renamed without changes.
File renamed without changes.
73 changes: 73 additions & 0 deletions packages/repluggable/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "repluggable",
"version": "1.302.61",
"license": "MIT",
"description": "Allows composition of a React-with-Redux application entirely from a list of pluggable packages",
"main": "dist/src/index.js",
"module": "dist/es/src/index.js",
"unpkg": true,
"author": {
"name": "Wix.com",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/wix/repluggable"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"versionBumpStrategy": "patch"
},
"files": [
"*"
],
"scripts": {
"start": "webpack-dev-server --hot --config webpack.local.config.js",
"build": "rm -rf dist && yarn build-cjs && yarn build-es && yarn build-bundle-dev && yarn build-bundle-prod",
"build-cjs": "tsc --outDir dist --module commonjs",
"build-es": "tsc --outDir dist/es --module esNext",
"build-bundle-dev": "webpack --config webpack.dev.config.js",
"build-bundle-prod": "webpack --config webpack.prod.config.js",
"test": "jest --coverage",
"posttest": "tslint --project .",
"lintfix": "tslint --fix --project ."
},
"dependencies": {
"react-test-renderer": "^18.0.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"tslib": "^2.0.0"
},
"devDependencies": {
"@types/jest": "^26.0.15",
"@types/lodash": "^4.14.162",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@types/react-test-renderer": "^18.0.0",
"@types/webpack-env": "^1.15.3",
"case-sensitive-paths-webpack-plugin": "^2.3.0",
"jest": "^26.6.0",
"jest-teamcity-reporter": "^0.9.0",
"lodash": "^4.17.20",
"prettier": "^2.1.2",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^8.0.0",
"terser-webpack-plugin": "^4.1.0",
"ts-jest": "^26.4.1",
"ts-loader": "^8.0.6",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-consistent-codestyle": "^1.16.0",
"tslint-eslint-rules": "^5.4.0",
"tslint-microsoft-contrib": "^6.2.0",
"tslint-no-unused-expression-chai": "^0.1.4",
"tslint-plugin-prettier": "^2.3.0",
"tslint-react": "^5.0.0",
"tslint-react-hooks": "^2.2.2",
"typescript": "^5.4.2",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions packages/repluggable/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES6",
"module": "esnext",
"moduleResolution": "node",
"lib": ["dom", "esnext"],
"jsx": "react",
"declaration": true,
"declarationMap": true,
"noUnusedLocals": true,
"sourceMap": true,
"strict": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"allowUnreachableCode": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"useUnknownInCatchVariables": false
},
"include": [
"src",
"test",
"testKit"
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 17 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7557,9 +7557,24 @@ __metadata:
languageName: node
linkType: hard

"repluggable@workspace:.":
"repluggable-core@workspace:packages/repluggable-core":
version: 0.0.0-use.local
resolution: "repluggable@workspace:."
resolution: "repluggable-core@workspace:packages/repluggable-core"
languageName: unknown
linkType: soft

"repluggable-monorepo@workspace:.":
version: 0.0.0-use.local
resolution: "repluggable-monorepo@workspace:."
dependencies:
husky: "npm:^4.3.0"
lint-staged: "npm:^10.4.2"
languageName: unknown
linkType: soft

"repluggable@workspace:packages/repluggable":
version: 0.0.0-use.local
resolution: "repluggable@workspace:packages/repluggable"
dependencies:
"@types/jest": "npm:^26.0.15"
"@types/lodash": "npm:^4.14.162"
Expand All @@ -7568,10 +7583,8 @@ __metadata:
"@types/react-test-renderer": "npm:^18.0.0"
"@types/webpack-env": "npm:^1.15.3"
case-sensitive-paths-webpack-plugin: "npm:^2.3.0"
husky: "npm:^4.3.0"
jest: "npm:^26.6.0"
jest-teamcity-reporter: "npm:^0.9.0"
lint-staged: "npm:^10.4.2"
lodash: "npm:^4.17.20"
prettier: "npm:^2.1.2"
react: "npm:^18.0.0"
Expand Down