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

feat: add more exports #15

Merged
merged 10 commits into from
Jun 25, 2024
Merged

feat: add more exports #15

merged 10 commits into from
Jun 25, 2024

Conversation

ModyQyW
Copy link
Member

@ModyQyW ModyQyW commented May 31, 2024

Description 描述

1. ⚠️ 重命名导出,现在使用完整的名称作为导出,避免误解和误导,因为 uni-app 记录的环境变量没有统一的前缀格式
2. ⚠️ 移除 builtInPlatforms,没有用到
3. 合并文件,因为 uni-app 记录的环境变量实在无法分类
4. 增加导出,详细可见测试文件

Linked Issues 关联的 Issues

Additional context 额外上下文

Summary by CodeRabbit

  • Documentation

    • Improved wording for checking the current environment elegantly in a uni-app context.
  • Chores

    • Updated pnpm package manager to version 9.4.0.
    • Updated @antfu/eslint-config to version ^2.21.1.
    • Updated @types/node to version ^20.14.5.
  • Configurations

    • Adjusted supported languages in VSCode settings.
    • Updated tsconfig.json to target esnext and use Bundler for module resolution.
    • Modified .github/workflows/release.yml node-version-file parameter.
  • Refactor

    • Removed vue: false configuration in eslint.config.js.
    • Restructured exports in src/index.ts and test/index.test.ts, adding new types and constants with the "uni" prefix.

Copy link

coderabbitai bot commented May 31, 2024

Walkthrough

The recent update includes enhancements across multiple project files, focusing on extending language support, refining environment checks, updating dependencies, and improving code export structures. Key changes involve expanding file associations for better syntax support, updating configurations for linting and TypeScript compilation, and restructuring export declarations for better modularity and readability.

Changes

Files Change Summary
.vscode/settings.json Added "css", "less", "scss", "pcss", and "postcss" to "files.associations".
README.md Improved wording for checking the current environment in a uni-app context.
eslint.config.js Removed vue: false configuration in the exported object.
package.json Updated packageManager to [email protected], @antfu/eslint-config to ^2.21.1, and @types/node to ^20.14.5.
src/index.ts Restructured exports and introduced new types and constants related to platform and environment variables.
test/index.test.ts Renamed and added various platform-related exports with the "uni" prefix.
tsconfig.json Changed target from "es2018" to "esnext" and moduleResolution from "node" to "Bundler".
.github/workflows/release.yml Modified node-version-file parameter value to .nvmrc in Set node job configuration.

Poem

🐇✨
In the land of code, we weave and blend,
Support for styles, new paths to tend.
Dependencies grow, structured exports in line,
For a smoother sail, both elegant and fine.
Uni-app sings with prefixes anew,
A rabbit's delight, in code so true. 🌟🐰


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@ModyQyW ModyQyW requested review from KeJunMao, nei1ee and skiyee May 31, 2024 07:24
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: 0

Outside diff range and nitpick comments (1)
test/index.test.ts (1)

Line range hint 8-80: Renaming and reorganization of exported entities in tests align with the PR objectives and improve clarity.

Would you like me to help generate tests for the newly added exports?

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1b40db0 and b23c296.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !pnpm-lock.yaml
Files selected for processing (7)
  • .vscode/settings.json (1 hunks)
  • README.md (1 hunks)
  • eslint.config.js (1 hunks)
  • package.json (2 hunks)
  • src/index.ts (1 hunks)
  • test/index.test.ts (2 hunks)
  • tsconfig.json (1 hunks)
Files skipped from review due to trivial changes (2)
  • README.md
  • package.json
Additional context used
Biome
.vscode/settings.json

[error] 2-2: Expected a property but instead found '// Enable the ESlint flat config support'.


[error] 4-4: End of file expected


[error] 4-4: End of file expected


[error] 4-4: End of file expected


[error] 4-6: End of file expected


[error] 7-7: End of file expected


[error] 7-7: End of file expected


[error] 7-7: End of file expected


[error] 7-7: End of file expected


[error] 8-8: End of file expected


[error] 8-8: End of file expected


[error] 8-8: End of file expected


[error] 8-10: End of file expected


[error] 11-11: End of file expected


[error] 11-11: End of file expected


[error] 11-14: End of file expected


[error] 14-16: End of file expected


