diff --git a/fixtures/default/yakumo.yml b/fixtures/default/yakumo.yml index ec7717b..747a629 100644 --- a/fixtures/default/yakumo.yml +++ b/fixtures/default/yakumo.yml @@ -6,5 +6,4 @@ - esbuild - name: yakumo-esbuild - name: yakumo-mocha -- name: yakumo-publish-sync - name: yakumo-tsc diff --git a/packages/core/src/plugins/publish.ts b/packages/core/src/plugins/publish.ts index 6356413..2cca0f8 100644 --- a/packages/core/src/plugins/publish.ts +++ b/packages/core/src/plugins/publish.ts @@ -108,6 +108,10 @@ export default function apply(ctx: Context) { if (argv.otp) args.push('--otp', argv.otp) const code = await publish(ctx.yakumo.manager, path, meta, args, argv) assert(!code) + // sync npm mirror + fetch('https://registry-direct.npmmirror.com/' + meta.name + '/sync?sync_upstream=true', { + method: 'PUT', + }).catch(() => {}) await ctx.parallel('publish/after', path, meta) } catch (e) { failed++ diff --git a/packages/publish-sync/.npmignore b/packages/publish-sync/.npmignore deleted file mode 100644 index 7e5fcbc..0000000 --- a/packages/publish-sync/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -tsconfig.tsbuildinfo diff --git a/packages/publish-sync/package.json b/packages/publish-sync/package.json deleted file mode 100644 index dde595b..0000000 --- a/packages/publish-sync/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "yakumo-publish-sync", - "description": "Sync other registry after publish", - "version": "1.0.0-alpha.1", - "main": "lib/index.js", - "typings": "lib/index.d.ts", - "files": [ - "lib" - ], - "author": "Shigma ", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/shigma/yakumo.git", - "directory": "packages/publish-sync" - }, - "bugs": { - "url": "https://github.com/shigma/yakumo/issues" - }, - "keywords": [ - "yakumo", - "plugin", - "extension", - "publish", - "sync", - "registry" - ], - "peerDependencies": { - "yakumo": "^1.0.0-alpha.7" - } -} diff --git a/packages/publish-sync/src/index.ts b/packages/publish-sync/src/index.ts deleted file mode 100644 index 3c44ae4..0000000 --- a/packages/publish-sync/src/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Context } from 'yakumo' - -export function apply(ctx: Context) { - ctx.on('publish/after', async (name, meta) => { - await fetch('https://registry-direct.npmmirror.com/' + meta.name + '/sync?sync_upstream=true', { - method: 'PUT', - }) - }) -} diff --git a/packages/publish-sync/tsconfig.json b/packages/publish-sync/tsconfig.json deleted file mode 100644 index 42cbe59..0000000 --- a/packages/publish-sync/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.base", - "compilerOptions": { - "rootDir": "src", - "outDir": "lib", - }, - "include": [ - "src", - ], -} diff --git a/yakumo.yml b/yakumo.yml index a0b3ec2..ee9a2ce 100644 --- a/yakumo.yml +++ b/yakumo.yml @@ -5,5 +5,4 @@ - tsc - esbuild - name: yakumo-esbuild -- name: yakumo-publish-sync - name: yakumo-tsc