Skip to content

Commit

Permalink
Merge branch 'V3.0' into hxy/progress/review
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang authored Nov 14, 2024
2 parents bd84b30 + 4b427a1 commit a5a85ea
Show file tree
Hide file tree
Showing 19 changed files with 1,022 additions and 3,823 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/add-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Add Label

on:
pull_request_target:
types: [opened, synchronize, reopened]
workflow_dispatch:

jobs:
add-label:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Determine label based on target branch
id: determine-label
run: |
echo "${{github.event_name}}"
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
echo "label=2.x" >> $GITHUB_ENV
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
echo "label=3.x" >> $GITHUB_ENV
else
echo "label=" >> $GITHUB_ENV
fi
- name: Add label to Pull Request
if: env.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.label }}
29 changes: 2 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- next
- V3.0
pull_request_target:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

Expand Down Expand Up @@ -81,29 +81,4 @@ jobs:

- name: Build NutUI-React Taro H5 Demo
if: github.ref == 'refs/heads/next'
run: npm run build:taro:site
add-label:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Determine label based on target branch
id: determine-label
run: |
echo "${{github.event_name}}"
if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then
echo "label=2.x" >> $GITHUB_ENV
elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then
echo "label=3.x" >> $GITHUB_ENV
else
echo "label=" >> $GITHUB_ENV
fi
- name: Add label to Pull Request
if: env.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.label }}
run: npm run build:taro:site
22 changes: 11 additions & 11 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ gulp.task('watch', () => {
interval,
gulp.series(`${argv}copyTaro`)
)
gulp.watch(
`src/packages/${argv}/${argv}.rn.tsx`,
interval,
gulp.series(`${argv}copyRN`)
)
// gulp.watch(
// `src/packages/${argv}/${argv}.rn.tsx`,
// interval,
// gulp.series(`${argv}copyRN`)
// )
})
const watchTasks = []
// eslint-disable-next-line array-callback-return
Expand Down Expand Up @@ -121,10 +121,10 @@ argvs.forEach((argv) => {
.pipe(insert.prepend(`import "./${argv}.harmony.css";\n`))
.pipe(gulp.dest(`${targetBaseUrl}/`))
})
gulp.task(`${argv}copyRN`, () => {
return gulp
.src(`src/packages/${argv}/${argv}.rn.tsx`)
.pipe(insert.prepend(`import "./${argv}.harmony.css";\n`))
.pipe(gulp.dest(`${targetBaseUrl}/`))
})
// gulp.task(`${argv}copyRN`, () => {
// return gulp
// .src(`src/packages/${argv}/${argv}.rn.tsx`)
// .pipe(insert.prepend(`import "./${argv}.harmony.css";\n`))
// .pipe(gulp.dest(`${targetBaseUrl}/`))
// })
})
5 changes: 2 additions & 3 deletions packages/nutui-taro-demo/config/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const path = require('path')
const injectScss = require('../plugins/inject-scss')

let fileStr = `src/styles/variables.scss`
let themeStr = `src/styles/theme-default.scss`
Expand Down Expand Up @@ -71,7 +70,7 @@ const config = {
},
sourceRoot: 'src',
outputRoot: `dist/${process.env.TARO_ENV === 'h5' ? 'demo' : process.env.TARO_ENV}`,
plugins: [path.resolve(__dirname, '../plugins/inject-scss.js'), ...plugins],
plugins: [...plugins],
compiler: 'webpack5',
alias:
process.env.TARO_ENV === 'rn' || process.env.TARO_ENV === 'jdrn'
Expand Down Expand Up @@ -129,7 +128,7 @@ const config = {
},
},
// 将编译方式设置为使用 Vite 编译
compiler: { type: 'vite', vitePlugins: [injectScss()] },
compiler: { type: 'vite' },
// 【必填】鸿蒙主应用的绝对路径,例如:
projectPath: path.resolve(
process.cwd(),
Expand Down
4 changes: 3 additions & 1 deletion packages/nutui-taro-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
"typescript": "^5.3.3"
},
"resolutions": {
"sass":"1.77.6"
"sass": "1.77.6",
"@tarojs/api": "4.0.8-beta.0",
"@tarojs/components": "4.0.8-beta.0"
}
}
39 changes: 0 additions & 39 deletions packages/nutui-taro-demo/plugins/inject-scss.js

This file was deleted.

24 changes: 12 additions & 12 deletions packages/nutui-taro-demo/scripts/taro/generate-nutui-taro.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ fs.outputFile(
}
)

let fileRNStr = `${importRNStr}
${importScssStr}
export { ${packages.join(',')} };`
fs.outputFile(
path.resolve(__dirname, '../../nutui-react/packages/nutui.react.rn.ts'),
fileRNStr,
'utf8',
(error) => {
if (error) throw error
}
)

// let fileRNStr = `${importRNStr}
// ${importScssStr}
// export { ${packages.join(',')} };`
// fs.outputFile(
// path.resolve(__dirname, '../../nutui-react/packages/nutui.react.rn.ts'),
// fileRNStr,
// 'utf8',
// (error) => {
// if (error) throw error
// }
// )
//
let taroScssfileStr = `
${importScssStr}
export default { "NutUI":"NutUI-Taro" };`
Expand Down
Loading

0 comments on commit a5a85ea

Please sign in to comment.