@deot/dev-linker 1.1.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 +5 -0
- package/dist/index.cjs.js +28 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +26 -0
- package/package.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chalk = require('chalk');
|
|
4
|
+
var ora = require('ora');
|
|
5
|
+
var devShared = require('@deot/dev-shared');
|
|
6
|
+
|
|
7
|
+
const run = (options) => devShared.Utils.autoCatch(async () => {
|
|
8
|
+
const locals = devShared.Locals.impl();
|
|
9
|
+
const { workspace, packageFolderNames } = locals;
|
|
10
|
+
if (!workspace) {
|
|
11
|
+
return devShared.Logger.log(`<link> Monorepo Supported Only.`);
|
|
12
|
+
}
|
|
13
|
+
if (typeof options.dryRun === 'undefined') {
|
|
14
|
+
options.dryRun = process.env.NODE_ENV === 'UNIT';
|
|
15
|
+
}
|
|
16
|
+
const command = `npx pnpm link ./${workspace}/`;
|
|
17
|
+
if (options.dryRun)
|
|
18
|
+
return devShared.Shell.spawn(`echo ${command}`);
|
|
19
|
+
const spinner = ora(`Links ...\n`);
|
|
20
|
+
spinner.start();
|
|
21
|
+
await Promise.all(packageFolderNames.map(i => {
|
|
22
|
+
return devShared.Shell.spawn(`${command}${i}`);
|
|
23
|
+
}));
|
|
24
|
+
spinner.stop();
|
|
25
|
+
devShared.Logger.log(`${chalk.green('Links Success')}`);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
exports.run = run;
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { Utils, Locals, Logger, Shell } from '@deot/dev-shared';
|
|
4
|
+
|
|
5
|
+
const run = (options) => Utils.autoCatch(async () => {
|
|
6
|
+
const locals = Locals.impl();
|
|
7
|
+
const { workspace, packageFolderNames } = locals;
|
|
8
|
+
if (!workspace) {
|
|
9
|
+
return Logger.log(`<link> Monorepo Supported Only.`);
|
|
10
|
+
}
|
|
11
|
+
if (typeof options.dryRun === 'undefined') {
|
|
12
|
+
options.dryRun = process.env.NODE_ENV === 'UNIT';
|
|
13
|
+
}
|
|
14
|
+
const command = `npx pnpm link ./${workspace}/`;
|
|
15
|
+
if (options.dryRun)
|
|
16
|
+
return Shell.spawn(`echo ${command}`);
|
|
17
|
+
const spinner = ora(`Links ...\n`);
|
|
18
|
+
spinner.start();
|
|
19
|
+
await Promise.all(packageFolderNames.map(i => {
|
|
20
|
+
return Shell.spawn(`${command}${i}`);
|
|
21
|
+
}));
|
|
22
|
+
spinner.stop();
|
|
23
|
+
Logger.log(`${chalk.green('Links Success')}`);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { run };
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deot/dev-linker",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"main": "dist/index.es.js",
|
|
5
|
+
"module": "dist/index.es.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@deot/dev-extract": "^1.1.0",
|
|
17
|
+
"@deot/dev-shared": "^1.1.0"
|
|
18
|
+
}
|
|
19
|
+
}
|