prepare-package 1.1.3 → 1.1.4
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/dist/index.js +13 -11
- package/package.json +1 -1
- package/src/index.js +13 -11
package/dist/index.js
CHANGED
|
@@ -40,21 +40,23 @@ module.exports = async function (options) {
|
|
|
40
40
|
console.log(chalk.blue(`[prepare-package]: output=${theirPackageJSON.preparePackage.output}`));
|
|
41
41
|
console.log(chalk.blue(`[prepare-package]: main=${theirPackageJSON.main}`));
|
|
42
42
|
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
43
|
+
// Set the paths relative to the cwd
|
|
44
|
+
const mainPath = path.resolve(options.cwd, theirPackageJSON.main);
|
|
45
|
+
const outputPath = path.resolve(options.cwd, theirPackageJSON.preparePackage.output);
|
|
46
|
+
const inputPath = path.resolve(options.cwd, theirPackageJSON.preparePackage.input);
|
|
47
|
+
|
|
48
|
+
// Remove the output folder if it exists
|
|
49
|
+
if (jetpack.exists(outputPath)) {
|
|
50
|
+
jetpack.remove(outputPath);
|
|
51
|
+
}
|
|
47
52
|
|
|
48
|
-
// Copy the input folder to the output folder
|
|
49
|
-
jetpack.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)
|
|
53
|
+
// Copy the input folder to the output folder if it exists
|
|
54
|
+
if (jetpack.exists(inputPath)) {
|
|
55
|
+
jetpack.copy(inputPath, outputPath);
|
|
56
|
+
}
|
|
53
57
|
|
|
54
58
|
// Only do this part on the actual package that is using THIS package because we dont't want to replace THIS {version}
|
|
55
59
|
if (isLivePreparation) {
|
|
56
|
-
const mainPath = path.resolve(options.cwd, theirPackageJSON.main);
|
|
57
|
-
|
|
58
60
|
// Replace the main file
|
|
59
61
|
jetpack.write(
|
|
60
62
|
mainPath,
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -40,21 +40,23 @@ module.exports = async function (options) {
|
|
|
40
40
|
console.log(chalk.blue(`[prepare-package]: output=${theirPackageJSON.preparePackage.output}`));
|
|
41
41
|
console.log(chalk.blue(`[prepare-package]: main=${theirPackageJSON.main}`));
|
|
42
42
|
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
43
|
+
// Set the paths relative to the cwd
|
|
44
|
+
const mainPath = path.resolve(options.cwd, theirPackageJSON.main);
|
|
45
|
+
const outputPath = path.resolve(options.cwd, theirPackageJSON.preparePackage.output);
|
|
46
|
+
const inputPath = path.resolve(options.cwd, theirPackageJSON.preparePackage.input);
|
|
47
|
+
|
|
48
|
+
// Remove the output folder if it exists
|
|
49
|
+
if (jetpack.exists(outputPath)) {
|
|
50
|
+
jetpack.remove(outputPath);
|
|
51
|
+
}
|
|
47
52
|
|
|
48
|
-
// Copy the input folder to the output folder
|
|
49
|
-
jetpack.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)
|
|
53
|
+
// Copy the input folder to the output folder if it exists
|
|
54
|
+
if (jetpack.exists(inputPath)) {
|
|
55
|
+
jetpack.copy(inputPath, outputPath);
|
|
56
|
+
}
|
|
53
57
|
|
|
54
58
|
// Only do this part on the actual package that is using THIS package because we dont't want to replace THIS {version}
|
|
55
59
|
if (isLivePreparation) {
|
|
56
|
-
const mainPath = path.resolve(options.cwd, theirPackageJSON.main);
|
|
57
|
-
|
|
58
60
|
// Replace the main file
|
|
59
61
|
jetpack.write(
|
|
60
62
|
mainPath,
|