Skip to content

Commit 6c7e9dc

Browse files
authored
Implement new 3D primitives for React in the @playcanvas/blocks package (#142)
* Implement new 3D primitives for React in the @playcanvas/blocks package - Introduced a new package for high-level 3D primitives, including components like SplatViewer, Controls, and various UI elements (Button, Card, Dialog, etc.). - Updated package.json and package-lock.json to include new dependencies and devDependencies. - Enhanced the SplatViewer with improved camera controls and UI interactions. - Added comprehensive documentation for the new components and their usage. - Removed unused components and streamlined the project structure for better maintainability. These changes significantly enhance the functionality and usability of the PlayCanvas React library, providing developers with powerful tools for creating immersive 3D experiences. * Update package.json build script for blocks and rename GitHub workflow job - Changed the build script for blocks in package.json to reference the correct workspace (@playcanvas/blocks). - Renamed the GitHub workflow job from 'lint' to 'publish' for clarity in the CI/CD process. * Update package.json to include publishConfig for public access - Added a publishConfig section to package.json for the blocks package, specifying public access for publishing. * Update build script for blocks in package.json to remove no-mangling option - Modified the build script for the @playcanvas/blocks workspace to simplify the build process by removing the no-mangling option, ensuring a more straightforward build configuration. * Remove package-lock.json and update package.json scripts for pnpm compatibility - Deleted package-lock.json to streamline dependency management. - Updated scripts in package.json to utilize pnpm for workspace commands, enhancing build and development processes. - Adjusted dependencies in blocks and docs package.json files to ensure proper workspace linking and compatibility. * Add pnpm support and update workflows for improved CI/CD - Introduced pnpm as the package manager by adding pnpm-lock.yaml and pnpm-workspace.yaml files. - Updated GitHub workflows to utilize pnpm for dependency installation, linting, testing, and building processes. - Enhanced documentation components by integrating the Viewer from @playcanvas/blocks and updating related MDX files. - Adjusted package.json scripts in the lib package to ensure proper build execution during publish and post-installation. * Update workflows and package.json scripts for improved testing and publishing - Modified the test script in package.json to remove the '--if-present' flag for consistency. - Updated the GitHub workflows to change the library build step from 'build:lib' to 'build:blocks' for better clarity. - Adjusted the publish workflow to utilize 'pnpm dlx' for the publish command, enhancing the publishing process.
1 parent b94e722 commit 6c7e9dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+13592
-23564
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,24 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 9.x
23+
1924
- name: Use Node.js
2025
uses: actions/setup-node@v4
2126
with:
2227
node-version: '22.x'
23-
cache: 'npm'
28+
cache: 'pnpm'
2429

2530
- name: Install dependencies
26-
run: npm ci
31+
run: pnpm install
2732

2833
- name: Build library
29-
run: npm run build:lib
30-
31-
- name: Run tests
32-
run: npm run test:lib
34+
run: pnpm run build:lib
35+
- name: Build library
36+
run: pnpm run build:blocks
3337

3438
- name: Build docs
35-
run: npm run build:docs
39+
run: pnpm run build:docs

.github/workflows/ci.yml

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,88 @@
1-
name: Lint
1+
name: CI
22

33
on:
4+
push:
5+
branches: [main]
46
pull_request:
57
branches: [main]
68

79
jobs:
810
lint:
911
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v4
17+
with:
18+
version: 9.x
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 22.x
24+
cache: 'pnpm'
25+
26+
- name: Install Dependencies
27+
run: pnpm install
1028

29+
- name: Lint
30+
run: pnpm run lint
31+
32+
test:
33+
needs: lint
34+
runs-on: ubuntu-latest
1135
steps:
12-
- name: Cancel Previous Runs
13-
uses: styfle/[email protected]
36+
- uses: actions/checkout@v4
37+
38+
- name: Setup pnpm
39+
uses: pnpm/action-setup@v4
40+
with:
41+
version: 9.x
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: 22.x
47+
cache: 'pnpm'
48+
49+
- name: Install Dependencies
50+
run: pnpm install
51+
52+
- name: Run Tests
53+
run: pnpm test
54+
55+
- name: Upload Test Results
56+
if: always()
57+
uses: actions/upload-artifact@v4
1458
with:
15-
access_token: ${{ github.token }}
59+
name: test-results
60+
path: |
61+
packages/lib/coverage
62+
packages/lib/test-results.xml
1663
17-
- name: Checkout Main
18-
uses: actions/checkout@v4
64+
build:
65+
needs: test
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Setup pnpm
71+
uses: pnpm/action-setup@v4
72+
with:
73+
version: 9.x
1974

20-
- name: Setup Node.js 18.x
75+
- name: Setup Node.js
2176
uses: actions/setup-node@v4
2277
with:
2378
node-version: 22.x
24-
cache: 'npm'
79+
cache: 'pnpm'
2580

2681
- name: Install Dependencies
27-
run: npm i
82+
run: pnpm install
83+
84+
- name: Build Library
85+
run: pnpm run build:lib
2886

29-
- name: Lint ESLint
30-
run: npm run lint
87+
- name: Build Docs
88+
run: pnpm run build:docs

.github/workflows/publish.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [main]
66

77
jobs:
8-
lint:
8+
publish:
99
runs-on: ubuntu-latest
1010

1111
steps:
@@ -14,17 +14,22 @@ jobs:
1414
with:
1515
access_token: ${{ github.token }}
1616

17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
version: 9.x
21+
1722
- name: Checkout Main
1823
uses: actions/checkout@v4
1924

20-
- name: Setup Node.js 18.x
25+
- name: Setup Node.js
2126
uses: actions/setup-node@v4
2227
with:
2328
node-version: 22.x
24-
cache: 'npm'
29+
cache: 'pnpm'
2530

2631
- name: Install Dependencies
27-
run: npm i
32+
run: pnpm install
2833

2934
- name: Continuous Release
30-
run: npx pkg-pr-new publish './packages/lib'
35+
run: pnpm dlx pkg-pr-new publish './packages/lib'

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,22 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
with:
19+
version: 9.x
20+
1621
- name: Use Node.js
1722
uses: actions/setup-node@v4
1823
with:
1924
node-version: '22.x'
20-
cache: 'npm'
25+
cache: 'pnpm'
2126

2227
- name: Install dependencies
23-
run: npm ci
28+
run: pnpm install
2429

2530
- name: Run tests
26-
run: npm test
31+
run: pnpm test
2732

2833
- name: Upload test results
2934
if: always()

0 commit comments

Comments
 (0)