Skip to content

Commit

Permalink
fix: resolve confilct
Browse files Browse the repository at this point in the history
  • Loading branch information
GGwujun committed May 22, 2021
2 parents 1cf2318 + 9c67a6d commit 771c427
Show file tree
Hide file tree
Showing 30 changed files with 5,976 additions and 8,596 deletions.
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
blank_issues_enabled: false
contact_links:
- name: Create new issue
url: https://new-issue.vuejs.org/?repo=vuejs/vue-next
about: Please use the following link to create a new issue.
- name: Patreon
url: https://www.patreon.com/evanyou
about: Love Vue.js? Please consider supporting us via Patreon.
- name: Open Collective
url: https://opencollective.com/vuejs/donate
about: Love Vue.js? Please consider supporting us via Open Collective.
42 changes: 41 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.0.1 (2021-05-19)
## 0.0.1 (2021-05-21)



Expand All @@ -7,6 +7,46 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 0.0.2-alpha.7 (2021-05-21)

**Note:** Version bump only for package @winfe/winex





## 0.0.2-alpha.6 (2021-05-21)

**Note:** Version bump only for package @winfe/winex





## 0.0.2-alpha.5 (2021-05-21)

**Note:** Version bump only for package @winfe/winex





## 0.0.2-alpha.4 (2021-05-21)

**Note:** Version bump only for package @winfe/winex





## 0.0.2-alpha.3 (2021-05-21)

**Note:** Version bump only for package @winfe/winex





## 0.0.2-alpha.2 (2021-05-19)

**Note:** Version bump only for package @winfe/winex
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.0.2-alpha.2",
"version": "0.0.2-alpha.7",
"packages": [
"packages/*"
],
Expand Down
40 changes: 40 additions & 0 deletions packages/cli-plugin-add/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 0.0.2-alpha.7 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-add





## 0.0.2-alpha.6 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-add





## 0.0.2-alpha.5 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-add





## 0.0.2-alpha.4 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-add