[error] 17-17: End of file expected


[error] 17-17: End of file expected


[error] 17-28: End of file expected

Additional comments not posted (4)
eslint.config.js (1)

3-3: Simplified ESLint configuration looks good.

tsconfig.json (1)

3-3: Updated TypeScript compiler options to use the latest ECMAScript features and a new module resolution strategy.

Also applies to: 6-6

.vscode/settings.json (1)

46-51: Enhanced ESLint validation for additional file types is a beneficial change.

src/index.ts (1)

4-539: Extensive addition of new exports and types enhances platform configuration capabilities.

Verification successful

Let's correct the file type and re-run the search to verify the usage of the new exports.


Let's inspect the content of test/index.test.ts and src/index.ts to verify the usage of the new exports.


The new exports uniPlatform, uniAppPlatform, and uniSubPlatform are used in src/index.ts and referenced in test/index.test.ts. This indicates that they are integrated into the codebase and have corresponding tests.

  • src/index.ts: The new exports are used to define constants and perform various checks.
  • test/index.test.ts: The new exports are referenced, suggesting they are part of the test suite.

This confirms that the new exports are correctly integrated and tested within the codebase.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the new exports are used correctly throughout the codebase.

# Test: Search for usage of new exports. Expect: Proper usage without errors.
rg --type typescript --files-with-matches 'uniPlatform|uniAppPlatform|uniSubPlatform'

Length of output: 122



Script:

#!/bin/bash
# Description: Verify that the new exports are used correctly throughout the codebase.

# Test: Search for usage of new exports. Expect: Proper usage without errors.
rg --type ts --files-with-matches 'uniPlatform|uniAppPlatform|uniSubPlatform'

Length of output: 111



Script:

#!/bin/bash
# Display the relevant lines from test/index.test.ts and src/index.ts to verify the usage of new exports.
rg 'uniPlatform|uniAppPlatform|uniSubPlatform' test/index.test.ts src/index.ts

Length of output: 1586

Copy link
Member

@skiyee skiyee left a comment

Choose a reason for hiding this comment

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

Good Job!

@KeJunMao
Copy link
Member

KeJunMao commented Jun 1, 2024

builtInPlatforms 不建议删除嗷,https://github.com/search?q=org%3Auni-helper%20builtInPlatforms&type=code

导出的命名的话,我还是建议不要 uni 前缀,使用时需要区分的场景不多,即使需要区分,使用者用 as

@ModyQyW
Copy link
Member Author

ModyQyW commented Jun 3, 2024

builtInPlatforms 不建议删除嗷,github.com/search?q=org%3Auni-helper%20builtInPlatforms&type=code

晚点加回来吧,本来是想着发 0.2 然后统一再修改的

导出的命名的话,我还是建议不要 uni 前缀,使用时需要区分的场景不多,即使需要区分,使用者用 as

那就是统一不要 UNI_ 和 VUE_APP_ 前缀,保留 HX_ 前缀?

@ModyQyW ModyQyW changed the title feat!: update exports feat: update exports Jun 18, 2024
@ModyQyW
Copy link
Member Author

ModyQyW commented Jun 18, 2024

@KeJunMao cc?👀

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: 16

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b23c296 and 6bb591f.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (4)
  • .github/workflows/release.yml (1 hunks)
  • package.json (2 hunks)
  • src/index.ts (1 hunks)
  • test/index.test.ts (2 hunks)
Files skipped from review due to trivial changes (2)
  • .github/workflows/release.yml
  • package.json
Additional comments not posted (28)
test/index.test.ts (3)

14-14: The addition of isWeb seems to be in line with the restructuring of platform detection functions. Please verify its usage across the codebase to ensure it integrates well with existing logic.

Verification successful

The isWeb variable is defined in src/index.ts and used in test/index.test.ts. The usage appears to be consistent with the intended restructuring of platform detection functions.

  • src/index.ts: export const isWeb = platform === 'web'
  • test/index.test.ts: "isWeb",
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check usage of 'isWeb' across the codebase.
rg --type python "isWeb" .

Length of output: 57



Script:

#!/bin/bash
# Description: Check usage of 'isWeb' across TypeScript and JavaScript files.
rg "isWeb" --type ts --type js

Length of output: 119


