This repository has been archived by the owner on Sep 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
235 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source "$startdir"/../../../.pkgbuild/brick/PKGBUILD | ||
pkgname=<%= packageName %>-B | ||
pkgver=0.0.0 # placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# <%= scope %>/<%= packageName %> | ||
|
||
Generated by [generator-console-package](https://github.com/easyops-cn/generator-console-package) v<%= generatorVersion %> | ||
|
||
## Develop | ||
|
||
``` | ||
# 1. 开启监听构建 | ||
cd ~/<%= repository %> | ||
lerna run start --scope=<%= scope %>/<%= packageName %> | ||
# 2. 创建 link | ||
cd <%= subPackagePath %>/<%= packageName %> | ||
yarn link | ||
# 3. 使用 link | ||
cd ~/Console-W | ||
yarn link <%= scope %>/<%= packageName %> | ||
``` | ||
|
||
## publish | ||
|
||
``` | ||
lerna version | ||
``` |
20 changes: 20 additions & 0 deletions
20
generators/app/templates/brick/deploy/install_postscript.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
install_base="/usr/local/easyops" # Easyops 安装根目录 | ||
plugin_name="<%= packageName %>" | ||
install_path="${install_base}/bricks/${plugin_name}-B" #多加了个-B后缀,这是我们的部署规范 | ||
|
||
console="console" # console目录应用 | ||
scope="@brick" | ||
plugins_dir="${install_base}/${console}/src/www/plugins/" | ||
builtin_plugins_dir="${install_base}/${console}/src/www/builtin-plugins/" | ||
|
||
# 删除原有放在buildin-plugins的插件,小产品安装的都统一放在plugins | ||
rm -rf "${builtin_plugins_dir:?}/${scope}/${plugin_name}" | ||
# 删除上一个版本 | ||
rm -rf "${plugins_dir:?}/${plugin_name}" | ||
|
||
# 确保存在插件目录 | ||
mkdir -p "${plugins_dir}" | ||
# 这边转换插件的名字,不用-A后缀 | ||
ln -snf "${install_path}" "${plugins_dir}/${plugin_name}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
install_path: "/usr/local/easyops/bricks/<%= packageName %>-B" | ||
user: easyops:easyops | ||
|
||
dependencies: | ||
- name: console | ||
version: "^4.0.0" | ||
local_deploy: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# 先清理原有的main-xxxx.js | ||
rm -rf ./dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
# 为保证一致,直接用install_postscript.sh | ||
bash ./deploy/install_postscript.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "<%= scope %>/<%= packageName %>", | ||
"private": true, | ||
"version": "0.0.0", | ||
"main": "dist/main.js", | ||
"repository": "https://git.easyops.local/anyclouds/<%= repository %>", | ||
"license": "UNLICENSED", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"start": "npm run build:dev -- --watch", | ||
"build:dev": "NODE_ENV=development webpack --mode development --config ../../webpack.config.js", | ||
"prebuild": "rimraf dist", | ||
"prestart": "rimraf dist", | ||
"build": "NODE_ENV=production webpack --mode production --config ../../webpack.config.js", | ||
"prepublishOnly": "npm test && npm run build" | ||
}, | ||
"peerDependencies": { | ||
"@angular/common": "7.1.4", | ||
"@angular/core": "7.1.4", | ||
"@angular/forms": "7.1.4", | ||
"@angular/platform-browser": "7.1.4", | ||
"@angular/router": "7.1.4", | ||
"@easyops/console-plugin-core": "^5.0.0", | ||
"@easyops/console-vendors": "^12.0.0", | ||
"@uirouter/angular": "2.0.0", | ||
"@uirouter/core": "5.0.19", | ||
"rxjs": "^6.4.0", | ||
"zone.js": "~0.8.26" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
generators/app/templates/brick/src/components/template.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<p> | ||
<%= componentName %> works! | ||
</p> |
Empty file.
24 changes: 24 additions & 0 deletions
24
generators/app/templates/brick/src/components/template.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { async, ComponentFixture, TestBed } from "@angular/core/testing"; | ||
import { <%= componentClassName %> } from "./<%= componentName %>.component"; | ||
|
||
describe("<%= componentClassName %>", () => { | ||
let component: <%= componentClassName %>; | ||
let fixture: ComponentFixture<<%= componentClassName %>>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ <%= componentClassName %> ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(<%= componentClassName %>); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it("should create", () => { | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
generators/app/templates/brick/src/components/template.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: "<%= componentName %>", | ||
templateUrl: "./<%= componentName %>.component.html", | ||
styleUrls: ["./<%= componentName %>.component.scss"] | ||
}) | ||
export class <%= componentClassName %> implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NgModule } from "@angular/core"; | ||
import { CommonModule } from "@angular/common"; | ||
|
||
import { <%= componentClassName %> } from "./components/<%= componentName %>.component"; | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule | ||
], | ||
declarations: [<%= componentClassName %>], | ||
entryComponents: [<%= componentClassName %>] | ||
}) | ||
export class <%= moduleName %> {} |
Oops, something went wrong.