## 0.0.2-alpha.3 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-add
6 changes: 3 additions & 3 deletions packages/cli-plugin-add/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winfe/cli-plugin-add",
"version": "0.0.1",
"version": "0.0.2-alpha.7",
"homepage": "",
"license": "MIT",
"main": "lib/index.js",
Expand All @@ -21,8 +21,8 @@
"dependencies": {
"@types/execa": "^2.0.0",
"@types/node": "^15.3.0",
"@winexmaterials/get-materials": "^1.0.1",
"@winfe/cli-core": "^0.0.2-alpha.2",
"@winfe/cli-core": "^0.0.2-alpha.7",
"@winfe/get-materials": "^1.0.0",
"download-package-tarball": "^1.0.7",
"enquirer": "^2.3.6",
"execa": "^5.0.0",
Expand Down
45 changes: 29 additions & 16 deletions packages/cli-plugin-add/src/utils/GetMaterial.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
import chalk from 'chalk';
import { GetMaterialOptions } from '../interface';
import { error } from './logger';
import chalk from "chalk";
import { GetMaterialOptions } from "../interface";
import { error } from "./logger";

const semver = require('semver');
const { getmaterialinfo } = require('@winexmaterials/get-materials');
const semver = require("semver");
const { getmaterialinfo } = require("@winfe/get-materials");

class PackageNotFoundError extends Error {
constructor(pluginName: string) {
super(`Package ${chalk.cyan(pluginName)} could not be found, please check the spelling right`);
this.name = 'PackageNotFoundError';
super(
`Package ${chalk.cyan(
pluginName
)} could not be found, please check the spelling right`
);
this.name = "PackageNotFoundError";
}
}

class RegularNotFoundError extends Error {
constructor(pluginName: string, version: string) {
super(`Couldn't find any versions for ${chalk.cyan(pluginName)} that matches ${chalk.cyan(version)}`);
this.name = 'RegularNotFoundError';
super(
`Couldn't find any versions for ${chalk.cyan(
pluginName
)} that matches ${chalk.cyan(version)}`
);
this.name = "RegularNotFoundError";
}
}

export class GetMaterial {
pluginName: string
pluginVersion: string
pluginName: string;
pluginVersion: string;

constructor(pluginName: string, pluginVersion: string) {
this.pluginName = pluginName;
Expand All @@ -39,16 +47,17 @@ export class GetMaterial {

let { version, type, npm, registry } = source;

if (type !== 'npm' && !!this.pluginVersion) {
if (!semver.valid(this.pluginVersion)) { // todo: download:不支持 dist-tags
if (type !== "npm" && !!this.pluginVersion) {
if (!semver.valid(this.pluginVersion)) {
// todo: download:不支持 dist-tags
throw new RegularNotFoundError(this.pluginName, this.pluginVersion);
} else {
version = this.pluginVersion;
}
}

// scoped packages
const name = npm[0] === '@' ? npm.slice(npm.indexOf('/') + 1) : npm;
const name = npm[0] === "@" ? npm.slice(npm.indexOf("/") + 1) : npm;

const params = {
npm,
Expand All @@ -58,8 +67,12 @@ export class GetMaterial {
};

for (const key in params) {
if (params[key] === '') {
error(`${chalk.cyan(this.pluginName)}: lack of ${chalk.cyan(key)}, please contact the developers`);
if (params[key] === "") {
error(
`${chalk.cyan(this.pluginName)}: lack of ${chalk.cyan(
key
)}, please contact the developers`
);
process.exit(1);
}
}
Expand Down
40 changes: 40 additions & 0 deletions packages/cli-plugin-init/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 0.0.2-alpha.7 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-init





## 0.0.2-alpha.6 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-init





## 0.0.2-alpha.5 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-init





## 0.0.2-alpha.4 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-init





## 0.0.2-alpha.3 (2021-05-21)

**Note:** Version bump only for package @winfe/cli-plugin-init
23 changes: 23 additions & 0 deletions packages/cli-plugin-init/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# @winfe/cli-plugin-init

> Create a new project by winex-cli
## Usage

```bash
$ winex init --name <app-name>
```

## Options
| 选项名称(option) | 缩写 | 选项说明 | 可选值 |
|---------- |-------- |-------- |-------- |
| --name | -n | 项目名称(同outdir) | - |
| --type | - | 初始化项目的类型(普通业务项目、插件项目、物料项目及其他) | normal(默认)、cli-plugin等 |
| --domain | - | 选择业务项目所属域 | "common"/"clinical"/"execution"/"finance"/"knowledge"/"record"/"person" |
|--qiankun | -qk |选择初始化业务项目时,需选择业务应用类型(主应用、子应用、普通) |app-indep(默认)、app-main、app-sub|
|--template | -t |模板npm包名称| -|
|--repository | -r |项目git仓库地址 |tfs/gitlab/github等git仓库地址|
|--registry | - |设置npm源 | https://registry.npmjs.org/|
|--packageManager | -pm 设置node包管理工具 | npm/yarn/cnpm|
|--path | - |项目存储地址(绝对地址) |默认为当前运行路径|

9 changes: 6 additions & 3 deletions packages/cli-plugin-init/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@winfe/cli-plugin-init",
"version": "0.0.1",
"version": "0.0.2-alpha.7",
"main": "lib/index.js",
"module": "src/index.js",
"types": "lib/index.d.ts",
Expand All @@ -17,8 +17,8 @@
"@types/fs-extra": "^9.0.11",
"@types/ini": "^1.3.30",
"@types/validate-npm-package-name": "^3.0.2",
"@winexmaterials/get-materials": "^1.0.1",
"@winfe/cli-core": "^0.0.2-alpha.2",
"@winfe/cli-core": "^0.0.2-alpha.7",
"@winfe/get-materials": "^1.0.0",
"chalk": "^4.1.0",
"cross-spawn": "^7.0.3",
"download-npm-package": "^3.1.12",
Expand All @@ -37,5 +37,8 @@
"publishConfig": {
"access": "public",
"registry": "http://registry.npmjs.org/"
},
"devDependencies": {
"@types/mkdirp": "^1.0.1"
}
}
6 changes: 3 additions & 3 deletions packages/cli-plugin-init/src/constants/businessType.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export const BUSINESS_TYPE = [
{
name: "normal",
name: "app_indep",
desc: "独立PC项目",
},
{
name: "micro-main",
name: "app_main",
desc: "微应用-主应用",
},
{
name: "micro-sub",
name: "app_sub",
desc: "微应用-子应用",
},
];
5 changes: 4 additions & 1 deletion packages/cli-plugin-init/src/interface/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface IMaterialBaseInfo {
title: string;
homepage: string;
descriptions: string;
catagory: string;
category: string;
domain: string;
registry: string;
source: IMaterialSource;
Expand All @@ -47,7 +47,10 @@ interface IMaterialBaseInfo {

export interface IComponentsInfo extends IMaterialBaseInfo {}

type ScaffoldCategory = "app_indep" | "app_main" | "app_sub";

export interface IScaffoldInfo extends IMaterialBaseInfo {
category: ScaffoldCategory;
screenshoot: string;
screenshoots?: string[];
}
Expand Down
1 change: 1 addition & 0 deletions packages/cli-plugin-init/src/utils/getNpmPkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const getNpmPkg = async (packageName: string, options: GotOptions) => {
const url = require("url");

let { version, registryUrl } = options;
registryUrl = /\/$/.test(registryUrl) ? registryUrl : `${registryUrl}/`

const packageUrl = url.resolve(registryUrl, packageName);
const authInfo = registryAuthToken(registryUrl.toString(), {
Expand Down

0 comments on commit 771c427

Please sign in to comment.