esm.dev 1.5.2 → 1.5.4

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,48 +6,23 @@ It expects you to have a local version of ESM.sh and verdaccio running. It will
6
6
 
7
7
  ## Usage
8
8
 
9
- The simplest solution is to use docker-compose. Using the configuration below:
9
+ ### Prerequists
10
10
 
11
- `docker compose up`
11
+ - You have [docker](https://www.docker.com/) installed
12
+ - You have [docker compose](https://docs.docker.com/compose/) installed
13
+ - You have a JavaScript runtime installed ([Node.js](https://nodejs.org/), [Deno](https://deno.com/), [Bun](https://bun.sh/) etc)
12
14
 
13
- ```yaml
14
- services:
15
- esm.dev:
16
- image: ghcr.io/johngeorgewright/esm.dev:latest
17
- depends_on:
18
- - esm.sh
19
- - npm
20
- environment:
21
- - NPM_REGISTRY=http://npm:4873
22
- - ESM_ORIGIN=http://esm.sh:8080
23
- - ESM_STORAGE_PATH=/esmd
24
- - PORT=3000
25
- command:
26
- - start
27
- - /watch/*
28
- ports:
29
- - '3000:3000'
30
- volumes:
31
- - ./docker-storage/esm/esmd:/esmd
32
- # The following are paths to all the packages you wish to auto publish
33
- - ./packages/package-1:/watch/package-1:ro
34
- - ./packages/package-2:/watch/package-2:ro
15
+ ### Installation
35
16
 
36
- esm.sh:
37
- image: ghcr.io/esm-dev/esm.sh:latest
38
- environment:
39
- - NPM_REGISTRY=http://npm:4873
40
- - NPM_TOKEN=fake
41
- - LOG_LEVEL=debug
42
- ports:
43
- - '8080:8080'
44
- volumes:
45
- - ./docker-storage/esm/esmd:/esmd
17
+ ```bash
18
+ # Node.js
19
+ npx esm.dev init my-local-package-1 my-local-package-2 ...
20
+ ```
21
+
22
+ This will create a docker-compose file in your cwd. Now run it:
46
23
 
47
- npm:
48
- image: verdaccio/verdaccio:latest
49
- ports:
50
- - '4873:4873'
24
+ ```bash
25
+ docker compose up
51
26
  ```
52
27
 
53
28
  Once the above is running point your ESM modules to `localhost:3000`:
@@ -27,7 +27,7 @@ export class InitCommand extends PackagePathSpecific(MustacheGeneratorCommand) {
27
27
  npmRegistryURL;
28
28
  packages;
29
29
  async execute() {
30
- this.templateDir = path.join(import.meta.dirname, 'templates', 'init');
30
+ this.templateDir = path.resolve(import.meta.dirname, '..', '..', 'templates', 'init');
31
31
  this.destinationDir = this.outputDirectory;
32
32
  this.esmURL = new URL(this.esmOrigin);
33
33
  this.npmRegistryURL = new URL(this.registry);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esm.dev",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "TypeScript library template",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -44,7 +44,13 @@ export class InitCommand extends PackagePathSpecific(MustacheGeneratorCommand) {
44
44
  packages!: { path: string; basename: string }[]
45
45
 
46
46
  override async execute() {
47
- this.templateDir = path.join(import.meta.dirname, 'templates', 'init')
47
+ this.templateDir = path.resolve(
48
+ import.meta.dirname,
49
+ '..',
50
+ '..',
51
+ 'templates',
52
+ 'init',
53
+ )
48
54
  this.destinationDir = this.outputDirectory
49
55
  this.esmURL = new URL(this.esmOrigin)
50
56
  this.npmRegistryURL = new URL(this.registry)
@@ -22,7 +22,7 @@ services:
22
22
  {{/packages}}
23
23
 
24
24
  esm:
25
- image: ghcr.io/esm-dev/esm:latest
25
+ image: ghcr.io/esm-dev/esm.sh:latest
26
26
  environment:
27
27
  - NPM_REGISTRY=http://npm:{{npmRegistryURL.port}}
28
28
  - NPM_TOKEN=fake