Skip to content

Commit

Permalink
refactor: files structure (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
notdanilo authored Dec 6, 2024
1 parent c22a97c commit 2420d0e
Show file tree
Hide file tree
Showing 64 changed files with 417 additions and 154 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/publish-bolt-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ jobs:
run: |
# Fails if versions are not aligned
cargo install [email protected] --locked
./version-align.sh --check
./scripts/version-align.sh --check
- name: run build
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
cargo install --path cli --force --locked
cargo install --path crates/bolt-cli --force --locked
bolt build
- name: Generate lib
Expand All @@ -175,7 +175,7 @@ jobs:
- name: run tests
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
cargo install --path cli --force --locked
cargo install --path crates/bolt-cli --force --locked
bolt test
- name: cargo publish
Expand All @@ -201,12 +201,12 @@ jobs:
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/delegate/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-helpers/attribute/system-template/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-helpers/attribute/world-apply/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-system/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-component/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=programs/world/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=crates/programs/bolt-system/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=crates/programs/bolt-component/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=crates/programs/world/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
if [ "${DRY_RUN}" != "true" ]; then
cargo publish --manifest-path=cli/Cargo.toml --token $CRATES_TOKEN
cargo publish --manifest-path=crates/bolt-cli/Cargo.toml --token $CRATES_TOKEN
fi
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-bolt-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ jobs:
run: |
# Fails if versions are not aligned
cargo install [email protected] --locked
./version-align.sh --check
./scripts/version-align.sh --check
- name: run build
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
cargo install --path cli --force --locked
cargo install --path crates/bolt-cli --force --locked
bolt build
- name: Generate lib
Expand All @@ -175,7 +175,7 @@ jobs:
- name: run tests
run: |
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
cargo install --path cli --force --locked
cargo install --path crates/bolt-cli --force --locked
bolt test
- name: npm publish
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ jobs:
with:
use-cross: true
command: build
args: --manifest-path=cli/Cargo.toml --release --locked --target ${{ matrix.build.TARGET }}
args: --manifest-path=crates/bolt-cli/Cargo.toml --release --locked --target ${{ matrix.build.TARGET }}

- name: Build (windows)
if: matrix.build.OS == 'windows-latest'
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path=cli/Cargo.toml --no-default-features --release --locked --target ${{ matrix.build.TARGET }}
args: --manifest-path=crates/bolt-cli/Cargo.toml --no-default-features --release --locked --target ${{ matrix.build.TARGET }}

- name: Check versions are aligned
run: |
# Fails if versions are not aligned
cargo install [email protected] --locked
./version-align.sh --check
./scripts/version-align.sh --check
- name: Build the NPM package
shell: bash
Expand All @@ -136,7 +136,7 @@ jobs:
# create the package directory
mkdir -p "${node_pkg}/bin"
# generate package.json from the template
envsubst < cli/npm-package/package.json.tmpl > "${node_pkg}/package.json"
envsubst < crates/bolt-cli/npm-package/package.json.tmpl > "${node_pkg}/package.json"
cat "${node_pkg}/package.json"
# copy the binary into the package
# note: windows binaries has '.exe' extension
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Run Build and Tests
run: |
cargo install --path cli --force --locked
cargo install --path crates/bolt-cli --force --locked
yarn install
bolt build
cd clients/bolt-sdk
Expand Down
11 changes: 10 additions & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ cluster = "Localnet"
wallet = "./tests/fixtures/provider.json"

[workspace]
members = ["programs/bolt-component", "programs/bolt-system", "programs/world", "examples/component-position", "examples/component-velocity", "examples/system-apply-velocity", "examples/system-fly", "examples/system-simple-movement"]
members = [
"crates/programs/bolt-component",
"crates/programs/bolt-system",
"crates/programs/world",
"examples/component-position",
"examples/component-velocity",
"examples/system-apply-velocity",
"examples/system-fly",
"examples/system-simple-movement"
]

[scripts]
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/bolt.ts"
Expand Down
Loading

0 comments on commit 2420d0e

Please sign in to comment.