esm.dev 1.8.25 → 1.8.27
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 +1 -1
- package/src/lib/MustacheGenerator.ts +1 -1
- package/src/lib/login.ts +2 -2
- package/src/lib/publish.ts +1 -1
- package/src/lib/republish.ts +1 -1
- package/src/lib/server.ts +1 -1
- package/src/lib/unpublish.ts +1 -1
- package/src/lib/until.ts +3 -3
- package/src/lib/watchIgnoreList.ts +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import Mustache from 'mustache'
|
|
|
2
2
|
import { Generator } from 'clipanion-generator-command/Generator'
|
|
3
3
|
|
|
4
4
|
export class MustacheGenerator extends Generator {
|
|
5
|
-
override renderTemplate(templateContext: any, template: string) {
|
|
5
|
+
override renderTemplate(templateContext: any, template: string): string {
|
|
6
6
|
return Mustache.render(template, templateContext, undefined, {
|
|
7
7
|
escape: (x) => x,
|
|
8
8
|
})
|
package/src/lib/login.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process'
|
|
2
2
|
|
|
3
|
-
export function login(registry: string) {
|
|
4
|
-
return new Promise
|
|
3
|
+
export function login(registry: string): Promise<number> {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
5
|
const child = spawn('npm', ['login', '--registry', registry, '--quiet'])
|
|
6
6
|
|
|
7
7
|
child.stderr.on('data', (d) => console.error(d.toString()))
|
package/src/lib/publish.ts
CHANGED
package/src/lib/republish.ts
CHANGED
package/src/lib/server.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { queue } from './queue.ts'
|
|
|
2
2
|
import { createServer } from 'node:http'
|
|
3
3
|
import httpProxy from 'http-proxy'
|
|
4
4
|
|
|
5
|
-
export function serve(port: number, esmOrigin: string) {
|
|
5
|
+
export function serve(port: number, esmOrigin: string): () => void {
|
|
6
6
|
const proxy = httpProxy.createProxyServer()
|
|
7
7
|
|
|
8
8
|
const server = createServer((req, res) => {
|
package/src/lib/unpublish.ts
CHANGED
package/src/lib/until.ts
CHANGED
|
@@ -8,14 +8,14 @@ export async function until({
|
|
|
8
8
|
interval: number
|
|
9
9
|
timeout: number
|
|
10
10
|
try(signal: AbortSignal): Promise<boolean>
|
|
11
|
-
}) {
|
|
11
|
+
}): Promise<boolean> {
|
|
12
12
|
const signal = AbortSignal.timeout(timeout)
|
|
13
13
|
while (!signal.aborted) {
|
|
14
14
|
try {
|
|
15
15
|
if (await Try(signal)) return true
|
|
16
16
|
} catch (error) {}
|
|
17
17
|
try {
|
|
18
|
-
await setTimeout(interval, { signal })
|
|
18
|
+
await setTimeout(interval, null, { signal })
|
|
19
19
|
} catch (error) {}
|
|
20
20
|
}
|
|
21
21
|
return false
|
|
@@ -29,7 +29,7 @@ export async function waitForEndpoint({
|
|
|
29
29
|
interval?: number
|
|
30
30
|
timeout?: number
|
|
31
31
|
endpoint: string
|
|
32
|
-
}) {
|
|
32
|
+
}): Promise<void> {
|
|
33
33
|
if (
|
|
34
34
|
!(await until({
|
|
35
35
|
interval,
|
|
@@ -5,7 +5,7 @@ import { access, constants } from 'node:fs/promises'
|
|
|
5
5
|
import * as path from 'node:path'
|
|
6
6
|
import { createInterface as createReadlineInterface } from 'node:readline/promises'
|
|
7
7
|
|
|
8
|
-
export async function getWatchIgnorer(dirname: string) {
|
|
8
|
+
export async function getWatchIgnorer(dirname: string): Promise<Ignorer> {
|
|
9
9
|
const ignoreList = await getIgnoreList(dirname)
|
|
10
10
|
return ignoreList?.basename === '.gitignore'
|
|
11
11
|
? createGitIgnore(ignoreList.ignoreList)
|