esm.dev 1.5.4 → 1.6.0

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/README.md CHANGED
@@ -6,7 +6,7 @@ It expects you to have a local version of ESM.sh and verdaccio running. It will
6
6
 
7
7
  ## Usage
8
8
 
9
- ### Prerequists
9
+ ### Prerequisites
10
10
 
11
11
  - You have [docker](https://www.docker.com/) installed
12
12
  - You have [docker compose](https://docs.docker.com/compose/) installed
@@ -16,7 +16,7 @@ It expects you to have a local version of ESM.sh and verdaccio running. It will
16
16
 
17
17
  ```bash
18
18
  # Node.js
19
- npx esm.dev init my-local-package-1 my-local-package-2 ...
19
+ npx esm.dev init ./packages/my-local-package-1 ./packages/my-local-package-2 ...
20
20
  ```
21
21
 
22
22
  This will create a docker-compose file in your cwd. Now run it:
package/dist/cli.js CHANGED
@@ -7,12 +7,14 @@ import { TokenCommand } from './commands/TokenCommand.js';
7
7
  import { WaitForRegistryCommand } from './commands/WaitForRegistryCommand.js';
8
8
  import { StartCommand } from './commands/StartCommand.js';
9
9
  import { InitCommand } from './commands/InitCommand.js';
10
+ import { VersionCommand } from './commands/VersionCommand.js';
10
11
  runExit([
11
12
  InitCommand,
12
13
  LoginCommand,
13
14
  TokenCommand,
14
15
  RepublishCommand,
15
16
  StartCommand,
17
+ VersionCommand,
16
18
  WaitForRegistryCommand,
17
19
  WatchCommand,
18
20
  ]);
@@ -35,6 +35,7 @@ export class InitCommand extends PackagePathSpecific(MustacheGeneratorCommand) {
35
35
  path: packagePath,
36
36
  basename: path.basename(packagePath),
37
37
  }));
38
+ await this.removeDestinationFile('docker-compose.yaml', 'docker-compose.yml.mustache');
38
39
  await super.execute();
39
40
  }
40
41
  }
@@ -0,0 +1,12 @@
1
+ import { Command } from 'clipanion';
2
+ export class VersionCommand extends Command {
3
+ static paths = [['version']];
4
+ static usage = Command.Usage({
5
+ description: 'Display the version of esm.dev',
6
+ });
7
+ async execute() {
8
+ const path = await import('node:path');
9
+ const pckg = await Bun.file(path.resolve(import.meta.dirname, '..', '..', 'package.json')).json();
10
+ this.context.stdout.write(`${pckg.version}\n`);
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esm.dev",
3
- "version": "1.5.4",
3
+ "version": "1.6.0",
4
4
  "description": "TypeScript library template",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -11,7 +11,8 @@
11
11
  "esm.dev": "./dist/cli.js"
12
12
  },
13
13
  "scripts": {
14
- "build": "tsc",
14
+ "build": "bun run clean && tsc",
15
+ "clean": "rimraf dist",
15
16
  "esm.dev": "bun ./src/cli.ts",
16
17
  "prepare": "husky",
17
18
  "start": "docker compose up --detach --remove-orphans",
@@ -41,7 +42,7 @@
41
42
  "lint-staged": "16.0.0",
42
43
  "prettier": "3.5.3",
43
44
  "rimraf": "6.0.1",
44
- "semantic-release": "^24.2.3",
45
+ "semantic-release": "^24.2.4",
45
46
  "typescript": "5.8.3"
46
47
  },
47
48
  "lint-staged": {
@@ -51,16 +52,16 @@
51
52
  },
52
53
  "dependencies": {
53
54
  "clipanion": "^4.0.0-rc.4",
54
- "clipanion-generator-command": "^1.2.0",
55
+ "clipanion-generator-command": "^1.3.0",
55
56
  "escape-string-regexp": "^5.0.0",
56
57
  "glob": "^11.0.2",
57
58
  "http-proxy": "^1.18.1",
58
59
  "lodash.debounce": "^4.0.8",
59
60
  "mustache": "^4.2.0",
60
- "npm": "^11.3.0",
61
+ "npm": "^11.4.0",
61
62
  "ramda": "^0.30.1",
62
63
  "throat": "^6.0.2",
63
64
  "tslib": "^2.8.1",
64
- "zod": "^3.24.4"
65
+ "zod": "^3.25.13"
65
66
  }
66
67
  }
package/src/cli.ts CHANGED
@@ -7,6 +7,7 @@ import { TokenCommand } from './commands/TokenCommand.js'
7
7
  import { WaitForRegistryCommand } from './commands/WaitForRegistryCommand.js'
8
8
  import { StartCommand } from './commands/StartCommand.js'
9
9
  import { InitCommand } from './commands/InitCommand.js'
10
+ import { VersionCommand } from './commands/VersionCommand.js'
10
11
 
11
12
  runExit([
12
13
  InitCommand,
@@ -14,6 +15,7 @@ runExit([
14
15
  TokenCommand,
15
16
  RepublishCommand,
16
17
  StartCommand,
18
+ VersionCommand,
17
19
  WaitForRegistryCommand,
18
20
  WatchCommand,
19
21
  ])
@@ -58,6 +58,10 @@ export class InitCommand extends PackagePathSpecific(MustacheGeneratorCommand) {
58
58
  path: packagePath,
59
59
  basename: path.basename(packagePath),
60
60
  }))
61
+ await this.removeDestinationFile(
62
+ 'docker-compose.yaml',
63
+ 'docker-compose.yml.mustache',
64
+ )
61
65
  await super.execute()
62
66
  }
63
67
  }
@@ -0,0 +1,17 @@
1
+ import { Command } from 'clipanion'
2
+
3
+ export class VersionCommand extends Command {
4
+ static override paths = [['version']]
5
+
6
+ static override usage = Command.Usage({
7
+ description: 'Display the version of esm.dev',
8
+ })
9
+
10
+ override async execute(): Promise<number | void> {
11
+ const path = await import('node:path')
12
+ const pckg = await Bun.file(
13
+ path.resolve(import.meta.dirname, '..', '..', 'package.json'),
14
+ ).json()
15
+ this.context.stdout.write(`${pckg.version}\n`)
16
+ }
17
+ }