Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gltf iridescence #309

Closed
wants to merge 4 commits into from
Closed

gltf iridescence #309

wants to merge 4 commits into from

Conversation

hhhhkrx
Copy link
Contributor

@hhhhkrx hhhhkrx commented Nov 6, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

Summary by CodeRabbit

  • New Features

    • Introduced a new section for "Thin Film Iridescence" in the PBR shader, enhancing material properties with new properties and macros.
  • Version Updates

    • Updated version numbers for multiple packages from 1.3.9 to 1.4.0-alpha.1, signaling a pre-release status across the toolkit.

Copy link

coderabbitai bot commented Nov 6, 2024

Walkthrough

The pull request includes updates to the package.json files for multiple packages within the @galacean/engine-toolkit, changing their version numbers from 1.3.9 to 1.4.0-alpha.1. Additionally, the shader file PBR.gs has been modified to introduce new properties and macros related to "Thin Film Iridescence," enhancing its capabilities for rendering iridescent materials.

Changes

File Path Change Summary
packages/auxiliary-lines/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/controls/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/custom-gltf-parser/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/custom-material/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/draco/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/dynamic-bone/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/framebuffer-picker/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/galacean-engine-toolkit/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/geometry-sketch/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/gizmo/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/input-logger/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/lines/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/navigation-gizmo/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/outline/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/shaderlab/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/shaderlab/src/shaders/PBR.gs Added new properties and macros for "Thin Film Iridescence" in the shader.
packages/skeleton-viewer/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/stats/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/tween/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/way-point/package.json Version updated from 1.3.9 to 1.4.0-alpha.1
packages/xr/package.json Version updated from 1.3.9 to 1.4.0-alpha.1

Possibly related PRs

Suggested labels

enhancement, shader

Suggested reviewers

  • GuoLei1990
  • JujieX

Poem

In the garden of code, we hop and play,
With versions anew, we brighten the day.
Iridescence added, a shimmer so bright,
Our toolkit blossoms, a beautiful sight!
Hops of delight, as we code and create,
In the world of shaders, we celebrate fate! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Outside diff range and nitpick comments (7)
.github/workflows/release.yml (1)

5-16: Consider adding environment protection rules for releases

While the permissions are correctly scoped, consider enhancing security by:

  1. Adding environment protection rules for production releases
  2. Restricting the workflow to specific branches (e.g., main/master)
  3. Adding required reviewers for manual dispatches
package.json (2)

23-24: Consider enhancing the release script

The new release script using bumpp is minimal. Consider enhancing it to:

  1. Run tests before release
  2. Ensure clean working directory
  3. Generate changelog

Example enhancement:

-    "release": "bumpp -r"
+    "release": "pnpm test && pnpm build && bumpp -r && pnpm changeset"

Line range hint 1-85: Consider separating release automation from feature changes

The PR title suggests GLTF iridescence feature changes, but this file contains significant version management and release automation changes. Consider:

  1. Splitting these into separate PRs for clearer change management
  2. Documenting the rationale for the version bump from 1.2.0-beta.0 to 1.3.9
  3. Adding release notes or changelog entries describing the changes
packages/shaderlab/src/shaders/PBR.gs (2)

44-48: Document the components of material_IridescenceInfo Vector4.

While the iridescence properties are well-structured and follow the established patterns, it would be helpful to document what each component of the material_IridescenceInfo Vector4 represents (x, y, z, w) to improve maintainability and usability.


Line range hint 44-71: Consider enhancing documentation and standards compliance.

