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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dist

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand All @@ -47,3 +48,9 @@ es

# cursor
.cursor

verdaccio
ftp-data


/scripts/cli/dms-kit-publish/docs
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,5 @@ docker_build_ee: pull_image docker_install_node_modules
docker_build_demo: pull_image docker_install_node_modules
$(DOCKER) run -v $(MAIN_MODULE):/usr/src/app --user $(UID):$(GID) -w /usr/src/app --rm $(DOCKER_IMAGE) sh -c "pnpm build:demo"

docker_build_icons_docs: pull_image docker_install_node_modules
$(DOCKER) run -v $(MAIN_MODULE):/usr/src/app --user $(UID):$(GID) -w /usr/src/app --rm $(DOCKER_IMAGE) sh -c "pnpm icon:docs:g && pnpm icon:docs:build && mv packages/icons/docs-dist ./docs-dist && tar zcf $(ICONS_DOCS_OUTER_BUILD_NAME) ./docs-dist"

docker_upload_icons_docs:
curl -T $(ICONS_DOCS_OUTER_BUILD_NAME) \
ftp://$(RELEASE_FTP_HOST)/actiontech-dms-ui/icons/$(ICONS_DOCS_OUTER_BUILD_NAME) --ftp-create-dirs

docker_sync_icons_docs_static:
curl -X POST ${SYNC_ICONS_DOCS_STATIC_HOST}/sync-static
docker_dms_kit_publish: docker_install_node_modules
$(DOCKER) run -v $(MAIN_MODULE):/usr/src/app --user $(UID):$(GID) -w /usr/src/app --rm $(DOCKER_IMAGE) sh -c "pnpm dms-kit:publish"
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
"api_client:g": "npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli api-client -y",
"api_mocks:g": "npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli api-mocks -y",
"ai-doc": "npm_config_registry=http://10.186.18.19:4873 pnpx @actiontech/cli ai-doc",
"postinstall": "pnpm --filter @actiontech/dms-kit build"
"postinstall": "pnpm --filter @actiontech/dms-kit build",
"dms-kit:publish": "pnpm --filter @actiontech/cli-dms-kit-publish build && dms-kit-publish"
},
"keywords": [],
"author": "",
"devDependencies": {
"@actiontech/cli-create-dms-page": "workspace:^",
"@actiontech/cli-dms-kit-publish": "workspace:^",
"@cfaester/enzyme-adapter-react-18": "^0.7.0",
"@eslint/js": "^9.23.0",
"@testing-library/dom": "9.3.4",
Expand Down Expand Up @@ -92,6 +94,7 @@
"stylelint-config-styled-components": "^0.1.1",
"stylelint-prettier": "^4.0.2",
"ts-jest": "27.1.5",
"tsx": "^4.20.5",
"typescript": "^5.0.2",
"typescript-eslint": "^8.28.0",
"vite": "^5.2.6",
Expand Down
6 changes: 6 additions & 0 deletions packages/dms-kit/.dumi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"include": [
"**/*"
]
}
4 changes: 0 additions & 4 deletions packages/dms-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
"test:c": "jest --watchAll=false --coverage",
"test:ci": "jest --ci --watchAll=false --coverage --color --silent --testLocationInResults"
},
"publishConfig": {
"registry": "http://10.186.18.19:4873/",
"access": "restricted"
},
"dependencies": {
"ahooks": "^3.7.0",
"axios": ">=0.27.2",
Expand Down
6 changes: 6 additions & 0 deletions packages/icons/.dumi/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.json",
"include": [
"**/*"
]
}
14 changes: 14 additions & 0 deletions packages/icons/docs/icon/Common.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,20 @@ import { EyeClosedOutlined } from '@actiontech/icons';
export default () => <EyeClosedOutlined width={32} height={32} />
```

## FaLessThanEqualOutlined
```jsx
import { FaLessThanEqualOutlined } from '@actiontech/icons';

export default () => <FaLessThanEqualOutlined width={32} height={32} />
```

## FilterOutlined
```jsx
import { FilterOutlined } from '@actiontech/icons';

export default () => <FilterOutlined width={32} height={32} />
```

## HexagonOutlined
```jsx
import { HexagonOutlined } from '@actiontech/icons';
Expand Down
7 changes: 7 additions & 0 deletions packages/icons/docs/icon/Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ import { TrendCardFilled } from '@actiontech/icons';
export default () => <TrendCardFilled width={32} height={32} />
```

## DashboardOutlined
```jsx
import { DashboardOutlined } from '@actiontech/icons';

