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
1 change: 0 additions & 1 deletion examples/sites/demos/pc/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export const cmpMenus = [
{ 'nameCn': '锚点', 'name': 'Anchor', 'key': 'anchor' },
{ 'nameCn': '面包屑', 'name': 'Breadcrumb', 'key': 'breadcrumb' },
{ 'nameCn': '下拉菜单', 'name': 'Dropdown', 'key': 'dropdown' },
{ 'nameCn': '收藏夹菜单', 'name': 'LinkMenu', 'key': 'link-menu' },
{ 'nameCn': '导航菜单', 'name': 'NavMenu', 'key': 'nav-menu' },
{ 'nameCn': '分页', 'name': 'Pager', 'key': 'pager' },
{ 'nameCn': '步骤条', 'name': 'Steps', 'key': 'steps' },
Expand Down
30 changes: 0 additions & 30 deletions packages/theme/build/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,6 @@

import fs from 'node:fs'
import path from 'node:path'
import fg from 'fast-glob'

// 替换文件内容。 如果不指定target,则原地覆盖
function replaceFile(src, cb, target = null) {
let content = fs.readFileSync(src, 'utf8')
content = cb(content)
fs.writeFileSync(target || src, content, 'utf8')
}

// 1、从 index.css 生成 lowcode.css ------ 提供特殊的前缀名称
replaceFile('dist/index.css', (content) => content.replace(/--ti-/g, '--ti-vue-'), 'dist/lowcode.css')

// 2、复制一份冗余的文件,统一替换 --ti- 前缀为 --tvue- ,避免混用 tiny3时,css变量名冲突。
fs.cpSync('dist', '_dist', { recursive: true, force: true })
fs.cpSync('_dist', 'dist/_dist', { recursive: true, force: true })
fs.rmSync('_dist', { recursive: true, force: true })
// 2.1 处理所有的 index.css
let files = fg.sync(['dist/_dist/**/index.css'])
files.forEach((file) => {
replaceFile(file, (content) => content.replace(/--ti-/g, '--tvue-'))
})
// 2.2 处理所有的说主题js
files = fg.sync(['dist/_dist/**/{aurora,smb}-theme.js', 'dist/_dist/theme/**/{index,component}.js'])
files.forEach((file) => {
replaceFile(file, (content) =>
content
.replace(/--ti-/g, '--tvue-') //
.replace(/'ti-/g, `'tvue-`)
)
})

// 3、复制package.json/README.md到dist目录
fs.copyFileSync('package.json', path.join('dist', 'package.json'))
Expand Down
1 change: 1 addition & 0 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.18.3",
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
"author": "OpenTiny Team",
"type": "module",
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Detected CommonJS require() statements and missing .js extensions.

Several require() calls were found in the packages/theme directory, which are incompatible with ES modules. Please update these to use ES module import syntax.

Additionally, some import statements are missing .js extensions:

  • packages/theme/src/theme/generate-theme.js
  • packages/theme/scripts/build-component-cssvar.js
  • packages/theme/src/theme-tool.js
  • packages/theme/src/theme/index.js
🔗 Analysis chain

LGTM. Significant change to module system.

The addition of "type": "module" is correct and aligns with modern JavaScript practices. This change indicates that the package should be treated as an ECMAScript module, which can lead to improved compatibility with newer JavaScript features and tooling.

To ensure this change doesn't introduce unintended side effects, please verify:

  1. All import/export statements in this package use ES module syntax.
  2. Any scripts or tools that interact with this package are compatible with ES modules.

Run the following script to check for potential issues:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential issues with ES module conversion

# Test 1: Check for CommonJS require() statements
echo "Checking for CommonJS require() statements:"
rg 'require\(' packages/theme

# Test 2: Check for .js extensions in import statements
echo "Checking for .js extensions in import statements:"
rg 'from\s+[\'"]\..*[\'"]' packages/theme | grep -v '\.js[\'"]'

# Test 3: Check for package.json files in subdirectories that might need updating
echo "Checking for package.json files in subdirectories:"
fd package.json packages/theme

# Note: Review the output manually to determine if any changes are needed.

Length of output: 840


Script:

#!/bin/bash
# Description: Check for potential issues with ES module conversion

# Test 1: Check for CommonJS require() statements
echo "Checking for CommonJS require() statements:"
rg 'require\(' packages/theme

# Test 2: Check for .js extensions in import statements
echo "Checking for .js extensions in import statements:"
rg 'from\s+[\'"]\..*[\'"]' packages/theme | grep -v '\.js[\'"]'

# Test 3: Check for package.json files in subdirectories that might need updating
echo "Checking for package.json files in subdirectories:"
fd package.json packages/theme

# Note: Review the output manually to determine if any changes are needed.

Length of output: 840


Script:

#!/bin/bash
# Description: Check for potential issues with ES module conversion

# Test 1: Check for CommonJS require() statements
echo "Checking for CommonJS require() statements:"
rg 'require\(' packages/theme

# Test 2: Check for .js extensions in import statements
echo "Checking for .js extensions in import statements:"
rg 'from\s+[\'"]\..*[^.js][\'"]' packages/theme

# Test 3: Check for package.json files in subdirectories that might need updating
echo "Checking for package.json files in subdirectories:"
fd package.json packages/theme

# Note: Review the output manually to determine if any changes are needed.

Length of output: 840


Script:

#!/bin/bash
# Description: Check for potential issues with ES module conversion

# Test 1: Check for CommonJS require() statements
echo "Checking for CommonJS require() statements:"
rg 'require\(' packages/theme

# Test 2: Check for .js extensions in import statements
echo "Checking for .js extensions in import statements:"
rg "from\s+['\"]\..*[^.js]['\"]" packages/theme

# Test 3: Check for package.json files in subdirectories that might need updating
echo "Checking for package.json files in subdirectories:"
fd package.json packages/theme

# Note: Review the output manually to determine if any changes are needed.

Length of output: 1622

"license": "MIT",
"homepage": "https://opentiny.design/tiny-vue",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@
@import './user-link/index.less';
@import './watermark/index.less';
@import './wizard/index.less';
@import './year-table/index.less';
@import './year-table/index.less';
Loading