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/* .dist/*
node_modules node_modules
littleskin/ littleskin/
*/vendor plugins/*/vendor
plugin-test/ plugin-test/
*/assets/**/*.js plugins/*/assets/**/*.js
plugins/*/assets/**/*.map
.php_cs.cache .php_cs.cache
composer.lock composer.lock
yarn-error.log yarn-error.log

View File

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

View File

@ -23,7 +23,7 @@ function Get-Trans {
$segment = $realKey.Split(".") $segment = $realKey.Split(".")
$head = $segment[0] $head = $segment[0]
$filePath = if ($Plugin) { $filePath = if ($Plugin) {
"./$Plugin/lang/$Lang/$head.yml" "./plugins/$Plugin/lang/$Lang/$head.yml"
} }
else { else {
"./lang/$Lang/$head.yml" "./lang/$Lang/$head.yml"
@ -54,19 +54,19 @@ $env:NODE_ENV = 'production'
git clone "https://github.com/bs-community/plugins-dist.git" .dist git clone "https://github.com/bs-community/plugins-dist.git" .dist
$registry = Get-Content '.dist/registry-preview.json' | ConvertFrom-Json $registry = Get-Content '.dist/registry-preview.json' | ConvertFrom-Json
$packages = $registry.packages $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 yarn build
[PSCustomObject[]]$updated = @() [PSCustomObject[]]$updated = @()
foreach ($plugin in $plugins) { foreach ($plugin in $plugins) {
Set-Location $plugin Set-Location "./plugins/$plugin"
$manifest = Get-Content "package.json" | ConvertFrom-Json $manifest = Get-Content "package.json" | ConvertFrom-Json
$version = $manifest.version $version = $manifest.version
if ($packages | Where-Object { $_.name -eq $plugin -and $_.version -eq $version }) { if ($packages | Where-Object { $_.name -eq $plugin -and $_.version -eq $version }) {
Set-Location '..' Set-Location '../../'
continue continue
} }
@ -96,11 +96,14 @@ foreach ($plugin in $plugins) {
if (Test-Path 'composer.json') { if (Test-Path 'composer.json') {
composer install composer install
Remove-Item 'composer.json' -Force
Remove-Item 'composer.lock' -Force
} }
Set-Location '..' 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' 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/src" -ItemType Directory | Out-Null
New-Item "./$Id/lang/en" -ItemType Directory | Out-Null New-Item "./$Id/lang/en" -ItemType Directory | Out-Null
New-Item "./$Id/lang/zh_CN" -ItemType Directory | Out-Null New-Item "./$Id/lang/zh_CN" -ItemType Directory | Out-Null
@ -64,3 +65,5 @@ if ($Asset) {
if ($Lang) { if ($Lang) {
New-Item "./$Id/lang" -ItemType Directory | Out-Null 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, "private": true,
"workspaces": [ "workspaces": [
"config-generator", "plugins/*"
"restricted-email-domains"
], ],
"scripts": { "scripts": {
"dev": "webpack -d -w", "dev": "webpack -d -w",

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