@yarn-tool/publish-retry 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/index.d.ts +2 -0
- package/index.js +31 -0
- package/index.js.map +1 -0
- package/package.json +82 -0
package/README.md
ADDED
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.publishRetry = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ws_pkg_list_1 = require("ws-pkg-list");
|
|
6
|
+
const bluebird_1 = tslib_1.__importDefault(require("bluebird"));
|
|
7
|
+
const is_published_1 = require("@yarn-tool/is-published");
|
|
8
|
+
const cross_spawn_extra_1 = require("cross-spawn-extra");
|
|
9
|
+
const logger_1 = require("debug-color2/logger");
|
|
10
|
+
async function publishRetry(cwd) {
|
|
11
|
+
return bluebird_1.default.resolve((0, ws_pkg_list_1.wsPkgListable)(cwd))
|
|
12
|
+
.mapSeries(async (row) => {
|
|
13
|
+
const { location: cwd } = row;
|
|
14
|
+
logger_1.consoleLogger.dir(row);
|
|
15
|
+
let bool = await (0, is_published_1.isPublishedByPackageJSON)(row);
|
|
16
|
+
if (!bool) {
|
|
17
|
+
logger_1.consoleLogger.info(`try to publish ${row.name}
|
|
18
|
+
@${row.version}`);
|
|
19
|
+
const cp = await (0, cross_spawn_extra_1.async)('npm', [
|
|
20
|
+
'publish',
|
|
21
|
+
], {
|
|
22
|
+
cwd,
|
|
23
|
+
});
|
|
24
|
+
logger_1.consoleLogger.log(cp.status, cp.error);
|
|
25
|
+
await bluebird_1.default.delay(1000);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.publishRetry = publishRetry;
|
|
30
|
+
publishRetry();
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,6CAA4C;AAC5C,gEAAgC;AAChC,0DAAmE;AACnE,yDAAwD;AACxD,gDAA+D;AAExD,KAAK,UAAU,YAAY,CAAC,GAAY;IAE9C,OAAO,kBAAQ,CAAC,OAAO,CAAC,IAAA,2BAAa,EAAC,GAAG,CAAC,CAAC;SACzC,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACxB,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;QAE9B,sBAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEjB,IAAI,IAAI,GAAG,MAAM,IAAA,uCAAwB,EAAC,GAAG,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAI,EACT;YACC,sBAAO,CAAC,IAAI,CAAC,kBAAkB,GAAG,CAAC,IAAI;MACrC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;YAEjB,MAAM,EAAE,GAAG,MAAM,IAAA,yBAAU,EAAC,KAAK,EAAE;gBAClC,SAAS;aACT,EAAE;gBACF,GAAG;aACH,CAAC,CAAC;YAEH,sBAAO,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;YAEjC,MAAM,kBAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC3B;IAEF,CAAC,CAAC,CACF;AACF,CAAC;AA5BD,oCA4BC;AAED,YAAY,EAAE,CAAC","sourcesContent":["import { wsPkgListable } from 'ws-pkg-list';\nimport Bluebird from 'bluebird';\nimport { isPublishedByPackageJSON } from '@yarn-tool/is-published';\nimport { async as crossSpawn } from 'cross-spawn-extra';\nimport { consoleLogger as console } from 'debug-color2/logger';\n\nexport async function publishRetry(cwd?: string)\n{\n\treturn Bluebird.resolve(wsPkgListable(cwd))\n\t\t.mapSeries(async (row) => {\n\t\t\tconst { location: cwd } = row;\n\n\t\t\tconsole.dir(row);\n\n\t\t\tlet bool = await isPublishedByPackageJSON(row);\n\n\t\t\tif (!bool)\n\t\t\t{\n\t\t\t\tconsole.info(`try to publish ${row.name}\n\t\t\t@${row.version}`);\n\n\t\t\t\tconst cp = await crossSpawn('npm', [\n\t\t\t\t\t'publish',\n\t\t\t\t], {\n\t\t\t\t\tcwd,\n\t\t\t\t});\n\n\t\t\t\tconsole.log(cp.status, cp.error);\n\n\t\t\t\tawait Bluebird.delay(1000);\n\t\t\t}\n\n\t\t})\n\t;\n}\n\npublishRetry();\n\nexport {}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yarn-tool/publish-retry",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"yarn",
|
|
7
|
+
"yarn-tool",
|
|
8
|
+
"npm",
|
|
9
|
+
"lerna",
|
|
10
|
+
"workspaces",
|
|
11
|
+
"pkg",
|
|
12
|
+
"dependencies",
|
|
13
|
+
"monorepo",
|
|
14
|
+
"yarnlock",
|
|
15
|
+
"node-modules",
|
|
16
|
+
"packages",
|
|
17
|
+
"package",
|
|
18
|
+
"create-by-yarn-tool"
|
|
19
|
+
],
|
|
20
|
+
"homepage": "https://github.com/bluelovers/ws-yarn-workspaces/tree/master/packages/@yarn-tool/publish-retry#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/bluelovers/ws-yarn-workspaces/issues"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/bluelovers/ws-yarn-workspaces.git",
|
|
27
|
+
"directory": "packages/@yarn-tool/publish-retry"
|
|
28
|
+
},
|
|
29
|
+
"license": "ISC",
|
|
30
|
+
"author": "bluelovers",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"main": "index.js",
|
|
33
|
+
"scripts": {
|
|
34
|
+
"review": "yarn run review:coverage",
|
|
35
|
+
"review:coverage": "yarn run lint && yarn run coverage",
|
|
36
|
+
"review:test": "yarn run lint && yarn run test",
|
|
37
|
+
"coverage": "yarn run test -- --coverage",
|
|
38
|
+
"lint": "yarn run lint:eslint",
|
|
39
|
+
"lint:eslint": "ynpx eslint --ext .ts,.tsx,.mts,.cts ./",
|
|
40
|
+
"pretest": "echo pretest",
|
|
41
|
+
"test": "jest --passWithNoTests",
|
|
42
|
+
"test:jest": "jest --passWithNoTests",
|
|
43
|
+
"test:jest:snapshot": "yarn run test:jest -- -u",
|
|
44
|
+
"test:mocha": "ynpx --quiet -p ts-node -p mocha mocha -- --require ts-node/register \"!(node_modules)/**/*.{test,spec}.{ts,tsx}\"",
|
|
45
|
+
"test:snapshot": "yarn run test -- -u",
|
|
46
|
+
"test:tsdx": "ynpx @bluelovers/tsdx test --passWithNoTests",
|
|
47
|
+
"build:dts:bundle": "ynpx dts-bundle-generator -o ./dist/index.d.ts ./src/index.ts --no-banner --inline-declare-global & echo build:dts:bundle",
|
|
48
|
+
"build:dts:copy": "copy .\\src\\index.d.ts .\\dist\\index.d.ts & echo build:dts",
|
|
49
|
+
"build:dts:tsc": "yarn run build:dts:tsc:emit && yarn run build:dts:copy",
|
|
50
|
+
"build:dts:tsc:emit": "tsc --emitDeclarationOnly --declaration --noEmit false",
|
|
51
|
+
"build:microbundle": "ynpx microbundle --target node",
|
|
52
|
+
"build:tsdx": "ynpx @bluelovers/tsdx build --target node --name index",
|
|
53
|
+
"ci:install": "echo ci:install",
|
|
54
|
+
"ci:build": "echo ci:build",
|
|
55
|
+
"preversion": "echo preversion && yarn run test",
|
|
56
|
+
"version": "echo version",
|
|
57
|
+
"postversion": "echo postversion",
|
|
58
|
+
"prepublish": "echo prepublish",
|
|
59
|
+
"prepare": "echo prepare",
|
|
60
|
+
"prepublishOnly": "echo prepublishOnly",
|
|
61
|
+
"prepublishOnly:update": "yarn run ncu && yarn run sort-package-json",
|
|
62
|
+
"prepack": "echo prepack",
|
|
63
|
+
"pack": "echo pack",
|
|
64
|
+
"postpack": "echo postpack",
|
|
65
|
+
"publish": "echo publish",
|
|
66
|
+
"postpublish": "echo postpublish",
|
|
67
|
+
"postpublishOnly": "echo postpublishOnly",
|
|
68
|
+
"ncu": "yarn-tool ncu -u",
|
|
69
|
+
"sort-package-json": "yarn-tool sort",
|
|
70
|
+
"tsc:showConfig": "ynpx get-current-tsconfig -p"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@yarn-tool/is-published": "^1.0.2",
|
|
74
|
+
"tslib": ">=2"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {},
|
|
77
|
+
"peerDependencies": {},
|
|
78
|
+
"packageManager": "yarn@1.22.19",
|
|
79
|
+
"publishConfig": {
|
|
80
|
+
"access": "public"
|
|
81
|
+
}
|
|
82
|
+
}
|