12-12: This addition appears to be consistent with the PR's objective of renaming and adding exports. Ensure that utsPlatform is properly defined and exported in the source code to avoid runtime errors.

Verification successful

The utsPlatform is properly defined and exported in the source code.

  • src/index.ts: export const utsPlatform = env.UNI_UTS_PLATFORM as UtsPlatform
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if 'utsPlatform' is defined and exported in the source code.
rg --type python "export const utsPlatform" ../src/index.ts

Length of output: 92



Script:

#!/bin/bash
# Description: Verify if 'utsPlatform' is defined and exported in the source code.
rg --type typescript "export const utsPlatform" 

Length of output: 84



Script:

#!/bin/bash
# Description: Verify if 'utsPlatform' is defined and exported in the source code.
rg "export const utsPlatform"

Length of output: 107


16-16: Addition of isAppPlus is appropriate, but make sure it's used consistently wherever platform-specific checks are performed.

src/index.ts (25)

4-4: The type OptionalBooleanString is well-defined for flexibility in handling environment variables that can be boolean or undefined. This is a good practice for type safety.


14-14: Definition of BuiltInPlatform as a union type is clear and comprehensive, covering all expected platforms. This is a solid approach for type safety and readability.


16-16: The array builtInPlatforms correctly implements the BuiltInPlatform type. This ensures type consistency across your application.


129-129: The utsJsCodeFormat export correctly captures the environment setting for JavaScript code format. This is crucial for configuring transpilation or bundling tools.


143-143: utsModuleType is correctly exported from the environment. This should help in configuring module systems dynamically based on the environment.


150-150: The export of utsModulePrefix is a good practice, especially for projects that might need configurable module naming conventions.


1-1: Importing env from std-env is a good choice for environment abstraction. Ensure that the std-env package is listed in your package.json dependencies.

Verification successful

The std-env package is correctly listed in your package.json dependencies.

  • package.json: "std-env": "^3.7.0"
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check if 'std-env' is included in package.json dependencies.
rg '"std-env"' ./package.json

Length of output: 55


425-425: appChangedPages is an important export for tracking changes in pages. Confirm its usage in page tracking or version control systems.


39-39: The export of appPlatform is consistent with the new type definitions and maintains type safety. Verify that it is used correctly in platform-specific logic.

Verification successful

The search results indicate that appPlatform is only used within src/index.ts to determine if the platform is Android or iOS. This suggests that the variable is correctly used in platform-specific logic within this file.

  • src/index.ts:
    • export const isAppAndroid = appPlatform === 'android' || utsPlatform === 'app-android'
    • export const isAppIOS = appPlatform === 'ios' || utsPlatform === 'app-ios'

