move all plugins to "plugins" directory

This commit is contained in:
Pig Fang 2020-06-24 11:42:49 +08:00
parent 77541cefef
commit cd1676dd29
303 changed files with 27 additions and 563 deletions

5
.gitignore vendored
View File

@ -1,9 +1,10 @@
.dist/*
node_modules
littleskin/
*/vendor
plugins/*/vendor
plugin-test/
*/assets/**/*.js
plugins/*/assets/**/*.js
plugins/*/assets/**/*.map
.php_cs.cache
composer.lock
yarn-error.log

View File

@ -1,9 +1,7 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('node_modules')
->exclude('.git')
->in(__DIR__)
->in(__DIR__.'/plugins')
;
return PhpCsFixer\Config::create()

View File

@ -23,7 +23,7 @@ function Get-Trans {
$segment = $realKey.Split(".")
$head = $segment[0]
$filePath = if ($Plugin) {
"./$Plugin/lang/$Lang/$head.yml"
"./plugins/$Plugin/lang/$Lang/$head.yml"
}
else {
"./lang/$Lang/$head.yml"
@ -54,19 +54,19 @@ $env:NODE_ENV = 'production'
git clone "https://github.com/bs-community/plugins-dist.git" .dist
$registry = Get-Content '.dist/registry-preview.json' | ConvertFrom-Json
$packages = $registry.packages
$plugins = Get-ChildItem -Path . -Directory -Exclude @('node_modules', '.*') | ForEach-Object { $_.Name }
$plugins = Get-ChildItem -Path ./plugins -Directory | ForEach-Object { $_.Name }
yarn build
[PSCustomObject[]]$updated = @()
foreach ($plugin in $plugins) {
Set-Location $plugin
Set-Location "./plugins/$plugin"
$manifest = Get-Content "package.json" | ConvertFrom-Json
$version = $manifest.version
if ($packages | Where-Object { $_.name -eq $plugin -and $_.version -eq $version }) {
Set-Location '..'
Set-Location '../../'
continue
}
@ -96,11 +96,14 @@ foreach ($plugin in $plugins) {
if (Test-Path 'composer.json') {
composer install
Remove-Item 'composer.json' -Force
Remove-Item 'composer.lock' -Force
}
Set-Location '..'
zip -9 -r ".dist/${plugin}_$version.zip" $plugin
zip -9 -r "../.dist/${plugin}_$version.zip" $plugin
Set-Location '..'
}
ConvertTo-Json $updated | Out-File -FilePath 'updated.json'

View File

@ -45,6 +45,7 @@ $manifest = [PSCustomObject]@{
}
}
Set-Location ./plugins
New-Item "./$Id/src" -ItemType Directory | Out-Null
New-Item "./$Id/lang/en" -ItemType Directory | Out-Null
New-Item "./$Id/lang/zh_CN" -ItemType Directory | Out-Null
@ -64,3 +65,5 @@ if ($Asset) {
if ($Lang) {
New-Item "./$Id/lang" -ItemType Directory | Out-Null
}
Set-Location ..

View File

@ -1,10 +0,0 @@
import { src, dest, watch } from 'gulp'
export function copy() {
const destPath = process.env.DEST || '../blessing-skin-server/public/plugins'
return src('*/assets/**/*.*').pipe(dest(destPath))
}
export function dev() {
watch('*/assets/**/*.*', { ignoreInitial: false, ignored: ['**/*.ts'] }, copy)
}

View File

@ -5,8 +5,7 @@
},
"private": true,
"workspaces": [
"config-generator",
"restricted-email-domains"
"plugins/*"
],
"scripts": {
"dev": "webpack -d -w",

Some files were not shown because too many files have changed in this diff Show More