Merge pull request #10960 from Budibase/chore/refactor_pro_as_package
Remove the doble deep format references
This commit is contained in:
commit
9e43248c5e
|
@ -1,5 +1,9 @@
|
||||||
name: Budibase CI
|
name: Budibase CI
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Trigger the workflow on push or pull request,
|
# Trigger the workflow on push or pull request,
|
||||||
# but only for the master branch
|
# but only for the master branch
|
||||||
|
@ -135,15 +139,39 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
|
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
|
||||||
fetch-depth: 0
|
|
||||||
- name: Check submodule
|
- name: Check pro commit
|
||||||
|
id: get_pro_commits
|
||||||
run: |
|
run: |
|
||||||
cd packages/pro
|
cd packages/pro
|
||||||
git fetch
|
pro_commit=$(git rev-parse HEAD)
|
||||||
if ! git merge-base --is-ancestor $(git log -n 1 --pretty=format:%H) origin/develop; then
|
|
||||||
echo "Current commit has not been merged to develop"
|
branch=${{ github.base_ref || github.ref_name }}
|
||||||
echo "Refer to the pro repo to merge your changes: https://github.com/Budibase/budibase-pro/blob/develop/docs/getting_started.md"
|
echo "Running on branch `$branch` (base_ref=${{ github.base_ref }}, ref_name=${{ github.head_ref }})"
|
||||||
exit 1
|
|
||||||
|
if [[ "$branch" == "master" ]]; then
|
||||||
|
base_commit=$(git rev-parse origin/master)
|
||||||
else
|
else
|
||||||
echo "All good, the submodule had been merged!"
|
base_commit=$(git rev-parse origin/develop)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "pro_commit=$pro_commit"
|
||||||
|
echo "pro_commit=$pro_commit" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "base_commit=$base_commit"
|
||||||
|
echo "base_commit=$base_commit" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Check submodule merged to develop
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
const submoduleCommit = '${{ steps.get_pro_commits.outputs.pro_commit }}';
|
||||||
|
const baseCommit = '${{ steps.get_pro_commits.outputs.base_commit }}';
|
||||||
|
|
||||||
|
if (submoduleCommit !== baseCommit) {
|
||||||
|
console.error('Submodule commit does not match the latest commit on the develop branch.');
|
||||||
|
console.error('Refer to the pro repo to merge your changes: https://github.com/Budibase/budibase-pro/blob/develop/docs/getting_started.md')
|
||||||
|
process.exit(1);
|
||||||
|
} else {
|
||||||
|
console.log('All good, the submodule had been merged and setup correctly!')
|
||||||
|
}
|
||||||
|
|
18
lerna.json
18
lerna.json
|
@ -1,22 +1,8 @@
|
||||||
{
|
{
|
||||||
"version": "2.7.26-alpha.3",
|
"version": "2.7.26-alpha.3",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
|
"packages": ["packages/*"],
|
||||||
"useNx": true,
|
"useNx": true,
|
||||||
"packages": [
|
|
||||||
"packages/backend-core",
|
|
||||||
"packages/bbui",
|
|
||||||
"packages/builder",
|
|
||||||
"packages/cli",
|
|
||||||
"packages/client",
|
|
||||||
"packages/frontend-core",
|
|
||||||
"packages/sdk",
|
|
||||||
"packages/server",
|
|
||||||
"packages/shared-core",
|
|
||||||
"packages/string-templates",
|
|
||||||
"packages/types",
|
|
||||||
"packages/worker",
|
|
||||||
"packages/pro/packages/pro"
|
|
||||||
],
|
|
||||||
"command": {
|
"command": {
|
||||||
"publish": {
|
"publish": {
|
||||||
"ignoreChanges": [
|
"ignoreChanges": [
|
||||||
|
@ -31,4 +17,4 @@
|
||||||
"loadEnvFiles": false
|
"loadEnvFiles": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
14
package.json
14
package.json
|
@ -95,19 +95,7 @@
|
||||||
},
|
},
|
||||||
"workspaces": {
|
"workspaces": {
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/backend-core",
|
"packages/*"
|
||||||
"packages/bbui",
|
|
||||||
"packages/builder",
|
|
||||||
"packages/cli",
|
|
||||||
"packages/client",
|
|
||||||
"packages/frontend-core",
|
|
||||||
"packages/sdk",
|
|
||||||
"packages/server",
|
|
||||||
"packages/shared-core",
|
|
||||||
"packages/string-templates",
|
|
||||||
"packages/types",
|
|
||||||
"packages/worker",
|
|
||||||
"packages/pro/packages/pro"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f4b8449aac9bd265214396afbdce7ff984a2ae34
|
Subproject commit 2c9172685cdceef03172bea779e94cb52ff6d1de
|
|
@ -21,9 +21,8 @@ const baseConfig: Config.InitialProjectOptions = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add pro sources if they exist
|
// add pro sources if they exist
|
||||||
if (fs.existsSync("../pro/packages")) {
|
if (fs.existsSync("../pro/src")) {
|
||||||
baseConfig.moduleNameMapper!["@budibase/pro"] =
|
baseConfig.moduleNameMapper!["@budibase/pro"] = "<rootDir>/../pro/src"
|
||||||
"<rootDir>/../pro/packages/pro/src"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const config: Config.InitialOptions = {
|
const config: Config.InitialOptions = {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"watch": ["src", "../backend-core", "../pro/packages/pro"],
|
"watch": ["src", "../backend-core", "../pro"],
|
||||||
"ext": "js,ts,json",
|
"ext": "js,ts,json",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"src/**/*.spec.ts",
|
"src/**/*.spec.ts",
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
"@budibase/backend-core": ["../backend-core/src"],
|
"@budibase/backend-core": ["../backend-core/src"],
|
||||||
"@budibase/backend-core/*": ["../backend-core/*"],
|
"@budibase/backend-core/*": ["../backend-core/*"],
|
||||||
"@budibase/shared-core": ["../shared-core/src"],
|
"@budibase/shared-core": ["../shared-core/src"],
|
||||||
"@budibase/pro": ["../pro/packages/pro/src"]
|
"@budibase/pro": ["../pro/src"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*"],
|
||||||
|
|
|
@ -21,11 +21,9 @@ const config: Config.InitialOptions = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add pro sources if they exist
|
// add pro sources if they exist
|
||||||
if (fs.existsSync("../pro/packages")) {
|
if (fs.existsSync("../pro/src")) {
|
||||||
config.moduleNameMapper!["@budibase/pro/(.*)"] =
|
config.moduleNameMapper!["@budibase/pro/(.*)"] = "<rootDir>/../pro/$1"
|
||||||
"<rootDir>/../pro/packages/pro/$1"
|
config.moduleNameMapper!["@budibase/pro"] = "<rootDir>/../pro/src"
|
||||||
config.moduleNameMapper!["@budibase/pro"] =
|
|
||||||
"<rootDir>/../pro/packages/pro/src"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default config
|
export default config
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"watch": ["src", "../backend-core", "../pro/packages/pro"],
|
"watch": ["src", "../backend-core", "../pro"],
|
||||||
"ext": "js,ts,json",
|
"ext": "js,ts,json",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"src/**/*.spec.ts",
|
"src/**/*.spec.ts",
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
"@budibase/backend-core": ["../backend-core/src"],
|
"@budibase/backend-core": ["../backend-core/src"],
|
||||||
"@budibase/backend-core/*": ["../backend-core/*"],
|
"@budibase/backend-core/*": ["../backend-core/*"],
|
||||||
"@budibase/shared-core": ["../shared-core/src"],
|
"@budibase/shared-core": ["../shared-core/src"],
|
||||||
"@budibase/pro": ["../pro/packages/pro/src"]
|
"@budibase/pro": ["../pro/src"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*"],
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
if [ -d "packages/pro/packages" ]; then
|
if [ -d "packages/pro/src" ]; then
|
||||||
cd packages/pro
|
cd packages/pro
|
||||||
|
|
||||||
yarn
|
yarn
|
||||||
|
|
|
@ -34,7 +34,7 @@ yarn unlink
|
||||||
yarn link
|
yarn link
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
if [ -d packages/pro/packages ]; then
|
if [ -d packages/pro/src ]; then
|
||||||
pro_loaded_locally=true
|
pro_loaded_locally=true
|
||||||
else
|
else
|
||||||
pro_loaded_locally=false
|
pro_loaded_locally=false
|
||||||
|
@ -42,7 +42,7 @@ fi
|
||||||
|
|
||||||
if [ $pro_loaded_locally = true ]; then
|
if [ $pro_loaded_locally = true ]; then
|
||||||
echo "Linking pro"
|
echo "Linking pro"
|
||||||
cd packages/pro/packages/pro
|
cd packages/pro
|
||||||
yarn unlink
|
yarn unlink
|
||||||
yarn link
|
yarn link
|
||||||
cd -
|
cd -
|
||||||
|
|
|
@ -3,7 +3,7 @@ const path = require("path")
|
||||||
const { execSync } = require("child_process")
|
const { execSync } = require("child_process")
|
||||||
|
|
||||||
let version = "0.0.0"
|
let version = "0.0.0"
|
||||||
const localPro = fs.existsSync("packages/pro/packages")
|
const localPro = fs.existsSync("packages/pro/src")
|
||||||
if (!localPro) {
|
if (!localPro) {
|
||||||
const branchName = execSync("git rev-parse --abbrev-ref HEAD")
|
const branchName = execSync("git rev-parse --abbrev-ref HEAD")
|
||||||
.toString()
|
.toString()
|
||||||
|
|
|
@ -13523,6 +13523,11 @@ humanize-ms@^1.2.0, humanize-ms@^1.2.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
ms "^2.0.0"
|
ms "^2.0.0"
|
||||||
|
|
||||||
|
husky@^7.0.1:
|
||||||
|
version "7.0.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.4.tgz#242048245dc49c8fb1bf0cc7cfb98dd722531535"
|
||||||
|
integrity sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==
|
||||||
|
|
||||||
husky@^8.0.3:
|
husky@^8.0.3:
|
||||||
version "8.0.3"
|
version "8.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
|
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
|
||||||
|
|
Loading…
Reference in New Issue