These checks ensure that the appPlatform is utilized correctly for platform-specific conditions.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Check usage of 'appPlatform' in platform-specific logic.
rg "appPlatform" ./src/*.ts

Length of output: 316



Script:

#!/bin/bash
# Description: Check usage of 'appPlatform' in platform-specific logic across the codebase.
rg "appPlatform" ./src

Length of output: 292


335-335: The customDefine export is useful for setting project-specific definitions. Confirm its usage in build scripts or during the initialization of projects.


404-404: rendererNative is an important export for specifying the native rendering approach. Ensure that this setting is utilized in rendering configurations or scripts.


342-342: customContext is appropriately exported for accessing custom contextual settings. Make sure it's used where such contexts are required.


272-272: nvueStyleCompiler export is appropriate for specifying the NVUE style compilation approach. Ensure that this setting is used where NVUE styles are processed.


359-359: uvue is an important export for configurations related to the UVUE framework. Ensure that this setting is utilized in relevant parts of your application.


432-432: The darkMode export, being a boolean string, is crucial for configurations involving dark mode settings. Verify its usage in your theme or UI configurations.


349-349: The minimize export, being a boolean string, is crucial for configurations involving code minification. Verify its usage in your build or deployment scripts.


53-53: subPlatform export is well-defined. Make sure it's utilized where sub-platform distinctions are necessary.


67-67: utsPlatform export aligns with the PR's objectives to enhance platform detection. Confirm its integration and usage within the application.

Verification successful

The utsPlatform export is integrated into the application and is used in src/index.ts to determine the platform type. It is also included in the uni-env test suite to ensure all exports are correctly defined.

  • src/index.ts: utsPlatform is used to determine if the app is running on Android or iOS.
  • test/index.test.ts: utsPlatform is included in a snapshot test to verify its presence among other exports.

This confirms the integration and usage of utsPlatform within the application.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration and usage of 'utsPlatform'.
rg "utsPlatform" ./src/*.ts

Length of output: 316



Script:

#!/bin/bash
# Description: Verify integration and usage of 'utsPlatform' across all files.
rg "utsPlatform"

Length of output: 322



Script:

#!/bin/bash
# Description: Display lines around 'utsPlatform' in the test file to understand its usage.
rg -A 5 -B 5 "utsPlatform" test/index.test.ts

Length of output: 265



Script:

#!/bin/bash
# Description: Search for test cases involving 'utsPlatform' in the test file.
rg "utsPlatform" -A 10 -B 10 test/index.test.ts

Length of output: 526


390-390: The compiler export is crucial for defining the type of compiler used. This should be explicitly checked in compiler configurations or during the build process.


376-376: The uvueTargetLanguage export is essential for multi-language support in UVUE projects. Confirm its usage in language-specific configurations or scripts.


164-164: The utsTargetLanguage export is essential for projects that involve multi-language support. Ensure that this setting is leveraged in language-specific build configurations.


209-209: compilerVersion should be used in build or compile-time configurations. Verify its usage to ensure that it aligns with the intended compiler versions.


223-223: The compilerVersionType export is a subtle but important detail for distinguishing between different types of compiler behaviors. Confirm its utilization in conditional compilation logic.


300-300: automatorAppWebviewSrc should be checked to ensure it's correctly set for specifying the source URL or path for the automation app's webview.


171-171: inputDir and outputDir are crucial for defining build paths. Verify that these are set correctly in your build scripts and that they exist in the file system.

Comment on lines +29 to +83
"utsJsCodeFormat",
"utsModuleType",
"utsModulePrefix",
"utsTargetLanguage",
"inputDir",
"outputDir",
"cliContext",
"subpackage",
"mpPlugin",
"isMpPlugin",
"isMinimize",
"isSSRClient",
"isSSRServer",
"compiler",
"nvueCompiler",
"nvueStyleCompiler",
"compilerVersion",
"compilerVersionType",
"cliContext",
"inputDir",
"outputDir",
"statTitleJson",
"customContext",
"hbuilderxPlugins",
"renderer",
"nvueCompiler",
"nvueStyleCompiler",
"appCodeSpliting",
"automatorWsEndpoint",
"automatorAppWebview",
"automatorAppWebviewSrc",
"h5Base",
"h5Browser",
"customScript",
"customDefine",
"subpackage",
"renderer",
"customContext",
"minimize",
"isMinimize",
"uvue",
"isUVue",
"uvueTargetLanguage",
"compiler",
"rendererNative",
"nvueAppStyles",
"appChangedFiles",
"appChangedPages",
"darkMode",
"hasDarkMode",
"hxUseBaseType",
"hxDependenciesDir",
"appX",
"isAppX",
"appXCacheDir",
"hxVersion",
"appXPageCount",
"appXTsc",
"appXSingleThread",
"appXSetup",
"appXUVueScriptEngine",
"statTitleJson",
"sourcemap",
"hasSourcemap",
"ssrClient",
"isSSRClient",
"ssrServer",
"isSSRServer",
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The search results indicate that the new exports are listed in the test file, but there is no evidence that they are actively tested. This suggests that the new exports might not be properly covered by unit tests.

  • Ensure that all new variables from utsJsCodeFormat to isSSRServer are properly tested in the unit tests.
Analysis chain

The new exports added from utsJsCodeFormat to isSSRServer align with the PR's goal to enhance the module's export structure. Ensure that all these new variables are properly tested to maintain robustness.


The search results show that the new exports are listed in the test file, but it does not confirm if they are being actively tested. To ensure robustness, we need to verify that these exports are included in actual test cases.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if new exports are covered by unit tests.
rg --type python -A 5 -B 5 "expect(Object.keys(uniEnv)).toMatchInlineSnapshot" test/index.test.ts

Length of output: 130



Script:

#!/bin/bash
# Description: Verify if new exports are covered by unit tests.
rg --type ts -A 5 -B 5 "expect(Object.keys(uniEnv)).toMatchInlineSnapshot" test/index.test.ts

Length of output: 95



Script:

#!/bin/bash
# Description: Verify if new exports are referenced in the test file.
rg "utsJsCodeFormat|utsModuleType|utsModulePrefix|utsTargetLanguage|inputDir|outputDir|cliContext|subpackage|mpPlugin|isMpPlugin|compilerVersion|compilerVersionType|hbuilderxPlugins|renderer|nvueCompiler|nvueStyleCompiler|appCodeSpliting|automatorWsEndpoint|automatorAppWebview|automatorAppWebviewSrc|h5Base|h5Browser|customScript|customDefine|customContext|minimize|isMinimize|uvue|isUVue|uvueTargetLanguage|compiler|rendererNative|nvueAppStyles|appChangedFiles|appChangedPages|darkMode|hasDarkMode|hxUseBaseType|hxDependenciesDir|appX|isAppX|appXCacheDir|hxVersion|appXPageCount|appXTsc|appXSingleThread|appXSetup|appXUVueScriptEngine|statTitleJson|sourcemap|hasSourcemap|ssrClient|isSSRClient|ssrServer|isSSRServer" test/index.test.ts

Length of output: 2058



Script:

#!/bin/bash
# Description: Verify if new exports are actively tested in the test file.
rg "utsJsCodeFormat|utsModuleType|utsModulePrefix|utsTargetLanguage|inputDir|outputDir|cliContext|subpackage|mpPlugin|isMpPlugin|compilerVersion|compilerVersionType|hbuilderxPlugins|renderer|nvueCompiler|nvueStyleCompiler|appCodeSpliting|automatorWsEndpoint|automatorAppWebview|automatorAppWebviewSrc|h5Base|h5Browser|customScript|customDefine|customContext|minimize|isMinimize|uvue|isUVue|uvueTargetLanguage|compiler|rendererNative|nvueAppStyles|appChangedFiles|appChangedPages|darkMode|hasDarkMode|hxUseBaseType|hxDependenciesDir|appX|isAppX|appXCacheDir|hxVersion|appXPageCount|appXTsc|appXSingleThread|appXSetup|appXUVueScriptEngine|statTitleJson|sourcemap|hasSourcemap|ssrClient|isSSRClient|ssrServer|isSSRServer" test/

Length of output: 3090

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L34}
*/
export const h5Base = env.UNI_H5_BASE as OptionalString
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The search results show that h5Base is declared but not used anywhere else in the provided TypeScript files. This indicates that the export h5Base might not be utilized in the current codebase.

  • src/index.ts: Declaration found.
  • No other instances of h5Base were found in the search.
