makepack 1.3.5 → 1.3.7

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "makepack",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "type": "module",
5
5
  "description": "A CLI tool to create, build, and manage JavaScript, TypeScript, React, and React-TypeScript libraries for npm projects.",
6
6
  "files": [
@@ -24,7 +24,9 @@
24
24
  "url": "https://github.com/devnax/makepack/issues"
25
25
  },
26
26
  "homepage": "https://github.com/devnax/makepack#readme",
27
- "scripts": {},
27
+ "scripts": {
28
+ "start": "node ./src/index.js"
29
+ },
28
30
  "dependencies": {
29
31
  "chalk": "^5.4.1",
30
32
  "commander": "^12.1.0",
@@ -17,13 +17,13 @@ const pack = async (args) => {
17
17
  let loader = logLoader("Generating a production build for the package...")
18
18
  const esbuildConfig = await loadConfig('esbuild.config.js') || {}
19
19
 
20
- function build(format) {
21
- return esbuild.build({
22
- bundle: true,
23
- target: ['esnext'],
20
+ async function build(format) {
21
+ return esbuild.buildSync({
22
+ // bundle: true,
23
+ // target: ['esnext'],
24
24
  // splitting: format === 'esm', // Enable code splitting only for ESM
25
- sourcemap: true,
26
25
  minify: true,
26
+ sourcemap: true,
27
27
  jsx: 'automatic',
28
28
  loader: {
29
29
  '.ts': 'ts',
@@ -36,10 +36,8 @@ const pack = async (args) => {
36
36
  });
37
37
  }
38
38
 
39
- Promise.all([
40
- build('esm'),
41
- build('cjs'),
42
- ]).catch(() => process.exit(1));
39
+ await build('esm')
40
+ await build('cjs')
43
41
 
44
42
  loader.stop()
45
43
  loader = logLoader("🔄 Generating TypeScript declarations...")
package/src/helpers.js CHANGED
@@ -59,10 +59,10 @@ export const logger = {
59
59
 
60
60
 
61
61
  export const loadConfig = async (file) => {
62
- const viteConfigPath = path.resolve(process.cwd(), file);
63
- if (fs.existsSync(viteConfigPath)) {
62
+ const config = path.resolve(process.cwd(), file);
63
+ if (fs.existsSync(config)) {
64
64
  try {
65
- const c = await import(pathToFileURL(viteConfigPath).href)
65
+ const c = await import(pathToFileURL(config).href)
66
66
  return c.default || {}
67
67
  } catch (error) {
68
68
  }