While the iridescence implementation is well-structured, consider:

  1. Adding comments or documentation explaining the thin film iridescence implementation details and equations used
  2. Verifying that the implementation aligns with standard PBR practices (e.g., glTF's KHR_materials_iridescence extension)
rollup.config.mjs (1)

159-159: Consider explicit build stages for release workflow.

While the change is correct, prioritizing UMD builds through sorting suggests a build order dependency. Consider implementing explicit build stages in your release workflow instead of relying on sort order.

This would:

  1. Make build dependencies more explicit
  2. Improve reliability of the release process
  3. Make it easier to parallelize independent builds
packages/gizmo/src/Group.ts (1)

336-342: Simplify the conditional structure

The code structure can be simplified by combining the conditions and removing the unnecessary else block.

Consider this cleaner approach:

-          if (renderer instanceof ParticleRenderer) {
-            // Ignore particle bounding box.
-            continue;
-          } else {
-            isEffective = true;
-            BoundingBox.merge(tempBoundBox, renderers[j].bounds, tempBoundBox);
-          }
+          if (!(renderer instanceof ParticleRenderer)) {
+            isEffective = true;
+            BoundingBox.merge(tempBoundBox, renderers[j].bounds, tempBoundBox);
+          }
🧰 Tools
🪛 Biome

[error] 341-341: Unnecessary continue statement

Unsafe fix: Delete the unnecessary continue statement

(lint/correctness/noUnnecessaryContinue)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 156a07a and be59c8f.

⛔ Files ignored due to path filters (6)
  • packages/shaderlab/src/shaders/Shadow.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/BRDF.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/FragmentPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/LightDirectPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/LightIndirectPBR.glsl is excluded by !**/*.glsl
  • packages/shaderlab/src/shaders/shadingPBR/ReflectionLobe.glsl is excluded by !**/*.glsl
📒 Files selected for processing (27)
  • .github/workflows/release.yml (1 hunks)
  • .npmrc (0 hunks)
  • package.json (3 hunks)
  • packages/auxiliary-lines/package.json (1 hunks)
  • packages/controls/package.json (1 hunks)
  • packages/custom-gltf-parser/package.json (1 hunks)
  • packages/custom-material/package.json (1 hunks)
  • packages/draco/package.json (1 hunks)
  • packages/dynamic-bone/package.json (1 hunks)
  • packages/framebuffer-picker/package.json (1 hunks)
  • packages/galacean-engine-toolkit/package.json (1 hunks)
  • packages/geometry-sketch/package.json (1 hunks)
  • packages/gizmo/package.json (1 hunks)
  • packages/gizmo/src/Group.ts (2 hunks)
  • packages/input-logger/package.json (1 hunks)
  • packages/lines/package.json (1 hunks)
  • packages/navigation-gizmo/package.json (1 hunks)
  • packages/outline/package.json (1 hunks)
  • packages/shaderlab/package.json (1 hunks)
  • packages/shaderlab/src/shaders/PBR.gs (2 hunks)
  • packages/skeleton-viewer/package.json (1 hunks)
  • packages/stats/package.json (1 hunks)
  • packages/tween/package.json (1 hunks)
  • packages/way-point/package.json (1 hunks)
  • packages/xr/package.json (1 hunks)
  • rollup.config.mjs (1 hunks)
  • tests/package.json (1 hunks)
💤 Files with no reviewable changes (1)
  • .npmrc
✅ Files skipped from review due to trivial changes (20)
  • packages/auxiliary-lines/package.json
  • packages/controls/package.json
  • packages/custom-gltf-parser/package.json
  • packages/custom-material/package.json
  • packages/dynamic-bone/package.json
  • packages/framebuffer-picker/package.json
  • packages/galacean-engine-toolkit/package.json
  • packages/geometry-sketch/package.json
  • packages/gizmo/package.json
  • packages/input-logger/package.json
  • packages/lines/package.json
  • packages/navigation-gizmo/package.json
  • packages/outline/package.json
  • packages/shaderlab/package.json
  • packages/skeleton-viewer/package.json
  • packages/stats/package.json
  • packages/tween/package.json
  • packages/way-point/package.json
  • packages/xr/package.json
  • tests/package.json
🧰 Additional context used
🪛 Biome
packages/gizmo/src/Group.ts

[error] 341-341: Unnecessary continue statement

Unsafe fix: Delete the unnecessary continue statement

(lint/correctness/noUnnecessaryContinue)

🪛 eslint
rollup.config.mjs

[error] 156-156: Insert ;

(prettier/prettier)


[error] 157-157: Insert ;

(prettier/prettier)

🔇 Additional comments (10)
packages/draco/package.json (2)

8-10: LGTM! Repository field addition is correct.

The repository field addition follows npm best practices and correctly points to the project repository.


3-3: Verify the significant version bump from 1.3.2 to 1.3.9

The version increment of 7 minor versions seems substantial for what appears to be a single GLTF iridescence feature. Please verify if:

  1. This includes breaking changes requiring a major version bump instead
  2. This version aligns with the scope of changes across all packages
✅ Verification successful

Let me generate additional scripts to gather more context about the changes between these versions.


Based on the verification results, I can now provide the final response:

Version bump to 1.3.9 appears to be part of coordinated release

The version bump is consistent across all packages in the monorepo, indicating this is part of a coordinated release strategy rather than an isolated change. While the increment is significant:

  • All 21 packages are being updated to version 1.3.9 in sync
  • No breaking changes were found in the commit history
  • The draco package itself shows minimal changes, suggesting it's part of the broader release cycle rather than containing major changes
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential breaking changes and verify version consistency

# Test 1: Look for breaking changes in commit history
echo "Checking for breaking changes in commit messages..."
git log --oneline | grep -i "breaking"

# Test 2: Verify version consistency across all package.json files
echo "Checking version consistency across packages..."
fd package.json --exec grep -H '"version":'

Length of output: 1541


Script:

#!/bin/bash
# Check the commit history and changes between the versions
echo "Checking commits and changes between versions..."

# Look for version bump commits
git log --oneline | grep -i "version" -A 5

# Check for changes in the draco package
echo -e "\nChecking changes in draco package..."
git log --oneline -- packages/draco/

# Look for CHANGELOG entries
echo -e "\nChecking CHANGELOG entries..."
fd CHANGELOG -t f --exec cat {}

Length of output: 433

.github/workflows/release.yml (1)

39-39: Verify the custom publish action usage

Let's verify if this custom action is used consistently across the organization's workflows.

✅ Verification successful

Custom publish action usage appears to be consistent

The gz65555/publish@v0.1.5 action is used only once in the repository's workflows, specifically in the release workflow. The action is used in a release context with proper environment configuration including NPM token and Oasis backend settings. No other publish-related actions are being used, indicating a consistent approach to publishing.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of the custom publish action across all workflow files
echo "Searching for publish action usage patterns..."
fd -e yml -e yaml . .github/workflows/ -x rg -l "uses: gz65555/publish@"

Length of output: 207


Script:

#!/bin/bash
# Let's check the specific version usage and context in the release.yml
echo "Checking publish action version and context in release.yml:"
rg -A 5 -B 5 "uses: gz65555/publish@" .github/workflows/release.yml

# Let's also check if there are any other publish-related actions being used
echo -e "\nChecking for other publish-related actions:"
rg "uses:.+publish" .github/workflows/

Length of output: 788

package.json (2)

41-41: LGTM: Appropriate dev dependency addition

The addition of bumpp as a dev dependency aligns with the new release script functionality.


3-4: Verify version bump consistency across all packages

The version bump from 1.2.0-beta.0 to 1.3.9 is significant. The addition of packageManager field is good for ensuring consistent tooling.

Let's verify version consistency across all package.json files:

✅ Verification successful

Version consistency verified across all packages

All packages within the @galacean/engine-toolkit monorepo are correctly synchronized at version 1.3.9, including:

  • Root package
  • All toolkit packages (controls, draco, gizmo, etc.)
  • Test package
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check version consistency across all package.json files
# Expected: All packages should be at version 1.3.9

echo "Checking package versions..."
find . -name "package.json" -exec jq -r '. | select(.version != null) | .name + ": " + .version' {} \;

Length of output: 4838

packages/shaderlab/src/shaders/PBR.gs (1)

69-71: LGTM! Well-structured macro definitions.

The new iridescence-related macros follow the established patterns and provide a complete set of conditional checks for the feature and its textures.

rollup.config.mjs (2)

153-154: LGTM! Good refactoring.

The extraction of configuration generation into a separate variable improves code readability and enables further processing of the configurations.


153-159: Verify integration with release workflow.

Since these changes affect build order and are part of release automation, let's verify the integration with the release workflow.

✅ Verification successful

Build configuration changes are properly integrated with release workflow

The changes to the build order in rollup.config.mjs are well-integrated with the release workflow:

  • The release workflow uses pnpm b:all which executes the full build process including the modified rollup configuration
  • The build script is properly defined in package.json and is executed before the publish step
  • The UMD build prioritization in rollup config will work as expected since it's part of the same build chain
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify release workflow configuration and build script usage

# Check if release workflow uses pnpm b:all
echo "Checking release workflow configuration..."
rg -A 5 "pnpm b:all" .github/workflows/release.yml

# Check if there are any UMD-specific build steps
echo "Checking for UMD-specific build steps..."
rg "umd" .github/workflows/release.yml

Length of output: 441


Script:

#!/bin/bash
# Let's verify the build script configuration in package.json
echo "Checking build script configuration..."
rg "\"b:all\"" package.json -A 3

# Check if there are any other build-related scripts
echo "Checking other build scripts..."
rg "\"build" package.json

# Let's also check the release workflow file content
echo "Checking release workflow content..."
cat .github/workflows/release.yml

Length of output: 1619

🧰 Tools
🪛 eslint

[error] 156-156: Insert ;

(prettier/prettier)


[error] 157-157: Insert ;

(prettier/prettier)

packages/gizmo/src/Group.ts (2)

1-1: LGTM: Import statement updated correctly

The addition of ParticleRenderer to the imports is necessary for the new type checking, and the imports maintain good alphabetical ordering.


336-339: Verify the exclusion of particle renderer bounds

The code now explicitly ignores particle renderer bounds during bounding box calculations. This could have implications for the overall behavior of the gizmo system.

Please confirm:

  1. Is this exclusion intentional and documented?
  2. What is the rationale behind ignoring particle renderer bounds?
  3. Are there any side effects to consider?

Let's check for any related documentation or tests:

✅ Verification successful

From the context found, I can now generate a final response based on the code surrounding the ParticleRenderer check. The code shows that this is part of a bounding box calculation where particle renderers are explicitly excluded, with other renderers contributing to the bounding box merge operation.

Particle renderer bounds exclusion is intentional and reasonable

The code context reveals this is part of a bounding box calculation where:

  • Only active entities in the hierarchy are considered
  • Particle renderers are explicitly excluded with a clear comment
  • Other renderers contribute their bounds to a merged bounding box

This exclusion makes sense because:

  • Particle systems typically have dynamic, constantly changing bounds
  • Including particle bounds could lead to unstable or overly large bounding boxes
  • The comment "Ignore particle bounding box" indicates this was a deliberate design decision
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for documentation about particle renderer handling
echo "Searching for documentation about particle renderer handling..."
rg -i "particle.*renderer.*bound" --type md
rg -i "particle.*bound.*box" --type md

# Search for related tests
echo "Searching for related tests..."
fd -e test.ts -e spec.ts -x rg -l "ParticleRenderer.*bound"

Length of output: 356


Script:

#!/bin/bash
# Let's look for the ParticleRenderer class definition and its usage context
echo "Searching for ParticleRenderer class definition..."
ast-grep --pattern 'class ParticleRenderer {
  $$$
}'

# Look for any comments or documentation near the particle renderer bounds check
echo "Searching for context around particle renderer bounds check..."
rg -B 5 -A 5 "if \(renderer instanceof ParticleRenderer\)"

# Search for any tests or code that might explain the behavior
echo "Searching for ParticleRenderer usage in tests..."
rg "ParticleRenderer" -A 5 -B 5 --type typescript

# Look for any commit messages that might explain this change
echo "Searching git history for relevant commits..."
git log -p --all -S "ParticleRenderer.*bound"

Length of output: 1518

Comment on lines 28 to 34
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: '>=22.6.0'
registry-url: https://registry.npmjs.org/
cache: pnpm

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Revise Node.js version requirement and add security checks

  1. Node.js 22.6.0 is too recent (released in Oct 2023) and is not LTS. Consider using the current LTS version (20.x) instead.
  2. Add a step to verify lockfile integrity:
      - name: Use Node.js LTS
        uses: actions/setup-node@v4
        with:
-         node-version: '>=22.6.0'
+         node-version: '20.x'
          registry-url: https://registry.npmjs.org/
          cache: pnpm

+     - name: Verify lockfile
+       run: pnpm install --frozen-lockfile
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: '>=22.6.0'
registry-url: https://registry.npmjs.org/
cache: pnpm
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: https://registry.npmjs.org/
cache: pnpm
- name: Verify lockfile
run: pnpm install --frozen-lockfile

Comment on lines 35 to 37
- name: Build
run: pnpm b:all

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add build verification step

The current build step doesn't verify the output. Consider adding checks:

      - name: Build
        run: pnpm b:all
+     - name: Verify build artifacts
+       run: |
+         if [ ! -d "dist" ] || [ -z "$(ls -A dist)" ]; then
+           echo "Build artifacts are missing"
+           exit 1
+         fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Build
run: pnpm b:all
- name: Build
run: pnpm b:all
- name: Verify build artifacts
run: |
if [ ! -d "dist" ] || [ -z "$(ls -A dist)" ]; then
echo "Build artifacts are missing"
exit 1
fi

Comment on lines 38 to 45
- name: Release current monorepo
uses: gz65555/publish@v0.1.5
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
OASISBE_UPLOAD_URL: https://oasisbe.alipay.com/api/file/no-auth/crypto/upload
OASISBE_REQUEST_HEADER: ${{secrets.OASISBE_REQUEST_HEADER}}
OASISBE_PUBLIC_KEY: ${{secrets.OASISBE_PUBLIC_KEY}}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add version validation and enhance release process

The release process could be improved with additional checks:

  1. Validate that package versions match the git tag
  2. Generate/update changelog
  3. Consider using established release actions like semantic-release instead of a custom action

Also, sensitive environment variables should use secrets masking:

      - name: Release current monorepo
        uses: gz65555/publish@v0.1.5
        env:
          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
          NPM_CONFIG_PROVENANCE: true
-         OASISBE_UPLOAD_URL: https://oasisbe.alipay.com/api/file/no-auth/crypto/upload
+         OASISBE_UPLOAD_URL: ${{secrets.OASISBE_UPLOAD_URL}}
          OASISBE_REQUEST_HEADER: ${{secrets.OASISBE_REQUEST_HEADER}}
          OASISBE_PUBLIC_KEY: ${{secrets.OASISBE_PUBLIC_KEY}}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Release current monorepo
uses: gz65555/publish@v0.1.5
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
OASISBE_UPLOAD_URL: https://oasisbe.alipay.com/api/file/no-auth/crypto/upload
OASISBE_REQUEST_HEADER: ${{secrets.OASISBE_REQUEST_HEADER}}
OASISBE_PUBLIC_KEY: ${{secrets.OASISBE_PUBLIC_KEY}}
- name: Release current monorepo
uses: gz65555/publish@v0.1.5
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
OASISBE_UPLOAD_URL: ${{secrets.OASISBE_UPLOAD_URL}}
OASISBE_REQUEST_HEADER: ${{secrets.OASISBE_REQUEST_HEADER}}
OASISBE_PUBLIC_KEY: ${{secrets.OASISBE_PUBLIC_KEY}}

Comment on lines 155 to 157
builderConfigs.sort((_, b) => {
if (b.output.format === "umd") return -1
})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix incomplete sort function implementation.

The current sort function has several issues:

  1. Only handles the case where the second item is UMD
  2. Missing return value for other cases
  3. Missing semicolons (style issue)

This could lead to unpredictable build order and potential failures.

Apply this fix:

-builderConfigs.sort((_, b) => {
-  if (b.output.format === "umd") return -1
-})
+builderConfigs.sort((a, b) => {
+  if (a.output.format === "umd" && b.output.format !== "umd") return -1;
+  if (b.output.format === "umd" && a.output.format !== "umd") return 1;
+  return 0;
+});
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
builderConfigs.sort((_, b) => {
if (b.output.format === "umd") return -1
})
builderConfigs.sort((a, b) => {
if (a.output.format === "umd" && b.output.format !== "umd") return -1;
if (b.output.format === "umd" && a.output.format !== "umd") return 1;
return 0;
});
🧰 Tools
🪛 eslint

[error] 156-156: Insert ;

(prettier/prettier)


[error] 157-157: Insert ;

(prettier/prettier)

@hhhhkrx hhhhkrx changed the base branch from dev/1.4 to main November 6, 2024 07:31
@hhhhkrx hhhhkrx changed the base branch from main to dev/1.4 November 6, 2024 08:10
@hhhhkrx hhhhkrx changed the title Gltf iridescence gltf iridescence Nov 6, 2024
@hhhhkrx hhhhkrx closed this Nov 7, 2024
@hhhhkrx hhhhkrx deleted the GLTF_Iridescence branch November 7, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant