makepack 1.5.14 → 1.5.15

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.5.14",
3
+ "version": "1.5.15",
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": [
@@ -3,20 +3,12 @@ import { logger } from '../../helpers.js'
3
3
  import chalk from 'chalk';
4
4
  import makepackConfig from '../../makepack-config.js';
5
5
  import viteSetup from './vite.js';
6
- import { cosmiconfig } from "cosmiconfig";
6
+ import userExpress from './user-express.js';
7
7
 
8
8
  const app = express();
9
9
  const server = async () => {
10
10
  const config = await makepackConfig()
11
- const explorer = cosmiconfig('express');
12
- const result = await explorer.load('.server/express.js');
13
- if (result) {
14
- if (typeof result.config !== 'function') {
15
- logger.error('Configuration file must export a function')
16
- }
17
- result.config(app)
18
- }
19
-
11
+ userExpress(app)
20
12
  await viteSetup(app)
21
13
 
22
14
  app.use((_req, res) => {
@@ -17,7 +17,7 @@ if (typeof import.meta.url !== 'undefined') {
17
17
  }
18
18
 
19
19
  let server = null;
20
- function startServer(config) {
20
+ function startServer() {
21
21
  if (server) {
22
22
  server.kill('SIGINT');
23
23
  server = null;
@@ -48,7 +48,7 @@ const start = async () => {
48
48
  const build = () => {
49
49
  esbuild.build({
50
50
  entryPoints: [filename],
51
- outfile: '.server/express.js',
51
+ outfile: path.resolve(__dirname, 'custom-express.js'),
52
52
  bundle: true,
53
53
  format: 'esm',
54
54
  platform: 'node',
@@ -0,0 +1,10 @@
1
+ // express.ts
2
+ var express = (app) => {
3
+ app.get("/api/*", (req, res) => {
4
+ res.json({ message: "Hello" });
5
+ });
6
+ };
7
+ var express_default = express;
8
+ export {
9
+ express_default as default
10
+ };