@netlify/spark-ui 1.31.0-alpha.5 → 1.31.0-alpha.6
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 +3 -4
- package/dist/components/preact/DropZone/DropZone.d.ts +23 -97
- package/dist/drop-core/analytics.d.ts +4 -15
- package/dist/drop-core/authedApi.d.ts +9 -22
- package/dist/drop-core/authedDropClient.d.ts +13 -55
- package/dist/drop-core/authedDropClient.js +5 -18
- package/dist/drop-core/buildClient.d.ts +19 -53
- package/dist/drop-core/buildClient.js +27 -40
- package/dist/drop-core/buildStash.d.ts +6 -20
- package/dist/drop-core/client.d.ts +1 -1
- package/dist/drop-core/constants.d.ts +1 -21
- package/dist/drop-core/deploy.d.ts +5 -17
- package/dist/drop-core/detectBuild.d.ts +8 -26
- package/dist/drop-core/errors.d.ts +8 -27
- package/dist/drop-core/fileTypes.d.ts +4 -14
- package/dist/drop-core/readFiles.d.ts +5 -11
- package/dist/drop-core/types.d.ts +2 -4
- package/dist/drop-core/zip.d.ts +7 -30
- package/package.json +1 -1
- package/packages/components/preact/DropZone/DropZone.tsx +27 -121
- package/packages/components/preact/DropZone/useDropDeploy.ts +27 -60
- package/packages/drop-core/analytics.ts +4 -15
- package/packages/drop-core/authedApi.ts +9 -22
- package/packages/drop-core/authedDropClient.ts +13 -55
- package/packages/drop-core/buildClient.test.ts +19 -4
- package/packages/drop-core/buildClient.ts +21 -63
- package/packages/drop-core/buildStash.ts +9 -25
- package/packages/drop-core/client.ts +6 -10
- package/packages/drop-core/constants.ts +7 -21
- package/packages/drop-core/deploy.ts +6 -22
- package/packages/drop-core/detectBuild.ts +15 -50
- package/packages/drop-core/errors.test.ts +3 -1
- package/packages/drop-core/errors.ts +9 -30
- package/packages/drop-core/fileTypes.ts +5 -19
- package/packages/drop-core/readFiles.ts +5 -12
- package/packages/drop-core/types.ts +2 -4
- package/packages/drop-core/zip.ts +7 -30
|
@@ -13,12 +13,7 @@ function escapeTomlString(value: string): string {
|
|
|
13
13
|
.replace(/\t/g, '\\t');
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
/**
|
|
17
|
-
* Render inferred settings as a `[build]` table. Only `command` and `publish`
|
|
18
|
-
* are written: everything else (functions directory, plugins, node version)
|
|
19
|
-
* is zero-config on Netlify's side and guessing at it would override detection
|
|
20
|
-
* that is better informed than we are.
|
|
21
|
-
*/
|
|
16
|
+
/** Renders a [build] table — command and publish only; everything else is zero-config server-side. */
|
|
22
17
|
export function generateNetlifyToml({ command, publish }: InferredBuildSettings): string {
|
|
23
18
|
return [
|
|
24
19
|
'[build]',
|
|
@@ -31,22 +26,14 @@ export function generateNetlifyToml({ command, publish }: InferredBuildSettings)
|
|
|
31
26
|
export interface ZipOptions {
|
|
32
27
|
/** Filename given to the produced `File`. Shows up as the build's source archive. */
|
|
33
28
|
name?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Synthesise a `netlify.toml` `[build]` table from `inferBuildSettings` when the
|
|
36
|
-
* drop doesn't declare one (default `true`). Set `false` to upload the files
|
|
37
|
-
* exactly as dropped and let buildbot resolve every setting itself.
|
|
38
|
-
*/
|
|
29
|
+
/** Synthesise a [build] table when the drop lacks one (default true); false uploads as-dropped. */
|
|
39
30
|
synthesizeNetlifyToml?: boolean;
|
|
40
31
|
}
|
|
41
32
|
|
|
42
33
|
export interface ZipResult {
|
|
43
34
|
/** The archive, ready to hand to `createBuildFromZip`. */
|
|
44
35
|
file: File;
|
|
45
|
-
/**
|
|
46
|
-
* The settings written into `netlify.toml`, or `null` when the archive is a
|
|
47
|
-
* faithful copy of the drop — either because it already declared a `[build]`
|
|
48
|
-
* table, or because nothing could be inferred with confidence.
|
|
49
|
-
*/
|
|
36
|
+
/** Settings written into netlify.toml, or null when the archive is a faithful copy. */
|
|
50
37
|
buildSettings: InferredBuildSettings | null;
|
|
51
38
|
}
|
|
52
39
|
|
|
@@ -58,20 +45,10 @@ function toBytes(content: ArrayBuffer): Uint8Array {
|
|
|
58
45
|
}
|
|
59
46
|
|
|
60
47
|
/**
|
|
61
|
-
* Zip
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* uses (see `readFiles`), so junk — dotfiles, `node_modules`, macOS metadata — is
|
|
66
|
-
* already gone and paths sit at the deploy root. Output directories (`dist/`,
|
|
67
|
-
* `build/`) are deliberately *not* stripped: buildbot regenerates them when
|
|
68
|
-
* there's a build command, and a drop whose `netlify.toml` publishes a committed
|
|
69
|
-
* directory without a command would break if we removed it.
|
|
70
|
-
*
|
|
71
|
-
* When the drop needs a build but declares no `[build]` table, an inferred one is
|
|
72
|
-
* written in (appended to an existing `netlify.toml`, or created if there is
|
|
73
|
-
* none) so buildbot doesn't publish the project's source. See
|
|
74
|
-
* `inferBuildSettings` for how conservative that inference is.
|
|
48
|
+
* Zip a read file set into the archive `POST /sites/{id}/builds` expects.
|
|
49
|
+
* Junk is already gone (readFiles); dist/build are deliberately kept — a drop
|
|
50
|
+
* publishing a committed directory without a command would break without them.
|
|
51
|
+
* A [build] table is synthesised when missing (appended, so redirects survive).
|
|
75
52
|
*/
|
|
76
53
|
export async function zipFiles(
|
|
77
54
|
files: ProcessedFile[],
|