export default () => <DashboardOutlined width={32} height={32} />
```

## DoubleDatabaseOutlined
```jsx
import { DoubleDatabaseOutlined } from '@actiontech/icons';
Expand Down
8 changes: 2 additions & 6 deletions packages/icons/package_publish.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@actiontech/icons",
"version": "0.0.1-rc.7",
"description": "",
"version": "0.0.1-rc.7",
"main": "./dist/index.js",
"module": "./es/index.js",
"types": "./es/index.d.ts",
Expand All @@ -21,10 +21,6 @@
"es",
"dist"
],
"publishConfig": {
"registry": "http://10.186.18.19:4873/",
"access": "restricted"
},
"scripts": {
"start": "dumi dev",
"docs:build": "dumi build",
Expand All @@ -46,4 +42,4 @@
"peerDependencies": {
"react": ">=17"
}
}
}
56 changes: 22 additions & 34 deletions packages/icons/publish-icons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ import { fileURLToPath } from 'node:url';
import { spawnSync } from 'node:child_process';
import readline from 'node:readline';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const iconsDir = __dirname;

function parseArgs(argv) {
const args = { version: '', skipConfirm: false };
const args = { version: '', skipConfirm: false, registry: '', auth: '' };
for (let i = 2; i < argv.length; i += 1) {
const key = argv[i];
const val = argv[i + 1];
Expand All @@ -15,6 +19,10 @@ function parseArgs(argv) {
i += 1;
} else if (key === '--skip-confirm' || key === '-y') {
args.skipConfirm = true;
} else if (key === '--registry' || key === '-r') {
args.registry = val || '';
} else if (key === '--auth' || key === '-a') {
args.auth = val || '';
}
}
return args;
Expand Down Expand Up @@ -124,31 +132,10 @@ async function confirmPublish() {
});
}

function updatePackagePublishVersion(iconsDir, version) {
const pubPkgPath = path.join(iconsDir, 'package_publish.json');
try {
const pubPkgContent = readJson(pubPkgPath);
pubPkgContent.version = version;
writeJson(pubPkgPath, pubPkgContent);
console.log(`✅ 已更新 package_publish.json 版本号为: ${version}`);
} catch (err) {
console.warn(`⚠️ 更新 package_publish.json 版本号失败: ${err.message}`);
}
}

async function main() {
const { version, skipConfirm } = parseArgs(process.argv);
if (!version) {
console.error('请通过 --version 或 -v 指定版本号,例如:');
console.error(
' node packages/icons/publish-icons.mjs --version 0.0.1-rc.3'
);
process.exit(1);
}
const { skipConfirm, registry, auth } = parseArgs(process.argv);

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const iconsDir = __dirname;
const version = readJson(path.join(iconsDir, 'package.json')).version;

const pubPkg = path.join(iconsDir, 'package_publish.json');
ensureFileExists(pubPkg, '发布用 package_publish.json');
Expand All @@ -158,12 +145,11 @@ async function main() {
const originalVersion = originalPubPkgContent.version;

const tmpBase = path.join(__dirname, '..');
const tmpDir = fs.mkdtempSync(
path.join(tmpBase, 'actiontech-icons-publish-')
);
const tmpDir = path.join(tmpBase, 'actiontech-icons-publish');

try {
console.log(`[1/7] 创建临时目录: ${tmpDir}`);
fs.mkdirSync(tmpDir, { recursive: true });

console.log('[2/7] 复制整个 icons 包到临时目录');
// 复制整个包目录,但排除一些不需要的文件
Expand Down Expand Up @@ -226,12 +212,14 @@ async function main() {
return;
}
}

console.log('[6/7] 执行发布: npm publish');
runCmd('npm', ['publish'], tmpDir);

console.log('[7/7] 更新 package_publish.json 版本号');
updatePackagePublishVersion(iconsDir, version);
console.log('[6/7] 配置认证');
runCmd('pnpm', ['config', 'set', auth], tmpDir);
console.log('[7/7] 执行发布: pnpm publish');
runCmd(
'pnpm',
['publish', '--registry', registry, '--no-git-checks'],
tmpDir
);

console.log('✅ 发布完成');
} catch (err) {
Expand All @@ -250,7 +238,7 @@ async function main() {
console.warn(`⚠️ 还原版本号失败: ${restoreErr.message}`);
}
} finally {
console.log('[8/7] 清理临时目录');
console.log('[7/7] 清理临时目录');
try {
if (fs.existsSync(tmpDir)) {
fs.rmSync(tmpDir, { recursive: true, force: true });
Expand Down
Loading