makepack 1.5.3 → 1.5.5
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/package.json
CHANGED
|
@@ -5,10 +5,9 @@ import chalk from 'chalk'
|
|
|
5
5
|
import ora from 'ora'
|
|
6
6
|
import { glob } from 'glob'
|
|
7
7
|
import ts from 'typescript'
|
|
8
|
-
import { execSync } from '../../helpers.js'
|
|
9
8
|
import makepackConfig from '../../makepack-config.js'
|
|
10
9
|
|
|
11
|
-
const build = async (
|
|
10
|
+
const build = async () => {
|
|
12
11
|
|
|
13
12
|
const spinner = ora("Generating a production build for the package...").start();
|
|
14
13
|
|
|
@@ -69,19 +68,15 @@ const build = async (args) => {
|
|
|
69
68
|
const formatPackageJson = build.formatPackageJson || ((p) => p)
|
|
70
69
|
packageJson = formatPackageJson(packageJson)
|
|
71
70
|
|
|
72
|
-
fs.writeFileSync(path.join(process.cwd(), outdir, '/package.json'), JSON.stringify(packageJson, null, 2));
|
|
73
|
-
fs.copyFileSync(path.join(process.cwd(), '/readme.md'), path.join(process.cwd(), outdir, `/readme.md`))
|
|
71
|
+
fs.writeFileSync(path.join(process.cwd(), build.outdir, '/package.json'), JSON.stringify(packageJson, null, 2));
|
|
72
|
+
fs.copyFileSync(path.join(process.cwd(), '/readme.md'), path.join(process.cwd(), build.outdir, `/readme.md`))
|
|
74
73
|
spinner.succeed('Production build generated successfully! The package is ready for deployment.')
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} else {
|
|
82
|
-
console.log(`\nTo publish your package:`);
|
|
83
|
-
console.log(`${chalk.yellow(`1. Navigate to the ${outdir} directory:`)}\n ${chalk.green(`cd ./${outdir}`)}\n${chalk.yellow(`2. Publish the buildage to npm:`)}\n${chalk.green(`npm publish`)}\nYour buildage is ready to share with the world! 🚀`);
|
|
84
|
-
}
|
|
75
|
+
console.log(`\nTo publish your package:`);
|
|
76
|
+
console.log(`run: ${chalk.green(`makepack publish`)} to publish the package directly from the current project.`);
|
|
77
|
+
console.log(chalk.yellow(`OR`));
|
|
78
|
+
console.log(`${chalk.yellow(`Navigate to the ${build.outdir} directory:`)} ${chalk.green(`cd ./${build.outdir}`)} and run ${chalk.green(`npm publish`)}`);
|
|
79
|
+
|
|
85
80
|
} catch (error) {
|
|
86
81
|
spinner.fail("An error occurred while generating the production build.")
|
|
87
82
|
console.error(error);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'path'
|
|
2
2
|
import { execSync, logger } from '../../helpers.js'
|
|
3
3
|
import makepackConfig from '../../makepack-config.js'
|
|
4
|
+
import fs from 'fs-extra'
|
|
4
5
|
|
|
5
6
|
const publish = async () => {
|
|
6
7
|
const { build } = await makepackConfig()
|
|
@@ -12,7 +13,7 @@ const publish = async () => {
|
|
|
12
13
|
}
|
|
13
14
|
logger.info(`Publishing the production build to the npm repository...`)
|
|
14
15
|
execSync(`npm publish`, {
|
|
15
|
-
cwd:
|
|
16
|
+
cwd: buildDir
|
|
16
17
|
})
|
|
17
18
|
}
|
|
18
19
|
|