makepack 1.6.4 → 1.6.6

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.6.4",
3
+ "version": "1.6.6",
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": [
@@ -6,17 +6,17 @@ import ora from 'ora'
6
6
  import { glob } from 'glob'
7
7
  import ts from 'typescript'
8
8
 
9
- const eBuild = async (ebconfig) => {
9
+ const eBuild = async (conf) => {
10
10
 
11
11
  await esbuild.build({
12
12
  jsx: 'automatic',
13
- ...ebconfig,
14
- outExtension: { '.js': ebconfig.format === "esm" ? '.mjs' : ".cjs" },
13
+ ...conf,
14
+ // outExtension: { '.js': ebconfig.format === 'esm' ? '.mjs' : '.cjs' },
15
15
  loader: {
16
16
  '.ts': 'ts',
17
17
  '.tsx': 'tsx'
18
18
  },
19
- outdir: path.join(process.cwd(), '.mpack'),
19
+ outdir: path.join(process.cwd(), '.mpack', conf.format === 'esm' ? '' : conf.format),
20
20
  })
21
21
  }
22
22
 
@@ -161,7 +161,7 @@ const build = async (args) => {
161
161
  spinner.succeed("package.json and readme.md files copied successfully!")
162
162
  console.log(chalk.green(`\nBuild completed successfully!`));
163
163
  console.log(`\nTo publish your package to npm:`);
164
- console.log(`${chalk.green(`npm run publish`)} or navigate to the ${chalk.green(`.mpack`)} directory and run ${chalk.green(`npm publish`)}`);
164
+ console.log(`${chalk.green(`npm run release`)} or navigate to the ${chalk.green(`.mpack`)} directory and run ${chalk.green(`npm publish`)}`);
165
165
  }
166
166
 
167
167
  export default build
@@ -27,24 +27,34 @@ export default async (info) => {
27
27
  description: "",
28
28
  keywords: [],
29
29
  sideEffects: false,
30
- // "exports": {
31
- // ".": {
32
- // "types": "./types/index.d.ts",
33
- // "require": "./cjs/index.js",
34
- // "import": "./index.js",
35
- // },
36
- // "./types/*": "./types/*.d.ts",
37
- // "./cjs/*": "./cjs/*.js",
38
- // "./*": {
39
- // "import": "./*.js",
40
- // "require": "./cjs/*.js"
41
- // }
42
- // },
43
30
  scripts: {
44
31
  "start": "makepack start",
45
32
  "build": "makepack build",
46
33
  "release": "makepack release"
47
34
  },
35
+ exports: {
36
+ ".": {
37
+ "require": {
38
+ "types": "./index.d.ts",
39
+ "default": "./cjs/index.js"
40
+ },
41
+ "import": {
42
+ "types": "./index.d.ts",
43
+ "default": "./index.js"
44
+ }
45
+ },
46
+ "./*": {
47
+ "require": {
48
+ "types": "./*.d.ts",
49
+ "default": "./cjs/*.js"
50
+ },
51
+ "import": {
52
+ "types": "./*.d.ts",
53
+ "default": "./*.js"
54
+ }
55
+ },
56
+ "./cjs": null,
57
+ },
48
58
  dependencies,
49
59
  devDependencies
50
60
  }