Analysis chain

h5Base export is crucial for defining base paths in H5 applications. Verify its usage in your H5 app configurations or during the runtime initialization.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Check if 'h5Base' is used in H5 app configurations or during runtime initialization.
rg "h5Base" ./h5-configs/*.ts

Length of output: 89



Script:

#!/bin/bash
# Step 1: Identify all TypeScript files.
fd -e ts

# Step 2: Search for `h5Base` usage in these files.
fd -e ts --exec rg "h5Base" {}

Length of output: 178

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L31}
*/
export const automatorWsEndpoint = env.UNI_AUTOMATOR_WS_ENDPOINT as OptionalString
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The automatorWsEndpoint is only found in src/index.ts where it is defined and in test/index.test.ts where it is mentioned in a test context. There is no evidence of its usage in the actual automation tool configurations.

  • src/index.ts: defines automatorWsEndpoint
  • test/index.test.ts: mentions automatorWsEndpoint
Analysis chain

automatorWsEndpoint is an important export for automation tool configurations. Confirm its usage in tools or scripts that connect to WebSocket endpoints for automation purposes.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Check if 'automatorWsEndpoint' is used in automation tool configurations.
rg "automatorWsEndpoint" ./automation-tools/*.ts

Length of output: 114



Script:

#!/bin/bash
# Description: Locate TypeScript files that might contain automation tool configurations.
fd --extension ts

Length of output: 80



Script:

#!/bin/bash
# Description: Check if 'automatorWsEndpoint' is used in the identified TypeScript files.
rg "automatorWsEndpoint" build.config.ts src/index.ts src/utils.ts test/index.test.ts

Length of output: 231

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L28}
*/
export const nvueCompiler = env.UNI_NVUE_COMPILER as NVueCompiler
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The nvueCompiler is declared in src/index.ts but is only referenced in a test file (test/index.test.ts). There are no indications that it is being utilized in the actual NVUE compilation settings or build configurations.

  • test/index.test.ts
  • src/index.ts
