Skip to content

Commit

Permalink
refactor: update package path and bundle folder (element-plus#3016)
Browse files Browse the repository at this point in the history
  • Loading branch information
jw-foss authored Aug 24, 2021
1 parent 21820ac commit b0f4fc5
Show file tree
Hide file tree
Showing 925 changed files with 7,262 additions and 7,809 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/lib/*
11 changes: 4 additions & 7 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ jobs:
registry-url: https://registry.npmjs.com/
- name: Get version
run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: build
run: yarn fast-build
env:
TAG_VERSION: ${{env.TAG_VERSION}}
- name: generate npm token
run: echo "GIT_HEAD=${GITHUB_SHA}" >> GITHUB_ENV
- name: build&publish
run: echo "//registry.npmjs.com/:_authToken=${{ secrets.NPM_PUBLISH_TOKEN }}" > ./.npmrc
- name: Publish npm
run: sh ./scripts/publish.sh
run: sh ./scripts/monorepo.sh
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}
TAG_VERSION: ${{env.TAG_VERSION}}
GIT_HEAD: ${{env.GIT_HEAD}}
REGISTRY: https://registry.npmjs.com/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ lib
website/play/index.vue
packages/element-plus/version.ts
/es/
es
3 changes: 3 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"MD033": false
}
File renamed without changes.
43 changes: 0 additions & 43 deletions build/bincomp.js

This file was deleted.

43 changes: 32 additions & 11 deletions build/build-helper.js → build/build-helper.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,68 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const helper = require('components-helper')
const { name, version } = require('../package.json')
const icon = require('../website/icon.json')
import helper from 'components-helper'
import path from 'path'
import { epRoot } from './paths'

const { name, version } = require(path.resolve(
epRoot,
'./package.json',
))

import icon from '../website/icon.json'
const icons = icon.map(item => 'el-icon-' + item).join('/')
const tagVer = process.env.TAG_VERSION
const _version = tagVer ? tagVer.startsWith('v') ? tagVer.slice(1) : tagVer : version
const _version = tagVer
? tagVer.startsWith('v')
? tagVer.slice(1)
: tagVer
: version

helper({
name,
version: _version,
entry: 'website/docs/en-US/!(custom-theme|datetime-picker|i18n|installation|message-box|message|migration-from-2.x|notification|quickstart|transition|typography).md',
outDir: 'lib',
entry:
'website/docs/en-US/!(custom-theme|datetime-picker|i18n|installation|message-box|message|migration-from-2.x|notification|quickstart|transition|typography).md',
outDir: 'dist/element-plus',
reComponentName,
reDocUrl,
reAttribute,
props: 'Attributes',
propsName: 'Attribute',
propsOptions: 'Accepted Values',
eventsName: 'Event Name',
tableRegExp: '#+\\s+(.*\\s*Attributes|.*\\s*Events|.*\\s*Slots|.*\\s*Directives)\\s*\\n+(\\|?.+\\|.+)\\n\\|?\\s*:?-+:?\\s*\\|.+((\\n\\|?.+\\|.+)+)',
tableRegExp:
'#+\\s+(.*\\s*Attributes|.*\\s*Events|.*\\s*Slots|.*\\s*Directives)\\s*\\n+(\\|?.+\\|.+)\\n\\|?\\s*:?-+:?\\s*\\|.+((\\n\\|?.+\\|.+)+)',
})

function reComponentName(title) {
return 'el-' + title.replace(/\B([A-Z])/g, '-$1').replace(/[ ]+/g, '-').toLowerCase()
return (
'el-' +
title
.replace(/\B([A-Z])/g, '-$1')
.replace(/[ ]+/g, '-')
.toLowerCase()
)
}

function reDocUrl(fileName, header) {
const docs = 'https://element-plus.org/#/en-US/component/'
const _header = header ? header.replace(/[ ]+/g, '-').toLowerCase() : undefined
const _header = header
? header.replace(/[ ]+/g, '-').toLowerCase()
: undefined
return docs + fileName + (_header ? '#' + _header : '')
}

function reAttribute(value, key, item) {
const _value = value.match(/^\*\*(.*)\*\*$/)
const str = _value ? _value[1]: value
const str = _value ? _value[1] : value

if (key === 'Accepted Values' && /icon/i.test(item[0])) {
return icons
} else if (key === 'Name' && /^(-|—)$/.test(str)) {
return 'default'
} else if (str === '' || /^(-|—)$/.test(str)) {
return undefined
} else if (key === 'Attribute' && /v-model:(.+)/.test(str)){
} else if (key === 'Attribute' && /v-model:(.+)/.test(str)) {
const _str = str.match(/v-model:(.+)/)
return _str ? _str[1] : undefined
} else if (key === 'Attribute' && /v-model/.test(str)) {
Expand Down
70 changes: 0 additions & 70 deletions build/build-indices.js

This file was deleted.

39 changes: 0 additions & 39 deletions build/build-locale.js

This file was deleted.

50 changes: 0 additions & 50 deletions build/build-util.js

This file was deleted.

Loading

0 comments on commit b0f4fc5

Please sign in to comment.