Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internals/automate/src/add-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async function writeJson(jsonPath, dependencies) {
toDelDeps.forEach((dep) => {
delete json.dependencies[dep]
})
writeFile(jsonPath, JSON.stringify(json, null, 2))
writeFile(jsonPath, JSON.stringify(json, null, 2) + '\n')
}

// 解析文件内容中的opentiny依赖
Expand Down Expand Up @@ -55,7 +55,7 @@ async function addComponentDepencies(component, dir) {
const allFiles = await fg(['**/*.ts', '**/*.vue'], {
dot: true,
cwd: componentPath,
ignore: ['**/node_modules', '__test__']
ignore: ['**/node_modules', '__test__', '__tests__']
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Test directory naming convention needs standardization

The codebase shows inconsistent test directory naming patterns in the Vue package:

  • Most components (54) use __tests__ (double underscore)
  • Some components (11) use __test__ (single underscore)

This inconsistency should be standardized to __tests__ as it's:

  • The more commonly used pattern in this codebase
  • The more widely adopted convention in the JavaScript/TypeScript ecosystem

Components using __test__ that need updating:

  • action-menu
  • collapse-item
  • collapse
  • divider
  • dropdown
  • fullscreen
  • pager
  • tooltip
  • tree
  • user-contact
  • user-head
🔗 Analysis chain

Verify test directory naming consistency across the codebase.

While ignoring both __test__ and __tests__ is more comprehensive, having both patterns might indicate inconsistent test directory naming conventions.

Let's check the test directory naming patterns:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for inconsistent test directory naming patterns
# Expected: All test directories should follow the same naming convention

echo "Directories with '__test__' pattern:"
fd -t d "__test__$"

echo -e "\nDirectories with '__tests__' pattern:"
fd -t d "__tests__$"

Length of output: 283


Script:

#!/bin/bash
# Let's try a different approach to find test directories
# Using find command which is more reliable for this case
echo "Directories with '__test__' pattern:"
find . -type d -name "__test__" -not -path "*/node_modules/*" -not -path "*/\.*"

echo -e "\nDirectories with '__tests__' pattern:"
find . -type d -name "__tests__" -not -path "*/node_modules/*" -not -path "*/\.*"

# Also let's check for any test files that might indicate the convention
echo -e "\nFiles in directories containing 'test':"
find . -type d -name "*test*" -not -path "*/node_modules/*" -not -path "*/\.*" | while read dir; do
    echo "Directory: $dir"
    ls -1 "$dir" 2>/dev/null || true
done

Length of output: 16515

})
for (let i = 0; i < allFiles.length; i++) {
const file = allFiles[i]
Expand All @@ -73,6 +73,6 @@ scanDir(root, 'dir').then((dirs) => {
dirs.forEach((dir) => addComponentDepencies(dir, root))
})

scanDir(path.join(root, 'chart'), 'dir').then((dirs) => {
dirs.forEach((dir) => addComponentDepencies(dir, path.join(root, 'chart')))
scanDir(path.join(root, 'huicharts'), 'dir').then((dirs) => {
dirs.forEach((dir) => addComponentDepencies(dir, path.join(root, 'huicharts')))
})
3 changes: 2 additions & 1 deletion packages/vue/src/base-select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"@opentiny/vue-select-dropdown": "workspace:~",
"@opentiny/vue-tag": "workspace:~",
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-tooltip": "workspace:~"
"@opentiny/vue-tooltip": "workspace:~",
"@opentiny/vue-tree": "workspace:~"
},
"devDependencies": {
"@opentiny-internal/vue-test-utils": "workspace:*",
Expand Down
3 changes: 1 addition & 2 deletions packages/vue/src/config-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
},
"dependencies": {
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-config-provider": "workspace:~"
"@opentiny/vue-theme": "workspace:~"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/vue/src/dialog-select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"@opentiny/vue-selected-box": "workspace:~",
"@opentiny/vue-input": "workspace:~",
"@opentiny/vue-tree": "workspace:~",
"@opentiny/vue-theme": "workspace:~"
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-icon": "workspace:~"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/vue/src/image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-image-viewer": "workspace:~",
"@opentiny/vue-theme": "workspace:~"
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-icon": "workspace:~"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/vue/src/load-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"sideEffects": false,
"dependencies": {
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-renderless": "workspace:~"
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-locale": "workspace:~"
},
"license": "MIT",
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/vue/src/loading/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-theme-mobile": "workspace:~"
"@opentiny/vue-theme-mobile": "workspace:~",
"@opentiny/vue-icon": "workspace:~"
},
"license": "MIT"
}
3 changes: 1 addition & 2 deletions packages/vue/src/sticky/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"dependencies": {
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-theme-mobile": "workspace:~"
"@opentiny/vue-theme": "workspace:~"
},
"license": "MIT",
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/vue/src/switch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-theme-mobile": "workspace:~",
"@opentiny/vue-theme": "workspace:~"
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-icon": "workspace:~"
},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/vue/src/time-range/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-time-spinner": "workspace:~",
"@opentiny/vue-theme": "workspace:~"
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-button": "workspace:~"
Comment on lines +21 to +22
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Version inconsistencies found in workspace dependencies

Two packages are using non-workspace versions which should be updated to maintain consistency:

  • packages/vue/src/huicharts/huicharts-core/package.json: @opentiny/huicharts uses version 1.0.1
  • packages/vue/src/fluent-editor/package.json: @opentiny/fluent-editor uses version ~3.20.0

The remaining 1,228 @opentiny dependencies correctly use workspace:~ versioning.

🔗 Analysis chain

Verify workspace version consistency.

The workspace:~ version specifier is consistent with other dependencies in this file and aligns with the pattern seen across other package updates.


Let me gather more specific information about the outliers to provide a complete verification.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistency of workspace:~ version usage across package.json files

# Check if all @opentiny dependencies use workspace:~ version
echo "Checking version consistency across package.json files..."
fd package.json packages/vue/src -x grep -l "workspace:~" {} \; | \
  xargs jq -r '.dependencies | select(.) | to_entries[] | select(.key | startswith("@opentiny")) | .value' | \
  sort | uniq -c

Length of output: 367


Script:

#!/bin/bash
# Find the specific package.json files with non-workspace versions
echo "Files with version 1.0.1:"
fd package.json packages/vue/src -x sh -c 'if jq -e ".dependencies | select(.) | to_entries[] | select(.key | startswith(\"@opentiny\")) | select(.value == \"1.0.1\")" {} > /dev/null; then echo {}; fi'

echo -e "\nFiles with version ~3.20.0:"
fd package.json packages/vue/src -x sh -c 'if jq -e ".dependencies | select(.) | to_entries[] | select(.key | startswith(\"@opentiny\")) | select(.value == \"~3.20.0\")" {} > /dev/null; then echo {}; fi'

echo -e "\nShowing the specific dependencies with non-workspace versions:"
fd package.json packages/vue/src -x sh -c 'if jq -e ".dependencies | select(.) | to_entries[] | select(.key | startswith(\"@opentiny\")) | select(.value != \"workspace:~\")" {} > /dev/null; then echo "=== {}:"; jq ".dependencies | to_entries[] | select(.key | startswith(\"@opentiny\")) | select(.value != \"workspace:~\")" {}; fi'

Length of output: 1340

},
"license": "MIT"
}
3 changes: 2 additions & 1 deletion packages/vue/src/upload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-upload-dragger": "workspace:~",
"@opentiny/vue-modal": "workspace:~",
"@opentiny/vue-tooltip": "workspace:~"
"@opentiny/vue-tooltip": "workspace:~",
"@opentiny/vue-icon": "workspace:~"
},
"license": "MIT"
}
Loading