@temporalio/create
Advanced tools
Comparing version 1.0.0 to 1.1.0
import got from 'got'; | ||
import { headers } from './headers.js'; | ||
const SAMPLE_REPO_CONTENTS = 'https://api.github.com/repos/temporalio/samples-typescript/contents/'; | ||
@@ -7,3 +8,3 @@ export async function fetchSamples() { | ||
// https://github.com/sindresorhus/got/blob/main/documentation/3-streams.md#response-1 | ||
response = await got(SAMPLE_REPO_CONTENTS); | ||
response = await got(SAMPLE_REPO_CONTENTS, { headers }); | ||
} | ||
@@ -10,0 +11,0 @@ catch (error) { |
@@ -10,2 +10,3 @@ // Modified from: https://github.com/vercel/next.js/blob/2425f4703c4c6164cecfdb6aa8f80046213f0cc6/packages/create-next-app/helpers/examples.ts | ||
import { getErrorCode } from './get-error-code.js'; | ||
import { headers } from './headers.js'; | ||
const pipeline = promisify(Stream.pipeline); | ||
@@ -15,3 +16,3 @@ export async function isUrlOk(url) { | ||
try { | ||
res = await got.head(url); | ||
res = await got.head(url, { headers }); | ||
} | ||
@@ -38,3 +39,3 @@ catch (e) { | ||
// https://github.com/sindresorhus/got/blob/main/documentation/3-streams.md#response-1 | ||
infoResponse = await got(repo); | ||
infoResponse = await got(repo, { headers }); | ||
} | ||
@@ -82,3 +83,3 @@ catch (error) { | ||
const archivePath = `${name}-${branch}${filePath ? `/${filePath}` : ''}`; | ||
await pipeline(got.stream(archiveUrl), tar.extract({ cwd: root, strip: filePath ? filePath.split('/').length + 1 : 1 }, [archivePath])); | ||
await pipeline(got.stream(archiveUrl, { headers }), tar.extract({ cwd: root, strip: filePath ? filePath.split('/').length + 1 : 1 }, [archivePath])); | ||
const files = await readdir(root); | ||
@@ -95,3 +96,3 @@ const pipelineFailed = files.length === 0; | ||
} | ||
await pipeline(got.stream('https://codeload.github.com/temporalio/samples-typescript/tar.gz/main'), tar.extract({ cwd: root, strip: 2 }, [`samples-typescript-main/${name}`])); | ||
await pipeline(got.stream('https://codeload.github.com/temporalio/samples-typescript/tar.gz/main', { headers }), tar.extract({ cwd: root, strip: 2 }, [`samples-typescript-main/${name}`])); | ||
try { | ||
@@ -98,0 +99,0 @@ await rm(path.join(root, `.npmrc`)); |
{ | ||
"name": "@temporalio/create", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Create a Temporal project from template", | ||
@@ -55,3 +55,3 @@ "main": "cli.js", | ||
], | ||
"gitHead": "c4fc4dc608bf58701c11b6ae02d1d63b4457718d" | ||
"gitHead": "132f23a47a93fecf3f39836b31f08ea837b30320" | ||
} |
import got from 'got'; | ||
import { headers } from './headers.js'; | ||
@@ -15,3 +16,3 @@ const SAMPLE_REPO_CONTENTS = 'https://api.github.com/repos/temporalio/samples-typescript/contents/'; | ||
// https://github.com/sindresorhus/got/blob/main/documentation/3-streams.md#response-1 | ||
response = await got(SAMPLE_REPO_CONTENTS); | ||
response = await got(SAMPLE_REPO_CONTENTS, { headers }); | ||
} catch (error) { | ||
@@ -18,0 +19,0 @@ throw new Error(`Unable to reach github.com`); |
@@ -10,2 +10,3 @@ // Modified from: https://github.com/vercel/next.js/blob/2425f4703c4c6164cecfdb6aa8f80046213f0cc6/packages/create-next-app/helpers/examples.ts | ||
import { getErrorCode } from './get-error-code.js'; | ||
import { headers } from './headers.js'; | ||
@@ -24,3 +25,3 @@ const pipeline = promisify(Stream.pipeline); | ||
try { | ||
res = await got.head(url); | ||
res = await got.head(url, { headers }); | ||
} catch (e) { | ||
@@ -50,3 +51,3 @@ return false; | ||
// https://github.com/sindresorhus/got/blob/main/documentation/3-streams.md#response-1 | ||
infoResponse = await got(repo); | ||
infoResponse = await got(repo, { headers }); | ||
} catch (error) { | ||
@@ -111,3 +112,3 @@ throw new Error(`Unable to fetch ${repo}`); | ||
await pipeline( | ||
got.stream(archiveUrl), | ||
got.stream(archiveUrl, { headers }), | ||
tar.extract({ cwd: root, strip: filePath ? filePath.split('/').length + 1 : 1 }, [archivePath]) | ||
@@ -135,3 +136,3 @@ ); | ||
await pipeline( | ||
got.stream('https://codeload.github.com/temporalio/samples-typescript/tar.gz/main'), | ||
got.stream('https://codeload.github.com/temporalio/samples-typescript/tar.gz/main', { headers }), | ||
tar.extract({ cwd: root, strip: 2 }, [`samples-typescript-main/${name}`]) | ||
@@ -138,0 +139,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92155
68
1664