Analysis chain

nvueCompiler is correctly exported and should be utilized in NVUE compilation settings. Confirm its application in relevant build scripts or configurations.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Verify if 'nvueCompiler' is used in NVUE compilation settings.
rg "nvueCompiler" ./nvue-build-configs/*.ts

Length of output: 111



Script:

#!/bin/bash
# Find potential build or configuration files in the repository.
fd -e ts -e js -e json

Length of output: 154



Script:

#!/bin/bash
# Search for 'nvueCompiler' in the identified potential build or configuration files.
rg "nvueCompiler" biome.json build.config.ts eslint.config.js package.json renovate.json src/index.ts src/utils.ts test/index.test.ts tsconfig.json

Length of output: 269

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L27}
*/
export const renderer = env.UNI_RENDERER as Renderer
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The search results show that the renderer export is only mentioned in src/index.ts and test/index.test.ts. It is not used in any configuration or initialization files.

  • src/index.ts: export const renderer = env.UNI_RENDERER as Renderer
  • test/index.test.ts: Contains the term "renderer" as part of test cases.

This indicates that the renderer export is not explicitly checked in rendering configurations or during runtime initialization.

Analysis chain

The renderer export is crucial for defining the rendering engine. This should be explicitly checked in rendering configurations or during runtime initialization.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Check if 'renderer' is used in rendering configurations or during runtime initialization.
rg "renderer" ./render-configs/*.ts

Length of output: 99



Script:

#!/bin/bash
# Find potential configuration and initialization files in the repository
fd -e ts -e js -e json -e yaml -e yml

Length of output: 184



Script:

#!/bin/bash
# Search for the term 'renderer' in the identified configuration and initialization files
rg renderer biome.json build.config.ts eslint.config.js package.json pnpm-lock.yaml renovate.json src/index.ts src/utils.ts test/index.test.ts tsconfig.json

Length of output: 393

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L23}
*/
export const mpPlugin = env.UNI_MP_PLUGIN as OptionalBooleanString
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The search results show that mpPlugin is defined in src/index.ts and referenced in test/index.test.ts. However, there are no occurrences of mpPlugin being checked in any plugin configuration contexts.

  • src/index.ts: Defines mpPlugin.
  • test/index.test.ts: References mpPlugin.

This means that mpPlugin is not being utilized in the plugin configuration contexts as expected.

Analysis chain

The mpPlugin export, being a boolean string, is correctly handled. Ensure that this is checked in contexts where plugin configurations are relevant.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify if 'mpPlugin' is checked in plugin configuration contexts.
rg "mpPlugin" ./plugin-configs/*.ts

Length of output: 99



Script:

#!/bin/bash
# Description: Verify if 'mpPlugin' is checked in plugin configuration contexts by searching its usage across the codebase.
rg "mpPlugin"

Length of output: 132

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L35}
*/
export const h5Browser = env.UNI_H5_BROWSER as H5Browser
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The search results indicate that h5Browser is defined in src/index.ts and referenced in test/index.test.ts, but there is no evidence of its usage in browser-specific logic or configurations.

  • src/index.ts: export const h5Browser = env.UNI_H5_BROWSER as H5Browser
  • test/index.test.ts: "h5Browser",

Based on these findings, there is no indication that h5Browser is utilized in browser-specific logic or configurations within the codebase.

Analysis chain

The h5Browser export helps specify the type of browser used in H5 applications. Ensure that this setting is utilized in browser-specific logic or configurations.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Verify if 'h5Browser' is used in browser-specific logic or configurations.
rg "h5Browser" ./browser-configs/*.ts

Length of output: 102



Script:

#!/bin/bash
# Description: Search for all occurrences of 'h5Browser' in the codebase.
rg "h5Browser"

Length of output: 124



Script:

#!/bin/bash
# Description: Search for 'h5Browser' usage in 'test/index.test.ts' to understand its context.
rg "h5Browser" test/index.test.ts

Length of output: 54

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L44}
*/
export const nvueAppStyles = env.UNI_NVUE_APP_STYLES as OptionalString
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

