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
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
# Trigger the workflow on push or pull request,
|
||||
# but only for the master branch
|
||||
|
@ -135,15 +139,39 @@ jobs:
|
|||
with:
|
||||
submodules: true
|
||||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
|
||||
fetch-depth: 0
|
||||
- name: Check submodule
|
||||
|
||||
- name: Check pro commit
|
||||
id: get_pro_commits
|
||||
run: |
|
||||
cd packages/pro
|
||||
git fetch
|
||||
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"
|
||||
echo "Refer to the pro repo to merge your changes: https://github.com/Budibase/budibase-pro/blob/develop/docs/getting_started.md"
|
||||
exit 1
|
||||
pro_commit=$(git rev-parse HEAD)
|
||||
|
||||
branch=${{ github.base_ref || github.ref_name }}
|
||||
echo "Running on branch `$branch` (base_ref=${{ github.base_ref }}, ref_name=${{ github.head_ref }})"
|
||||
|
||||
if [[ "$branch" == "master" ]]; then
|
||||
base_commit=$(git rev-parse origin/master)
|
||||
else
|
||||
echo "All good, the submodule had been merged!"
|
||||
base_commit=$(git rev-parse origin/develop)
|
||||
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",
|
||||
"npmClient": "yarn",
|
||||
"packages": ["packages/*"],
|
||||
"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": {
|
||||
"publish": {
|
||||
"ignoreChanges": [
|
||||
|
@ -31,4 +17,4 @@
|
|||
"loadEnvFiles": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
14
package.json
14
package.json
|
@ -95,19 +95,7 @@
|
|||
},
|
||||
"workspaces": {
|
||||
"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"
|
||||
"packages/*"
|
||||
]
|
||||
},
|
||||
"resolutions": {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit f4b8449aac9bd265214396afbdce7ff984a2ae34
|
||||
Subproject commit 2c9172685cdceef03172bea779e94cb52ff6d1de
|
|
@ -21,9 +21,8 @@ const baseConfig: Config.InitialProjectOptions = {
|
|||
}
|
||||
|
||||
// add pro sources if they exist
|
||||
if (fs.existsSync("../pro/packages")) {
|
||||
baseConfig.moduleNameMapper!["@budibase/pro"] =
|
||||
"<rootDir>/../pro/packages/pro/src"
|
||||
if (fs.existsSync("../pro/src")) {
|
||||
baseConfig.moduleNameMapper!["@budibase/pro"] = "<rootDir>/../pro/src"
|
||||
}
|
||||
|
||||
const config: Config.InitialOptions = {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"watch": ["src", "../backend-core", "../pro/packages/pro"],
|
||||
"watch": ["src", "../backend-core", "../pro"],
|
||||
"ext": "js,ts,json",
|
||||
"ignore": [
|
||||
"src/**/*.spec.ts",
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"@budibase/backend-core": ["../backend-core/src"],
|
||||
"@budibase/backend-core/*": ["../backend-core/*"],
|
||||
"@budibase/shared-core": ["../shared-core/src"],
|
||||
"@budibase/pro": ["../pro/packages/pro/src"]
|
||||
"@budibase/pro": ["../pro/src"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
|
|
|
@ -21,11 +21,9 @@ const config: Config.InitialOptions = {
|
|||
}
|
||||
|
||||
// add pro sources if they exist
|
||||
if (fs.existsSync("../pro/packages")) {
|
||||
config.moduleNameMapper!["@budibase/pro/(.*)"] =
|
||||
"<rootDir>/../pro/packages/pro/$1"
|
||||
config.moduleNameMapper!["@budibase/pro"] =
|
||||
"<rootDir>/../pro/packages/pro/src"
|
||||
if (fs.existsSync("../pro/src")) {
|
||||
config.moduleNameMapper!["@budibase/pro/(.*)"] = "<rootDir>/../pro/$1"
|
||||
config.moduleNameMapper!["@budibase/pro"] = "<rootDir>/../pro/src"
|
||||
}
|
||||
|
||||
export default config
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"watch": ["src", "../backend-core", "../pro/packages/pro"],
|
||||
"watch": ["src", "../backend-core", "../pro"],
|
||||
"ext": "js,ts,json",
|
||||
"ignore": [
|
||||
"src/**/*.spec.ts",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"@budibase/backend-core": ["../backend-core/src"],
|
||||
"@budibase/backend-core/*": ["../backend-core/*"],
|
||||
"@budibase/shared-core": ["../shared-core/src"],
|
||||
"@budibase/pro": ["../pro/packages/pro/src"]
|
||||
"@budibase/pro": ["../pro/src"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if [ -d "packages/pro/packages" ]; then
|
||||
if [ -d "packages/pro/src" ]; then
|
||||
cd packages/pro
|
||||
|
||||
yarn
|
||||
|
|
|
@ -34,7 +34,7 @@ yarn unlink
|
|||
yarn link
|
||||
cd -
|
||||
|
||||
if [ -d packages/pro/packages ]; then
|
||||
if [ -d packages/pro/src ]; then
|
||||
pro_loaded_locally=true
|
||||
else
|
||||
pro_loaded_locally=false
|
||||
|
@ -42,7 +42,7 @@ fi
|
|||
|
||||
if [ $pro_loaded_locally = true ]; then
|
||||
echo "Linking pro"
|
||||
cd packages/pro/packages/pro
|
||||
cd packages/pro
|
||||
yarn unlink
|
||||
yarn link
|
||||
cd -
|
||||
|
|
|
@ -3,7 +3,7 @@ const path = require("path")
|
|||
const { execSync } = require("child_process")
|
||||
|
||||
let version = "0.0.0"
|
||||
const localPro = fs.existsSync("packages/pro/packages")
|
||||
const localPro = fs.existsSync("packages/pro/src")
|
||||
if (!localPro) {
|
||||
const branchName = execSync("git rev-parse --abbrev-ref HEAD")
|
||||
.toString()
|
||||
|
|
|
@ -13523,6 +13523,11 @@ humanize-ms@^1.2.0, humanize-ms@^1.2.1:
|
|||
dependencies:
|
||||
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:
|
||||
version "8.0.3"
|
||||
resolved "https://registry.yarnpkg.com/husky/-/husky-8.0.3.tgz#4936d7212e46d1dea28fef29bb3a108872cd9184"
|
||||
|
|
Loading…
Reference in New Issue