makepack 1.6.5 → 1.6.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.6.5",
3
+ "version": "1.6.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": [
@@ -6,19 +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' },
15
- outbase: path.join(process.cwd(), 'src'),
16
- entryNames: '[dir]/[name]',
13
+ ...conf,
14
+ // outExtension: { '.js': ebconfig.format === 'esm' ? '.mjs' : '.cjs' },
17
15
  loader: {
18
16
  '.ts': 'ts',
19
17
  '.tsx': 'tsx'
20
18
  },
21
- outdir: path.join(process.cwd(), '.mpack'),
19
+ outdir: path.join(process.cwd(), '.mpack', conf.format === 'esm' ? '' : conf.format),
22
20
  })
23
21
  }
24
22
 
@@ -163,7 +161,7 @@ const build = async (args) => {
163
161
  spinner.succeed("package.json and readme.md files copied successfully!")
164
162
  console.log(chalk.green(`\nBuild completed successfully!`));
165
163
  console.log(`\nTo publish your package to npm:`);
166
- 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`)}`);
167
165
  }
168
166
 
169
167
  export default build
@@ -21,30 +21,40 @@ export default async (info) => {
21
21
  const json = {
22
22
  name: info.pdir,
23
23
  version: "1.0.0",
24
- main: `./index.cjs`,
25
- module: `./index.mjs`,
24
+ main: `./cjs/index.js`,
25
+ module: `./index.js`,
26
26
  types: `./index.d.ts`,
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
  }