diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 43b3baec..e9af4e8e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,12 +10,22 @@ 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: | + cd packages/repluggable git reset --hard echo yarn version "0.0.0-pr$PR_ID.$BUILD_NUMBER" yarn version "0.0.0-pr$PR_ID.$BUILD_NUMBER" @@ -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 npm publish --tag "pr$PR_ID.$BUILD_NUMBER" env: NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6616497..fd390e5c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: yarnVersionArgs: description: 'Arguments for "yarn version"' required: true - default: '--patch' + default: 'patch' jobs: publish: @@ -29,11 +29,11 @@ jobs: env: GH_EMAIL: ${{secrets.GH_EMAIL}} GH_USER: ${{secrets.GH_USER}} - + - name: Bump version run: | git reset --hard - yarn version --no-git-tag-version ${{ github.event.inputs.yarnVersionArgs }} + 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] yarn build @@ -45,7 +45,7 @@ jobs: git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY" --tags env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - + - name: npm publish run: | npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..fb7f2353 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN} diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index ccb23a50..850fc39a 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/.yarnversion b/.yarnversion deleted file mode 100644 index 71f7f51d..00000000 --- a/.yarnversion +++ /dev/null @@ -1 +0,0 @@ -1.22 diff --git a/package.json b/package.json index c4772aba..348045ff 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,8 @@ { - "name": "repluggable", - "version": "1.302.60", + "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": "responsive-feds@wix.com" @@ -14,63 +11,19 @@ "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" - }, - "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" + "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" }, "resolutions": { "node-forge": "^1.0.0" @@ -87,3 +40,4 @@ }, "packageManager": "yarn@4.6.0" } + diff --git a/packages/repluggable-core/package.json b/packages/repluggable-core/package.json new file mode 100644 index 00000000..ca179b29 --- /dev/null +++ b/packages/repluggable-core/package.json @@ -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": "responsive-feds@wix.com" + }, + "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" + } +} diff --git a/packages/repluggable-core/src/index.js b/packages/repluggable-core/src/index.js new file mode 100644 index 00000000..45b1160e --- /dev/null +++ b/packages/repluggable-core/src/index.js @@ -0,0 +1 @@ +const x = 1 \ No newline at end of file diff --git a/__tests__/spec-setup.js b/packages/repluggable/__tests__/spec-setup.js similarity index 100% rename from __tests__/spec-setup.js rename to packages/repluggable/__tests__/spec-setup.js diff --git a/jest.config.js b/packages/repluggable/jest.config.js similarity index 100% rename from jest.config.js rename to packages/repluggable/jest.config.js diff --git a/packages/repluggable/package.json b/packages/repluggable/package.json new file mode 100644 index 00000000..c4772aba --- /dev/null +++ b/packages/repluggable/package.json @@ -0,0 +1,89 @@ +{ + "name": "repluggable", + "version": "1.302.60", + "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": "responsive-feds@wix.com" + }, + "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", + "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" + }, + "resolutions": { + "node-forge": "^1.0.0" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "(src|test|testKit)/**/*.{ts,tsx}": [ + "tslint --project . --fix" + ] + }, + "packageManager": "yarn@4.6.0" +} diff --git a/src/API.ts b/packages/repluggable/src/API.ts similarity index 100% rename from src/API.ts rename to packages/repluggable/src/API.ts diff --git a/src/IterableWeakMap.ts b/packages/repluggable/src/IterableWeakMap.ts similarity index 100% rename from src/IterableWeakMap.ts rename to packages/repluggable/src/IterableWeakMap.ts diff --git a/src/appHost.tsx b/packages/repluggable/src/appHost.tsx similarity index 100% rename from src/appHost.tsx rename to packages/repluggable/src/appHost.tsx diff --git a/src/appHostServices.ts b/packages/repluggable/src/appHostServices.ts similarity index 100% rename from src/appHostServices.ts rename to packages/repluggable/src/appHostServices.ts diff --git a/src/appHostUtils.ts b/packages/repluggable/src/appHostUtils.ts similarity index 100% rename from src/appHostUtils.ts rename to packages/repluggable/src/appHostUtils.ts diff --git a/src/appMainView.tsx b/packages/repluggable/src/appMainView.tsx similarity index 100% rename from src/appMainView.tsx rename to packages/repluggable/src/appMainView.tsx diff --git a/src/connectWithShell.tsx b/packages/repluggable/src/connectWithShell.tsx similarity index 100% rename from src/connectWithShell.tsx rename to packages/repluggable/src/connectWithShell.tsx diff --git a/src/errorBoundary.tsx b/packages/repluggable/src/errorBoundary.tsx similarity index 100% rename from src/errorBoundary.tsx rename to packages/repluggable/src/errorBoundary.tsx diff --git a/src/extensionSlot.ts b/packages/repluggable/src/extensionSlot.ts similarity index 100% rename from src/extensionSlot.ts rename to packages/repluggable/src/extensionSlot.ts diff --git a/src/hot.ts b/packages/repluggable/src/hot.ts similarity index 100% rename from src/hot.ts rename to packages/repluggable/src/hot.ts diff --git a/src/index.ts b/packages/repluggable/src/index.ts similarity index 100% rename from src/index.ts rename to packages/repluggable/src/index.ts diff --git a/src/installedShellsState.ts b/packages/repluggable/src/installedShellsState.ts similarity index 100% rename from src/installedShellsState.ts rename to packages/repluggable/src/installedShellsState.ts diff --git a/src/interceptAnyObject.ts b/packages/repluggable/src/interceptAnyObject.ts similarity index 100% rename from src/interceptAnyObject.ts rename to packages/repluggable/src/interceptAnyObject.ts diff --git a/src/interceptEntryPoints.ts b/packages/repluggable/src/interceptEntryPoints.ts similarity index 100% rename from src/interceptEntryPoints.ts rename to packages/repluggable/src/interceptEntryPoints.ts diff --git a/src/invokeSlotCallbacks.ts b/packages/repluggable/src/invokeSlotCallbacks.ts similarity index 100% rename from src/invokeSlotCallbacks.ts rename to packages/repluggable/src/invokeSlotCallbacks.ts diff --git a/src/loggers.ts b/packages/repluggable/src/loggers.ts similarity index 100% rename from src/loggers.ts rename to packages/repluggable/src/loggers.ts diff --git a/src/monitorAPI.ts b/packages/repluggable/src/monitorAPI.ts similarity index 100% rename from src/monitorAPI.ts rename to packages/repluggable/src/monitorAPI.ts diff --git a/src/propsDeepEqual.tsx b/packages/repluggable/src/propsDeepEqual.tsx similarity index 100% rename from src/propsDeepEqual.tsx rename to packages/repluggable/src/propsDeepEqual.tsx diff --git a/src/renderSlotComponents.tsx b/packages/repluggable/src/renderSlotComponents.tsx similarity index 100% rename from src/renderSlotComponents.tsx rename to packages/repluggable/src/renderSlotComponents.tsx diff --git a/src/repluggableAppDebug/debug.d.ts b/packages/repluggable/src/repluggableAppDebug/debug.d.ts similarity index 100% rename from src/repluggableAppDebug/debug.d.ts rename to packages/repluggable/src/repluggableAppDebug/debug.d.ts diff --git a/src/repluggableAppDebug/index.ts b/packages/repluggable/src/repluggableAppDebug/index.ts similarity index 100% rename from src/repluggableAppDebug/index.ts rename to packages/repluggable/src/repluggableAppDebug/index.ts diff --git a/src/repluggableAppDebug/performanceDebugInfo.ts b/packages/repluggable/src/repluggableAppDebug/performanceDebugInfo.ts similarity index 100% rename from src/repluggableAppDebug/performanceDebugInfo.ts rename to packages/repluggable/src/repluggableAppDebug/performanceDebugInfo.ts diff --git a/src/repluggableAppDebug/repluggableAppDebug.ts b/packages/repluggable/src/repluggableAppDebug/repluggableAppDebug.ts similarity index 100% rename from src/repluggableAppDebug/repluggableAppDebug.ts rename to packages/repluggable/src/repluggableAppDebug/repluggableAppDebug.ts diff --git a/src/shellContext.ts b/packages/repluggable/src/shellContext.ts similarity index 100% rename from src/shellContext.ts rename to packages/repluggable/src/shellContext.ts diff --git a/src/storeContext.ts b/packages/repluggable/src/storeContext.ts similarity index 100% rename from src/storeContext.ts rename to packages/repluggable/src/storeContext.ts diff --git a/src/tarjanGraph.ts b/packages/repluggable/src/tarjanGraph.ts similarity index 100% rename from src/tarjanGraph.ts rename to packages/repluggable/src/tarjanGraph.ts diff --git a/src/throttledStore.tsx b/packages/repluggable/src/throttledStore.tsx similarity index 100% rename from src/throttledStore.tsx rename to packages/repluggable/src/throttledStore.tsx diff --git a/test/IterableWeakMap.spec.ts b/packages/repluggable/test/IterableWeakMap.spec.ts similarity index 100% rename from test/IterableWeakMap.spec.ts rename to packages/repluggable/test/IterableWeakMap.spec.ts diff --git a/test/appHost.mock.ts b/packages/repluggable/test/appHost.mock.ts similarity index 100% rename from test/appHost.mock.ts rename to packages/repluggable/test/appHost.mock.ts diff --git a/test/appHost.spec.ts b/packages/repluggable/test/appHost.spec.ts similarity index 100% rename from test/appHost.spec.ts rename to packages/repluggable/test/appHost.spec.ts diff --git a/test/connectWithShell.spec.tsx b/packages/repluggable/test/connectWithShell.spec.tsx similarity index 100% rename from test/connectWithShell.spec.tsx rename to packages/repluggable/test/connectWithShell.spec.tsx diff --git a/test/customExtensionSlot.spec.ts b/packages/repluggable/test/customExtensionSlot.spec.ts similarity index 100% rename from test/customExtensionSlot.spec.ts rename to packages/repluggable/test/customExtensionSlot.spec.ts diff --git a/test/errorBoundary.spec.tsx b/packages/repluggable/test/errorBoundary.spec.tsx similarity index 100% rename from test/errorBoundary.spec.tsx rename to packages/repluggable/test/errorBoundary.spec.tsx diff --git a/test/extensionSlot.spec.ts b/packages/repluggable/test/extensionSlot.spec.ts similarity index 100% rename from test/extensionSlot.spec.ts rename to packages/repluggable/test/extensionSlot.spec.ts diff --git a/test/installedShellsState.spec.ts b/packages/repluggable/test/installedShellsState.spec.ts similarity index 100% rename from test/installedShellsState.spec.ts rename to packages/repluggable/test/installedShellsState.spec.ts diff --git a/test/interceptAnyObject.spec.ts b/packages/repluggable/test/interceptAnyObject.spec.ts similarity index 100% rename from test/interceptAnyObject.spec.ts rename to packages/repluggable/test/interceptAnyObject.spec.ts diff --git a/test/interceptEntryPoints.spec.ts b/packages/repluggable/test/interceptEntryPoints.spec.ts similarity index 100% rename from test/interceptEntryPoints.spec.ts rename to packages/repluggable/test/interceptEntryPoints.spec.ts diff --git a/test/loggers.spec.ts b/packages/repluggable/test/loggers.spec.ts similarity index 100% rename from test/loggers.spec.ts rename to packages/repluggable/test/loggers.spec.ts diff --git a/test/propsDeepEqual.spec.tsx b/packages/repluggable/test/propsDeepEqual.spec.tsx similarity index 100% rename from test/propsDeepEqual.spec.tsx rename to packages/repluggable/test/propsDeepEqual.spec.tsx diff --git a/test/renderSlotComponents.spec.tsx b/packages/repluggable/test/renderSlotComponents.spec.tsx similarity index 100% rename from test/renderSlotComponents.spec.tsx rename to packages/repluggable/test/renderSlotComponents.spec.tsx diff --git a/test/repluggableAppDebug.spec.ts b/packages/repluggable/test/repluggableAppDebug.spec.ts similarity index 100% rename from test/repluggableAppDebug.spec.ts rename to packages/repluggable/test/repluggableAppDebug.spec.ts diff --git a/test/testKit.spec.tsx b/packages/repluggable/test/testKit.spec.tsx similarity index 100% rename from test/testKit.spec.tsx rename to packages/repluggable/test/testKit.spec.tsx diff --git a/test/tryTypings.ts b/packages/repluggable/test/tryTypings.ts similarity index 100% rename from test/tryTypings.ts rename to packages/repluggable/test/tryTypings.ts diff --git a/testKit/emptyLoggerOptions.ts b/packages/repluggable/testKit/emptyLoggerOptions.ts similarity index 100% rename from testKit/emptyLoggerOptions.ts rename to packages/repluggable/testKit/emptyLoggerOptions.ts diff --git a/testKit/index.tsx b/packages/repluggable/testKit/index.tsx similarity index 100% rename from testKit/index.tsx rename to packages/repluggable/testKit/index.tsx diff --git a/testKit/mockPackage.ts b/packages/repluggable/testKit/mockPackage.ts similarity index 100% rename from testKit/mockPackage.ts rename to packages/repluggable/testKit/mockPackage.ts diff --git a/testKit/package.json b/packages/repluggable/testKit/package.json similarity index 100% rename from testKit/package.json rename to packages/repluggable/testKit/package.json diff --git a/testKit/withConsoleErrors.ts b/packages/repluggable/testKit/withConsoleErrors.ts similarity index 100% rename from testKit/withConsoleErrors.ts rename to packages/repluggable/testKit/withConsoleErrors.ts diff --git a/testKit/withThrowOnError.ts b/packages/repluggable/testKit/withThrowOnError.ts similarity index 100% rename from testKit/withThrowOnError.ts rename to packages/repluggable/testKit/withThrowOnError.ts diff --git a/packages/repluggable/tsconfig.json b/packages/repluggable/tsconfig.json new file mode 100644 index 00000000..6acbaa92 --- /dev/null +++ b/packages/repluggable/tsconfig.json @@ -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" + ] +} diff --git a/webpack.base.config.js b/packages/repluggable/webpack.base.config.js similarity index 100% rename from webpack.base.config.js rename to packages/repluggable/webpack.base.config.js diff --git a/webpack.dev.config.js b/packages/repluggable/webpack.dev.config.js similarity index 100% rename from webpack.dev.config.js rename to packages/repluggable/webpack.dev.config.js diff --git a/webpack.local.config.js b/packages/repluggable/webpack.local.config.js similarity index 100% rename from webpack.local.config.js rename to packages/repluggable/webpack.local.config.js diff --git a/webpack.prod.config.js b/packages/repluggable/webpack.prod.config.js similarity index 100% rename from webpack.prod.config.js rename to packages/repluggable/webpack.prod.config.js diff --git a/yarn.lock b/yarn.lock index 32bbfd97..94abe746 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7557,9 +7557,21 @@ __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:." + 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"