nvueAppStyles is defined but not utilized in the relevant style configuration files. Please ensure it is applied in the necessary NVUE style processing scripts or tools.

  • src/index.ts: export const nvueAppStyles = env.UNI_NVUE_APP_STYLES as OptionalString
Analysis chain

nvueAppStyles is correctly exported and should be utilized in NVUE style configurations. Confirm its application in relevant style processing scripts or tools.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Verify if 'nvueAppStyles' is used in NVUE style configurations.
rg "nvueAppStyles" ./style-configs/*.ts

Length of output: 102



Script:

#!/bin/bash
# Locate files that might be related to NVUE style configurations
fd -e ts -e js -e json -e yaml -e yml -e css -e scss -e less -e styl --search-path ./ --type f --exec echo {}

Length of output: 278



Script:

#!/bin/bash
# Check the usage of `nvueAppStyles` in the identified files
rg "nvueAppStyles" src/index.ts src/utils.ts build.config.ts

Length of output: 144

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L48}
*/
export const hxUseBaseType = env.HX_USE_BASE_TYPE as HxUseBaseType
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The search results indicate that HX_USE_BASE_TYPE is only defined and documented in src/index.ts and not utilized elsewhere in the repository. This suggests that hxUseBaseType is not currently being used in any relevant configurations or scripts for HX projects.

  • src/index.ts: The only file where HX_USE_BASE_TYPE is defined and referenced.
Analysis chain

hxUseBaseType is well-defined for specifying the base type used in HX projects. Ensure that this setting is utilized in relevant configurations or scripts.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Verify if 'hxUseBaseType' is used in relevant configurations for HX projects.
rg "hxUseBaseType" ./hx-configs/*.ts

Length of output: 96



Script:

#!/bin/bash
# Search for all occurrences of 'hxUseBaseType' in the repository
rg "hxUseBaseType"

Length of output: 142



Script:

#!/bin/bash
# Display the relevant lines around the occurrence of 'hxUseBaseType' in 'test/index.test.ts'
rg -C 5 "hxUseBaseType" test/index.test.ts

Length of output: 297



Script:

#!/bin/bash
# Search for references to 'HX_USE_BASE_TYPE' in the repository
rg "HX_USE_BASE_TYPE"

Length of output: 195

*
* @link {https://github.com/dcloudio/uni-app/blob/v3.0.0-4010520240507001/packages/shims-node.d.ts#L26}
*/
export const hbuilderxPlugins = env.UNI_HBUILDERX_PLUGINS as OptionalString
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The search results show that hbuilderxPlugins is only referenced in src/index.ts and test/index.test.ts. This suggests that it is not currently used in any configurations or scripts that set up or interact with HBuilderX plugins.

  • src/index.ts: The variable is defined here.
  • test/index.test.ts: The variable is referenced in a test file.

Since there are no other references, it is not being used in the actual setup or interaction with HBuilderX plugins.

Analysis chain

hbuilderxPlugins is well-exported. Ensure that it is referenced in configurations or scripts that set up or interact with HBuilderX plugins.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/binash
# Description: Check if 'hbuilderxPlugins' is referenced in HBuilderX plugin setups.
rg "hbuilderxPlugins" ./plugin-setups/*.ts

Length of output: 105



Script:

#!/bin/bash
# Description: Search for 'hbuilderxPlugins' across the entire repository to identify all references.
rg "hbuilderxPlugins"

Length of output: 157

Copy link
Member

@KeJunMao KeJunMao left a comment

Choose a reason for hiding this comment

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

cool, 现在好像对外也不是破坏性更改了?

@ModyQyW
Copy link
Member Author

ModyQyW commented Jun 19, 2024

cool, 现在好像对外也不是破坏性更改了?

是的,现在只是增加了导出,没有破坏性更改

@ModyQyW
Copy link
Member Author

ModyQyW commented Jun 20, 2024

我准备在两到三天内合并发布这个

@ModyQyW ModyQyW changed the title feat: update exports feat: add more exports Jun 25, 2024
@ModyQyW ModyQyW merged commit 179dd4a into main Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants