-
Notifications
You must be signed in to change notification settings - Fork 82
chore: setup publish env #170
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request introduces new JSON configuration files under the Changes
Sequence Diagram(s)sequenceDiagram
participant R as Release Action
participant E as Environment Check
participant Exec as Execution Command
R->>E: Retrieve NPM_AUTH_TOKEN
alt Token exists
R->>Exec: Run publish command with token
else Token missing
R-->>R: Throw "Please set NPM_AUTH_TOKEN" error
end
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
common/changes/@coze/realtime-api/chore-use-corret-npm-token_2025-03-31-02-42.json (1)
1-11
: JSON Configuration for Publish Environment SetupThe JSON file documents the publishing environment setup appropriately by categorizing the change as a patch and including relevant metadata (package name and contributor email). One minor nitpick: the filename uses “corret” which might be intended to be “correct.” If this is an unintentional typo, consider renaming it for clarity and consistency.
infra/rush-x/src/actions/release/__tests__/release.test.ts (2)
66-66
: Consider using undefined assignment instead of delete.The static analysis tool flagged potential performance concerns with the
delete
operator onprocess.env
.- delete process.env.NPM_AUTH_TOKEN; + process.env.NPM_AUTH_TOKEN = undefined;🧰 Tools
🪛 Biome (1.9.4)
[error] 66-66: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
250-250
: Consider using undefined assignment instead of delete.Similar to the earlier instance, using undefined assignment is recommended over the delete operator for better performance.
- delete process.env.NPM_AUTH_TOKEN; + process.env.NPM_AUTH_TOKEN = undefined;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
common/changes/@coze/api/chore-use-corret-npm-token_2025-03-31-02-42.json
(1 hunks)common/changes/@coze/chat-sdk/chore-use-corret-npm-token_2025-03-31-02-42.json
(1 hunks)common/changes/@coze/realtime-api/chore-use-corret-npm-token_2025-03-31-02-42.json
(1 hunks)common/changes/@coze/taro-api/chore-use-corret-npm-token_2025-03-31-02-42.json
(1 hunks)infra/rush-x/src/actions/release/__tests__/release.test.ts
(7 hunks)infra/rush-x/src/actions/release/index.ts
(1 hunks)infra/rush-x/src/actions/release/release.ts
(1 hunks)packages/chat-sdk/.npmrc
(1 hunks)packages/coze-js/.npmrc
(1 hunks)packages/coze-taro/.npmrc
(1 hunks)packages/realtime-api/.npmrc
(1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
infra/rush-x/src/actions/release/__tests__/release.test.ts (1)
infra/rush-x/src/actions/release/release.ts (1)
releasePackages
(57-67)
🪛 Biome (1.9.4)
infra/rush-x/src/actions/release/__tests__/release.test.ts
[error] 66-66: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 252-253: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Node.js v20 (ubuntu-latest)
🔇 Additional comments (14)
packages/chat-sdk/.npmrc (1)
1-2
: Authentication Token Configuration UpdateThe new configuration line correctly uses the
NPM_AUTH_TOKEN
environment variable for npm registry authentication. This change is consistent with the updated publish environment requirements and aligns with similar changes across other packages.packages/coze-taro/.npmrc (1)
1-2
: Consistent Authentication SetupThis file now includes the configuration line using
NPM_AUTH_TOKEN
for secure npm registry access. The update is in line with the PR objectives and matches the configuration in other packages.packages/realtime-api/.npmrc (1)
1-2
: New .npmrc File for Realtime APIThe new
.npmrc
file for the realtime API package properly configures the authentication token usingNPM_AUTH_TOKEN
. This ensures that package publishing and installation use the correct token.packages/coze-js/.npmrc (1)
1-2
: NPM Authentication Token SetupThis updated configuration line ensures that the
packages/coze-js
package uses theNPM_AUTH_TOKEN
for npm operations. It mirrors the changes made across other packages, thereby enhancing consistency and security in the publishing setup.common/changes/@coze/chat-sdk/chore-use-corret-npm-token_2025-03-31-02-42.json (1)
1-11
: Package change log entry looks goodThis change log entry properly documents a patch update for setting up the publish environment for the
@coze/chat-sdk
package.common/changes/@coze/taro-api/chore-use-corret-npm-token_2025-03-31-02-42.json (1)
1-11
: Package change log entry looks goodThis change log entry properly documents a patch update for setting up the publish environment for the
@coze/taro-api
package.common/changes/@coze/api/chore-use-corret-npm-token_2025-03-31-02-42.json (1)
1-11
: Package change log entry looks goodThis change log entry properly documents a patch update for setting up the publish environment for the
@coze/api
package.infra/rush-x/src/actions/release/release.ts (3)
16-16
: Updated environment variable name for npm authenticationThe change from
NODE_AUTH_TOKEN
toNPM_AUTH_TOKEN
better aligns with npm's standard naming conventions.
23-23
: Updated command argument to use the renamed auth token variableThis change correctly updates the command argument to use
NPM_AUTH_TOKEN
instead ofNODE_AUTH_TOKEN
, maintaining consistency with the environmental variable naming change.
16-23
:✅ Verification successful
Verify all references to the auth token have been updated
The environment variable has been updated in this file, but make sure all other references to
NODE_AUTH_TOKEN
are also updated throughout the codebase.
🏁 Script executed:
#!/bin/bash # Search for any remaining references to NODE_AUTH_TOKEN that might need updating rg -i "NODE_AUTH_TOKEN" --type=ts --type=js --type=jsonLength of output: 55
Based on this additional verification, no occurrences of
NODE_AUTH_TOKEN
were found throughout the codebase. It appears that all references have been correctly updated to use the new variable (NPM_AUTH_TOKEN
).Action Required:
- Verify that any CI/CD configurations or external documentation referencing
NODE_AUTH_TOKEN
are also updated if applicable.
🏁 Script executed:
#!/bin/bash # Perform a comprehensive search for any instance of NODE_AUTH_TOKEN across the entire repository. rg -i "NODE_AUTH_TOKEN"Length of output: 23
AUTH TOKEN REFERENCE AUDIT PASSED
The comprehensive search across the repository revealed no instances ofNODE_AUTH_TOKEN
, confirming that all references have been updated to useNPM_AUTH_TOKEN
. Please also double-check any CI/CD configurations or external documentation to ensure they are aligned with this update.infra/rush-x/src/actions/release/index.ts (1)
24-25
: Update to NPM_AUTH_TOKEN improves naming clarity.The change from
NODE_AUTH_TOKEN
toNPM_AUTH_TOKEN
makes the environment variable name more specific and descriptive, clearly indicating its purpose for npm authentication. This is a good improvement that follows npm conventions and makes the code more self-documenting.infra/rush-x/src/actions/release/__tests__/release.test.ts (3)
62-62
: Environment variable name update is consistent.The change from
NODE_AUTH_TOKEN
toNPM_AUTH_TOKEN
in the test setup matches the implementation change, ensuring tests remain in sync with the production code.
102-102
: Environment variable references updated consistently.All command string assertions have been properly updated to use
NPM_AUTH_TOKEN
instead ofNODE_AUTH_TOKEN
, maintaining consistency with the implementation changes.Also applies to: 108-108, 144-144, 166-166, 189-189, 286-286
258-258
: Assertion correctly updated for missing token test.The test for handling missing auth token now correctly checks for
NPM_AUTH_TOKEN=undefined
in the command string, consistent with the implementation change.
Summary by CodeRabbit
Chores
Tests