@fastly/compute-js-static-publish 8.0.1 → 8.1.0-beta.1

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.
Files changed (247) hide show
  1. package/DOCUMENTATION.md +779 -22
  2. package/README.md +2 -2
  3. package/README.short.md +2 -2
  4. package/build/cli/cli/commands/manage/clean.d.ts.map +1 -1
  5. package/build/cli/cli/commands/manage/clean.js +12 -7
  6. package/build/cli/cli/commands/manage/collections/delete.d.ts.map +1 -1
  7. package/build/cli/cli/commands/manage/collections/delete.js +29 -13
  8. package/build/cli/cli/commands/manage/collections/index.d.ts.map +1 -1
  9. package/build/cli/cli/commands/manage/collections/index.js +6 -1
  10. package/build/cli/cli/commands/manage/collections/list.d.ts.map +1 -1
  11. package/build/cli/cli/commands/manage/collections/list.js +47 -7
  12. package/build/cli/cli/commands/manage/collections/promote.d.ts.map +1 -1
  13. package/build/cli/cli/commands/manage/collections/promote.js +67 -20
  14. package/build/cli/cli/commands/manage/collections/update-expiration.d.ts.map +1 -1
  15. package/build/cli/cli/commands/manage/collections/update-expiration.js +10 -11
  16. package/build/cli/cli/commands/manage/deploy.d.ts +2 -0
  17. package/build/cli/cli/commands/manage/deploy.d.ts.map +1 -0
  18. package/build/cli/cli/commands/manage/deploy.js +194 -0
  19. package/build/cli/cli/commands/manage/dev.d.ts +2 -0
  20. package/build/cli/cli/commands/manage/dev.d.ts.map +1 -0
  21. package/build/cli/cli/commands/manage/dev.js +77 -0
  22. package/build/cli/cli/commands/manage/eject.d.ts +2 -0
  23. package/build/cli/cli/commands/manage/eject.d.ts.map +1 -0
  24. package/build/cli/cli/commands/manage/eject.js +155 -0
  25. package/build/cli/cli/commands/manage/index.d.ts.map +1 -1
  26. package/build/cli/cli/commands/manage/index.js +37 -1
  27. package/build/cli/cli/commands/manage/publish-content.d.ts.map +1 -1
  28. package/build/cli/cli/commands/manage/publish-content.js +78 -33
  29. package/build/cli/cli/commands/manage/status.d.ts +2 -0
  30. package/build/cli/cli/commands/manage/status.d.ts.map +1 -0
  31. package/build/cli/cli/commands/manage/status.js +162 -0
  32. package/build/cli/cli/commands/manage/template/index.d.ts +2 -0
  33. package/build/cli/cli/commands/manage/template/index.d.ts.map +1 -0
  34. package/build/cli/cli/commands/manage/template/index.js +42 -0
  35. package/build/cli/cli/commands/manage/template/init.d.ts +13 -0
  36. package/build/cli/cli/commands/manage/template/init.d.ts.map +1 -0
  37. package/build/cli/cli/commands/manage/template/init.js +172 -0
  38. package/build/cli/cli/commands/manage/upgrade.d.ts +2 -0
  39. package/build/cli/cli/commands/manage/upgrade.d.ts.map +1 -0
  40. package/build/cli/cli/commands/manage/upgrade.js +59 -0
  41. package/build/cli/cli/commands/run-dev-watch.d.ts +8 -0
  42. package/build/cli/cli/commands/run-dev-watch.d.ts.map +1 -0
  43. package/build/cli/cli/commands/run-dev-watch.js +41 -0
  44. package/build/cli/cli/commands/run-template-hook.d.ts +2 -0
  45. package/build/cli/cli/commands/run-template-hook.d.ts.map +1 -0
  46. package/build/cli/cli/commands/run-template-hook.js +28 -0
  47. package/build/cli/cli/commands/scaffold/app-template.d.ts +17 -0
  48. package/build/cli/cli/commands/scaffold/app-template.d.ts.map +1 -0
  49. package/build/cli/cli/commands/scaffold/app-template.js +54 -0
  50. package/build/cli/cli/commands/scaffold/fastly-toml-sections.d.ts +5 -0
  51. package/build/cli/cli/commands/scaffold/fastly-toml-sections.d.ts.map +1 -0
  52. package/build/cli/cli/commands/scaffold/fastly-toml-sections.js +154 -0
  53. package/build/cli/cli/commands/scaffold/generate-app.d.ts +47 -0
  54. package/build/cli/cli/commands/scaffold/generate-app.d.ts.map +1 -0
  55. package/build/cli/cli/commands/scaffold/generate-app.js +164 -0
  56. package/build/cli/cli/commands/scaffold/index.d.ts +6 -0
  57. package/build/cli/cli/commands/scaffold/index.d.ts.map +1 -1
  58. package/build/cli/cli/commands/scaffold/index.js +208 -290
  59. package/build/cli/cli/commands/scaffold/render.d.ts +7 -0
  60. package/build/cli/cli/commands/scaffold/render.d.ts.map +1 -0
  61. package/build/cli/cli/commands/scaffold/render.js +72 -0
  62. package/build/cli/cli/hono/build.d.ts +43 -0
  63. package/build/cli/cli/hono/build.d.ts.map +1 -0
  64. package/build/cli/cli/hono/build.js +297 -0
  65. package/build/cli/cli/index.js +98 -5
  66. package/build/cli/cli/managed/app.d.ts +21 -0
  67. package/build/cli/cli/managed/app.d.ts.map +1 -0
  68. package/build/cli/cli/managed/app.js +162 -0
  69. package/build/cli/cli/managed/command-helpers.d.ts +6 -0
  70. package/build/cli/cli/managed/command-helpers.d.ts.map +1 -0
  71. package/build/cli/cli/managed/command-helpers.js +81 -0
  72. package/build/cli/cli/managed/eject.d.ts +6 -0
  73. package/build/cli/cli/managed/eject.d.ts.map +1 -0
  74. package/build/cli/cli/managed/eject.js +68 -0
  75. package/build/cli/cli/managed/fastly-service.d.ts +8 -0
  76. package/build/cli/cli/managed/fastly-service.d.ts.map +1 -0
  77. package/build/cli/cli/managed/fastly-service.js +21 -0
  78. package/build/cli/cli/managed/fingerprint.d.ts +13 -0
  79. package/build/cli/cli/managed/fingerprint.d.ts.map +1 -0
  80. package/build/cli/cli/managed/fingerprint.js +60 -0
  81. package/build/cli/cli/managed/lockfile.d.ts +31 -0
  82. package/build/cli/cli/managed/lockfile.d.ts.map +1 -0
  83. package/build/cli/cli/managed/lockfile.js +62 -0
  84. package/build/cli/cli/managed/project-edit.d.ts +3 -0
  85. package/build/cli/cli/managed/project-edit.d.ts.map +1 -0
  86. package/build/cli/cli/managed/project-edit.js +35 -0
  87. package/build/cli/cli/managed/project-file.d.ts +16 -0
  88. package/build/cli/cli/managed/project-file.d.ts.map +1 -0
  89. package/build/cli/cli/managed/project-file.js +119 -0
  90. package/build/cli/cli/managed/template-init.d.ts +12 -0
  91. package/build/cli/cli/managed/template-init.d.ts.map +1 -0
  92. package/build/cli/cli/managed/template-init.js +120 -0
  93. package/build/cli/cli/managed/version-check.d.ts +25 -0
  94. package/build/cli/cli/managed/version-check.d.ts.map +1 -0
  95. package/build/cli/cli/managed/version-check.js +84 -0
  96. package/build/cli/cli/storage/kv-store-local-provider.d.ts +1 -0
  97. package/build/cli/cli/storage/kv-store-local-provider.d.ts.map +1 -1
  98. package/build/cli/cli/storage/kv-store-local-provider.js +6 -3
  99. package/build/cli/cli/storage/kv-store-provider.d.ts +1 -0
  100. package/build/cli/cli/storage/kv-store-provider.d.ts.map +1 -1
  101. package/build/cli/cli/storage/kv-store-provider.js +9 -1
  102. package/build/cli/cli/storage/s3-storage-provider.d.ts +1 -0
  103. package/build/cli/cli/storage/s3-storage-provider.d.ts.map +1 -1
  104. package/build/cli/cli/storage/s3-storage-provider.js +4 -0
  105. package/build/cli/cli/storage/storage-provider.d.ts +3 -0
  106. package/build/cli/cli/storage/storage-provider.d.ts.map +1 -1
  107. package/build/cli/cli/storage/storage-provider.js +32 -0
  108. package/build/cli/cli/util/api-token.d.ts.map +1 -1
  109. package/build/cli/cli/util/collection-name.d.ts +3 -0
  110. package/build/cli/cli/util/collection-name.d.ts.map +1 -0
  111. package/build/cli/cli/util/collection-name.js +24 -0
  112. package/build/cli/cli/util/collection-selection-flags.d.ts +13 -0
  113. package/build/cli/cli/util/collection-selection-flags.d.ts.map +1 -0
  114. package/build/cli/cli/util/collection-selection-flags.js +131 -0
  115. package/build/cli/cli/util/config.d.ts +13 -0
  116. package/build/cli/cli/util/config.d.ts.map +1 -1
  117. package/build/cli/cli/util/config.js +172 -38
  118. package/build/cli/cli/util/data.d.ts.map +1 -1
  119. package/build/cli/cli/util/global-options.d.ts +13 -0
  120. package/build/cli/cli/util/global-options.d.ts.map +1 -0
  121. package/build/cli/cli/util/global-options.js +53 -0
  122. package/build/cli/cli/util/kv-store-items.d.ts +1 -0
  123. package/build/cli/cli/util/kv-store-items.d.ts.map +1 -1
  124. package/build/cli/cli/util/kv-store-items.js +16 -40
  125. package/build/cli/cli/util/kv-store-local-server.d.ts +1 -1
  126. package/build/cli/cli/util/kv-store-local-server.d.ts.map +1 -1
  127. package/build/cli/cli/util/kv-store-local-server.js +4 -2
  128. package/build/cli/cli/util/output.d.ts +31 -0
  129. package/build/cli/cli/util/output.d.ts.map +1 -0
  130. package/build/cli/cli/util/output.js +139 -0
  131. package/build/cli/cli/util/package.d.ts +3 -0
  132. package/build/cli/cli/util/package.d.ts.map +1 -1
  133. package/build/cli/cli/util/package.js +12 -0
  134. package/build/cli/cli/util/progress.d.ts.map +1 -1
  135. package/build/cli/cli/util/purge.d.ts +6 -2
  136. package/build/cli/cli/util/purge.d.ts.map +1 -1
  137. package/build/cli/cli/util/purge.js +7 -2
  138. package/build/cli/cli/util/resources.d.ts +2 -0
  139. package/build/cli/cli/util/resources.d.ts.map +1 -0
  140. package/build/cli/cli/util/resources.js +8 -0
  141. package/build/cli/cli/util/service-id.d.ts +1 -0
  142. package/build/cli/cli/util/service-id.d.ts.map +1 -1
  143. package/build/cli/cli/util/service-id.js +5 -1
  144. package/build/cli/cli/util/variants.d.ts.map +1 -1
  145. package/build/cli/models/assets/index.d.ts +6 -0
  146. package/build/cli/models/assets/index.d.ts.map +1 -1
  147. package/build/cli/models/assets/index.js +24 -0
  148. package/build/cli/models/collections/index.d.ts +3 -0
  149. package/build/cli/models/collections/index.d.ts.map +1 -0
  150. package/build/cli/models/collections/index.js +15 -0
  151. package/build/cli/models/compression/index.d.ts +1 -1
  152. package/build/cli/models/compression/index.d.ts.map +1 -1
  153. package/build/cli/models/config/collection-selection.d.ts +55 -0
  154. package/build/cli/models/config/collection-selection.d.ts.map +1 -0
  155. package/build/cli/models/config/collection-selection.js +238 -0
  156. package/build/cli/models/config/item-patterns.d.ts +4 -0
  157. package/build/cli/models/config/item-patterns.d.ts.map +1 -0
  158. package/build/cli/models/config/item-patterns.js +43 -0
  159. package/build/cli/models/config/publish-content-config.d.ts +6 -1
  160. package/build/cli/models/config/publish-content-config.d.ts.map +1 -1
  161. package/build/cli/models/config/static-publish-project.d.ts +23 -0
  162. package/build/cli/models/config/static-publish-project.d.ts.map +1 -0
  163. package/build/cli/models/config/static-publish-project.js +11 -0
  164. package/build/cli/models/config/static-publish-rc.d.ts +25 -0
  165. package/build/cli/models/config/static-publish-rc.d.ts.map +1 -1
  166. package/build/cli/models/config/static-publish-rc.js +31 -0
  167. package/build/cli/models/config/template-settings.d.ts +10 -0
  168. package/build/cli/models/config/template-settings.d.ts.map +1 -0
  169. package/build/cli/models/config/template-settings.js +72 -0
  170. package/build/cli/models/server/index.d.ts.map +1 -1
  171. package/build/cli/models/server/index.js +6 -2
  172. package/build/server/hono/extensions.d.ts +48 -0
  173. package/build/server/hono/extensions.d.ts.map +1 -0
  174. package/build/server/hono/extensions.js +65 -0
  175. package/build/server/hono/index.d.ts +30 -0
  176. package/build/server/hono/index.d.ts.map +1 -0
  177. package/build/server/hono/index.js +72 -0
  178. package/build/server/hono/path.d.ts +7 -0
  179. package/build/server/hono/path.d.ts.map +1 -0
  180. package/build/server/hono/path.js +32 -0
  181. package/build/server/models/assets/index.d.ts +6 -0
  182. package/build/server/models/assets/index.d.ts.map +1 -1
  183. package/build/server/models/assets/index.js +24 -0
  184. package/build/server/models/collections/index.d.ts +3 -0
  185. package/build/server/models/collections/index.d.ts.map +1 -0
  186. package/build/server/models/collections/index.js +15 -0
  187. package/build/server/models/compression/index.d.ts +1 -1
  188. package/build/server/models/compression/index.d.ts.map +1 -1
  189. package/build/server/models/config/collection-selection.d.ts +55 -0
  190. package/build/server/models/config/collection-selection.d.ts.map +1 -0
  191. package/build/server/models/config/collection-selection.js +238 -0
  192. package/build/server/models/config/item-patterns.d.ts +4 -0
  193. package/build/server/models/config/item-patterns.d.ts.map +1 -0
  194. package/build/server/models/config/item-patterns.js +43 -0
  195. package/build/server/models/config/publish-content-config.d.ts +6 -1
  196. package/build/server/models/config/publish-content-config.d.ts.map +1 -1
  197. package/build/server/models/config/static-publish-project.d.ts +23 -0
  198. package/build/server/models/config/static-publish-project.d.ts.map +1 -0
  199. package/build/server/models/config/static-publish-project.js +11 -0
  200. package/build/server/models/config/static-publish-rc.d.ts +25 -0
  201. package/build/server/models/config/static-publish-rc.d.ts.map +1 -1
  202. package/build/server/models/config/static-publish-rc.js +31 -0
  203. package/build/server/models/server/index.d.ts.map +1 -1
  204. package/build/server/models/server/index.js +6 -2
  205. package/build/server/server/collection-selection/index.d.ts +11 -0
  206. package/build/server/server/collection-selection/index.d.ts.map +1 -0
  207. package/build/server/server/collection-selection/index.js +192 -0
  208. package/build/server/server/collection-selector/from-cookie.d.ts.map +1 -1
  209. package/build/server/server/collection-selector/from-cookie.js +6 -8
  210. package/build/server/server/collection-selector/from-request.d.ts.map +1 -1
  211. package/build/server/server/index.d.ts +4 -1
  212. package/build/server/server/index.d.ts.map +1 -1
  213. package/build/server/server/index.js +3 -1
  214. package/build/server/server/publisher-server/accept-html.d.ts +2 -0
  215. package/build/server/server/publisher-server/accept-html.d.ts.map +1 -0
  216. package/build/server/server/publisher-server/accept-html.js +50 -0
  217. package/build/server/server/publisher-server/index.d.ts +59 -7
  218. package/build/server/server/publisher-server/index.d.ts.map +1 -1
  219. package/build/server/server/publisher-server/index.js +362 -145
  220. package/build/server/server/publisher-server/response-cache.d.ts +3 -0
  221. package/build/server/server/publisher-server/response-cache.d.ts.map +1 -1
  222. package/build/server/server/publisher-server/response-cache.js +24 -1
  223. package/build/server/server/storage/kv-store-provider.d.ts.map +1 -1
  224. package/build/server/server/storage/s3-storage-provider.d.ts.map +1 -1
  225. package/build/server/server/storage/storage-provider.d.ts.map +1 -1
  226. package/build/server/server/util/body-length.d.ts.map +1 -1
  227. package/build/server/server/util/server-timing.d.ts.map +1 -1
  228. package/package.json +21 -3
  229. package/resources/app/fastly.toml.njk +58 -0
  230. package/resources/app/gitignore.njk +9 -0
  231. package/resources/app/publish-content.config.from-project.js.njk +9 -0
  232. package/resources/app/publish-content.config.js.njk +35 -0
  233. package/resources/app/static-publish.project.js.njk +83 -0
  234. package/resources/app/static-publish.rc.js.njk +43 -0
  235. package/resources/template-init/hono/_example.ts +22 -0
  236. package/resources/template-init/hono/tsconfig.json +17 -0
  237. package/resources/templates/hono/package-lock.json +4123 -0
  238. package/resources/templates/hono/package.json +15 -0
  239. package/resources/templates/hono/scripts/template_postinstall.js +10 -0
  240. package/resources/templates/hono/scripts/template_prebuild.js +8 -0
  241. package/resources/templates/hono/scripts/template_watch.js +15 -0
  242. package/resources/templates/hono/src/hono-extensions.generated.d.ts +5 -0
  243. package/resources/templates/hono/src/index.ts +53 -0
  244. package/resources/templates/hono/tsconfig.json +17 -0
  245. package/resources/templates/plain/package-lock.json +4088 -0
  246. package/resources/templates/plain/package.json +10 -0
  247. package/resources/templates/plain/src/index.js +34 -0
@@ -0,0 +1,7 @@
1
+ export declare function jsFilter(value: unknown, indent?: string): string;
2
+ export declare function tomlFilter(value: unknown): string;
3
+ export declare function tomlKeyFilter(value: unknown): string;
4
+ export declare function lineFilter(value: unknown): string;
5
+ export declare const RENDER_FILTERS: string[];
6
+ export declare function renderAppResource(name: string, context: object): string;
7
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/scaffold/render.ts"],"names":[],"mappings":"AAoBA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,MAAM,CAoBpE;AAID,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKjD;AAGD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKpD;AAID,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAKjD;AAED,eAAO,MAAM,cAAc,UAAsC,CAAC;AAKlE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAYvE"}
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Copyright Fastly, Inc.
3
+ * Licensed under the MIT license. See LICENSE file for details.
4
+ */
5
+ import path from 'node:path';
6
+ import nunjucks from 'nunjucks';
7
+ import { resourcesDir } from '../../util/resources.js';
8
+ // The templates in resources/app/ write each value through one of these
9
+ // filters, so that a value can never break the syntax of the file. Autoescape
10
+ // is off, because its escaping is for HTML.
11
+ // A value as a JS literal: a string, a number, a boolean, null, an array, or a
12
+ // plain object of these. A string is written with JSON.stringify(), so an
13
+ // array of strings is the same as in JSON. An object is written with one key
14
+ // on each line, and indent is the indentation of the line that has the value.
15
+ // A key is not quoted if it is a valid identifier.
16
+ export function jsFilter(value, indent = '') {
17
+ if (value === undefined || typeof value === 'function' || typeof value === 'symbol' || typeof value === 'bigint') {
18
+ throw new Error(`The js filter cannot write this value: ${String(value)}`);
19
+ }
20
+ if (value === null || typeof value !== 'object') {
21
+ return JSON.stringify(value);
22
+ }
23
+ const inner = indent + ' ';
24
+ if (Array.isArray(value)) {
25
+ if (value.every(item => item === null || typeof item !== 'object')) {
26
+ return JSON.stringify(value);
27
+ }
28
+ return `[\n${value.map(item => `${inner}${jsFilter(item, inner)},\n`).join('')}${indent}]`;
29
+ }
30
+ const entries = Object.entries(value).filter(([, item]) => item !== undefined);
31
+ if (entries.length === 0) {
32
+ return '{}';
33
+ }
34
+ const key = (name) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name) ? name : JSON.stringify(name);
35
+ return `{\n${entries.map(([name, item]) => `${inner}${key(name)}: ${jsFilter(item, inner)},\n`).join('')}${indent}}`;
36
+ }
37
+ // A string as a TOML basic string. JSON escapes the same characters as TOML,
38
+ // except DEL, which TOML does not allow in a basic string.
39
+ export function tomlFilter(value) {
40
+ if (typeof value !== 'string') {
41
+ throw new Error(`The toml filter needs a string: ${String(value)}`);
42
+ }
43
+ return JSON.stringify(value).replace(/\x7f/g, '\\u007F');
44
+ }
45
+ // A string as a TOML key: bare if TOML allows that, else quoted.
46
+ export function tomlKeyFilter(value) {
47
+ if (typeof value === 'string' && /^[A-Za-z0-9_-]+$/.test(value)) {
48
+ return value;
49
+ }
50
+ return tomlFilter(value);
51
+ }
52
+ // A string as one line of text, for files such as .gitignore that have no
53
+ // escaping.
54
+ export function lineFilter(value) {
55
+ if (typeof value !== 'string' || /[\r\n]/.test(value)) {
56
+ throw new Error(`The line filter needs a string with no line break: ${String(value)}`);
57
+ }
58
+ return value;
59
+ }
60
+ export const RENDER_FILTERS = ['js', 'toml', 'tomlKey', 'line'];
61
+ let env;
62
+ // Renders resources/app/<name>.njk.
63
+ export function renderAppResource(name, context) {
64
+ if (env == null) {
65
+ env = new nunjucks.Environment(new nunjucks.FileSystemLoader(path.resolve(resourcesDir, 'app')), { autoescape: false, throwOnUndefined: true, trimBlocks: true, lstripBlocks: true });
66
+ env.addFilter('js', jsFilter);
67
+ env.addFilter('toml', tomlFilter);
68
+ env.addFilter('tomlKey', tomlKeyFilter);
69
+ env.addFilter('line', lineFilter);
70
+ }
71
+ return env.render(`${name}.njk`, context);
72
+ }
@@ -0,0 +1,43 @@
1
+ export declare const HONO_EXTENSIONS_MANIFEST = "src/hono-extensions.generated.js";
2
+ export declare const DEFAULT_HONO_EXTENSIONS_DIR = "./hono-extensions";
3
+ export type HonoExtensionModule = {
4
+ name: string;
5
+ file: string;
6
+ };
7
+ export declare function listHonoExtensionModules(extensionsDir: string): HonoExtensionModule[];
8
+ export declare function honoExtensionsExternals(appDir: string): string[];
9
+ type Rc = {
10
+ build?: {
11
+ hono?: {
12
+ extensionsDir?: string;
13
+ };
14
+ };
15
+ templateOptions?: {
16
+ hono?: {
17
+ extensions?: Record<string, unknown>;
18
+ };
19
+ };
20
+ };
21
+ export declare function honoExtensionsDir(appDir: string, rc: Rc): string;
22
+ export declare function writeHonoExtensionsStub(options: {
23
+ appDir: string;
24
+ }): boolean;
25
+ export declare function checkProvidedVersions(appDir: string, extensionsDir: string): string[];
26
+ type Esbuild = {
27
+ build: (options: any) => Promise<{
28
+ outputFiles?: {
29
+ text: string;
30
+ }[];
31
+ }>;
32
+ };
33
+ export type BundleHonoExtensionsOptions = {
34
+ appDir: string;
35
+ esbuild: Esbuild;
36
+ };
37
+ export declare function bundleHonoExtensions(options: BundleHonoExtensionsOptions): Promise<boolean>;
38
+ export type HonoExtensionsWatcher = {
39
+ close: () => void;
40
+ };
41
+ export declare function watchHonoExtensions(options: BundleHonoExtensionsOptions): Promise<HonoExtensionsWatcher>;
42
+ export {};
43
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/cli/hono/build.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAI3E,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAK/D,MAAM,MAAM,mBAAmB,GAAG;IAGhC,IAAI,EAAE,MAAM,CAAC;IAEb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAMF,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAsBrF;AAUD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAIhE;AAED,KAAK,EAAE,GAAG;IACR,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,aAAa,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAC9C,eAAe,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAA;KAAE,CAAC;CACvE,CAAC;AASF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,MAAM,CAEhE;AA4BD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAE5E;AA0CD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,CA8BrF;AAKD,KAAK,OAAO,GAAG;IAAE,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,OAAO,CAAC;QAAE,WAAW,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,2BAA2B,GAAG;IAExC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAQF,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,OAAO,CAAC,CAuCjG;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAYF,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuF9G"}
@@ -0,0 +1,297 @@
1
+ /*
2
+ * Copyright Fastly, Inc.
3
+ * Licensed under the MIT license. See LICENSE file for details.
4
+ */
5
+ // @fastly/compute-js-static-publish/hono/build: helpers for the scripts of the
6
+ // hono template (scripts/template_prebuild.js, template_postinstall.js, and
7
+ // template_watch.js), which run in Node at build time and during development. The scripts stay in an ejected app, so this
8
+ // is a public API. Never import this module in the code of the app: the Wasm
9
+ // bundle must not contain it.
10
+ import fs from 'node:fs';
11
+ import path from 'node:path';
12
+ import { pathToFileURL } from 'node:url';
13
+ import { compareVersions } from '../managed/version-check.js';
14
+ // The file that the build writes into the app, and that src/index.ts imports.
15
+ export const HONO_EXTENSIONS_MANIFEST = 'src/hono-extensions.generated.js';
16
+ // The extensions folder when build.hono.extensionsDir is not set, relative to
17
+ // static-publish.rc.js.
18
+ export const DEFAULT_HONO_EXTENSIONS_DIR = './hono-extensions';
19
+ const THIS_PACKAGE = '@fastly/compute-js-static-publish';
20
+ const MODULE_FILE = /\.(?:js|mjs|ts|mts)$/;
21
+ // The modules of the extensions folder: the files directly in the folder with
22
+ // the extension .js, .mjs, .ts, or .mts, in file-name order. Files that start
23
+ // with '_' or '.', .d.ts files, and the files in subfolders (for example lib/)
24
+ // are not modules. Throws if two modules have the same name.
25
+ export function listHonoExtensionModules(extensionsDir) {
26
+ if (!fs.existsSync(extensionsDir)) {
27
+ return [];
28
+ }
29
+ const modules = fs.readdirSync(extensionsDir, { withFileTypes: true })
30
+ .filter(entry => entry.isFile() && !entry.name.startsWith('_') && !entry.name.startsWith('.'))
31
+ .map(entry => entry.name)
32
+ .filter(file => MODULE_FILE.test(file) && !/\.d\.[cm]?ts$/.test(file))
33
+ .sort()
34
+ .map(file => ({
35
+ name: file.replace(/\.[cm]?[jt]s$/, '').replace(/^\d+-/, ''),
36
+ file,
37
+ }));
38
+ const seen = new Map();
39
+ for (const module of modules) {
40
+ const other = seen.get(module.name);
41
+ if (other != null) {
42
+ throw new Error(`hono-extensions: ${other} and ${module.file} have the same module name '${module.name}'.`);
43
+ }
44
+ seen.set(module.name, module.file);
45
+ }
46
+ return modules;
47
+ }
48
+ function readJson(file) {
49
+ return JSON.parse(fs.readFileSync(file, 'utf-8'));
50
+ }
51
+ // The packages that the app provides to the extensions: each package in the
52
+ // dependencies of the app's package.json, and this package, each also with its
53
+ // subpaths, and the fastly:* modules of the runtime. The bundle of the
54
+ // extensions leaves their imports, so that the app's copy is the only copy.
55
+ export function honoExtensionsExternals(appDir) {
56
+ const packageJson = readJson(path.resolve(appDir, 'package.json'));
57
+ const names = new Set([...Object.keys(packageJson.dependencies ?? {}), THIS_PACKAGE]);
58
+ return [...[...names].sort().flatMap(name => [name, `${name}/*`]), 'fastly:*'];
59
+ }
60
+ async function loadRc(appDir) {
61
+ const rcPath = path.resolve(appDir, 'static-publish.rc.js');
62
+ return (await import(pathToFileURL(rcPath).href)).default ?? {};
63
+ }
64
+ // The extensions folder of the app: build.hono.extensionsDir, relative to
65
+ // static-publish.rc.js.
66
+ export function honoExtensionsDir(appDir, rc) {
67
+ return path.resolve(appDir, rc.build?.hono?.extensionsDir ?? DEFAULT_HONO_EXTENSIONS_DIR);
68
+ }
69
+ const GENERATED_HEADER = '// Generated by @fastly/compute-js-static-publish at each build. Do not edit.\n';
70
+ function entrySource(modules) {
71
+ const lines = modules.map((module, i) => `import m${i} from ${JSON.stringify(`./${module.file}`)};`);
72
+ const entries = modules
73
+ .map((module, i) => ` { name: ${JSON.stringify(module.name)}, file: ${JSON.stringify(module.file)}, module: m${i} },`)
74
+ .join('\n');
75
+ lines.push(`export const extensions = [\n${entries}\n];`);
76
+ return lines.join('\n') + '\n';
77
+ }
78
+ // Writes the manifest, but only if its content changes, so that a watcher of
79
+ // the app (fastly compute serve --watch) does not see a change that is not
80
+ // one. Returns true if it wrote the file.
81
+ function writeManifest(appDir, content) {
82
+ const file = path.resolve(appDir, HONO_EXTENSIONS_MANIFEST);
83
+ if (fs.existsSync(file) && fs.readFileSync(file, 'utf-8') === content) {
84
+ return false;
85
+ }
86
+ fs.mkdirSync(path.dirname(file), { recursive: true });
87
+ fs.writeFileSync(file, content, 'utf-8');
88
+ return true;
89
+ }
90
+ // Writes the manifest with no modules. Then src/index.ts can import it before
91
+ // the first build, so that an editor does not show an error.
92
+ export function writeHonoExtensionsStub(options) {
93
+ return writeManifest(options.appDir, GENERATED_HEADER + 'export const extensions = [];\n');
94
+ }
95
+ // A small part of semver ranges: ^, ~, >=, an exact version, and *. Returns
96
+ // null for a range that this cannot read, so that no warning is given.
97
+ function satisfiesRange(version, range) {
98
+ const r = range.trim();
99
+ if (r === '*' || r === '' || r === 'latest') {
100
+ return true;
101
+ }
102
+ const match = /^(\^|~|>=)?\s*v?(\d+)(?:\.(\d+))?(?:\.(\d+))?$/.exec(r);
103
+ if (match == null) {
104
+ return null;
105
+ }
106
+ const [, op, major, minor = '0', patch = '0'] = match;
107
+ const base = `${major}.${minor}.${patch}`;
108
+ const cmp = compareVersions(version, base);
109
+ if (cmp == null) {
110
+ return null;
111
+ }
112
+ const [vMajor, vMinor] = version.split('.').map(Number);
113
+ switch (op) {
114
+ case '>=':
115
+ return cmp >= 0;
116
+ case '^':
117
+ return cmp >= 0 && (Number(major) > 0 ? vMajor === Number(major) : vMajor === 0 && vMinor === Number(minor));
118
+ case '~':
119
+ return cmp >= 0 && vMajor === Number(major) && vMinor === Number(minor);
120
+ default:
121
+ // 4 is any 4.x.x, 4.13 is any 4.13.x, and 4.13.2 is only that version.
122
+ if (match[3] == null) {
123
+ return vMajor === Number(major);
124
+ }
125
+ if (match[4] == null) {
126
+ return vMajor === Number(major) && vMinor === Number(minor);
127
+ }
128
+ return cmp === 0;
129
+ }
130
+ }
131
+ // The warnings about the packages that the app provides: a range in the
132
+ // extensions folder's package.json that does not include the version that the
133
+ // app has. The build uses the app's copy, so this is only a warning.
134
+ export function checkProvidedVersions(appDir, extensionsDir) {
135
+ const folderPackageJsonPath = path.resolve(extensionsDir, 'package.json');
136
+ if (!fs.existsSync(folderPackageJsonPath)) {
137
+ return [];
138
+ }
139
+ const folderPackageJson = readJson(folderPackageJsonPath);
140
+ const ranges = {
141
+ ...folderPackageJson.devDependencies,
142
+ ...folderPackageJson.dependencies,
143
+ ...folderPackageJson.peerDependencies,
144
+ };
145
+ const provided = new Set(honoExtensionsExternals(appDir).filter(x => !x.endsWith('/*') && x !== 'fastly:*'));
146
+ const warnings = [];
147
+ for (const [name, range] of Object.entries(ranges)) {
148
+ if (!provided.has(name)) {
149
+ continue;
150
+ }
151
+ const installed = path.resolve(appDir, 'node_modules', name, 'package.json');
152
+ if (!fs.existsSync(installed)) {
153
+ continue;
154
+ }
155
+ const version = readJson(installed).version;
156
+ if (satisfiesRange(version, range) === false) {
157
+ warnings.push(`hono-extensions/package.json expects ${name} ${range}, but the app provides ${version}. ` +
158
+ `The build uses the app's ${name}. Run: npx @fastly/compute-js-static-publish template init`);
159
+ }
160
+ }
161
+ return warnings;
162
+ }
163
+ // Bundles the modules of the extensions folder into one file of the app
164
+ // (HONO_EXTENSIONS_MANIFEST), which src/index.ts imports. The packages that
165
+ // the app provides stay imports (see honoExtensionsExternals()), so that the
166
+ // Wasm bundle has one copy of each. Without the folder, or without modules, it
167
+ // writes the manifest with no modules. It writes the file only if its content
168
+ // changes. Returns true if it wrote the file.
169
+ export async function bundleHonoExtensions(options) {
170
+ const { appDir, esbuild } = options;
171
+ const rc = await loadRc(appDir);
172
+ const extensionsDir = honoExtensionsDir(appDir, rc);
173
+ if (!fs.existsSync(extensionsDir)) {
174
+ return writeHonoExtensionsStub({ appDir });
175
+ }
176
+ const modules = listHonoExtensionModules(extensionsDir);
177
+ const names = new Set(modules.map(module => module.name));
178
+ for (const name of Object.keys(rc.templateOptions?.hono?.extensions ?? {})) {
179
+ if (!names.has(name)) {
180
+ console.warn(`⚠️ templateOptions.hono.extensions.${name}: there is no module '${name}' in hono-extensions/.`);
181
+ }
182
+ }
183
+ for (const warning of checkProvidedVersions(appDir, extensionsDir)) {
184
+ console.warn(`⚠️ ${warning}`);
185
+ }
186
+ if (modules.length === 0) {
187
+ return writeHonoExtensionsStub({ appDir });
188
+ }
189
+ const result = await esbuild.build({
190
+ stdin: { contents: entrySource(modules), resolveDir: extensionsDir, sourcefile: 'hono-extensions.js', loader: 'js' },
191
+ bundle: true,
192
+ format: 'esm',
193
+ // As js-compute's own bundler, so that packages resolve the same way.
194
+ conditions: ['fastly'],
195
+ external: honoExtensionsExternals(appDir),
196
+ outfile: path.resolve(appDir, HONO_EXTENSIONS_MANIFEST),
197
+ banner: { js: GENERATED_HEADER.trimEnd() },
198
+ logLevel: 'warning',
199
+ write: false,
200
+ });
201
+ const text = result.outputFiles?.[0]?.text;
202
+ if (text == null) {
203
+ throw new Error('hono-extensions: esbuild gave no output.');
204
+ }
205
+ return writeManifest(appDir, text);
206
+ }
207
+ const WATCH_DELAY_MS = 100;
208
+ // Watches the extensions folder, and bundles the modules again after each
209
+ // change (see bundleHonoExtensions()). fastly compute serve --watch watches only
210
+ // the app directory: a new manifest is the change that makes it build the app
211
+ // again. All files in the folder count, except node_modules/, so that a new
212
+ // module and a changed helper are found. Imports from outside the folder are
213
+ // not watched. While the folder does not exist, it checks each second if the
214
+ // folder was made. A failed bundle shows the error and keeps the manifest that
215
+ // the app has.
216
+ export async function watchHonoExtensions(options) {
217
+ const { appDir } = options;
218
+ const extensionsDir = honoExtensionsDir(appDir, await loadRc(appDir));
219
+ let closed = false;
220
+ let folderWatcher;
221
+ let timer;
222
+ let running;
223
+ let again = false;
224
+ const bundle = async () => {
225
+ try {
226
+ if (await bundleHonoExtensions(options)) {
227
+ console.log(`🔄 ${HONO_EXTENSIONS_MANIFEST} changed.`);
228
+ }
229
+ }
230
+ catch (err) {
231
+ console.error(`❌ Could not bundle the Hono extensions: ${String(err instanceof Error ? err.message : err)}`);
232
+ }
233
+ };
234
+ // One bundle at a time. A change during a bundle starts one more bundle.
235
+ const run = () => {
236
+ if (running != null) {
237
+ again = true;
238
+ return;
239
+ }
240
+ running = (async () => {
241
+ do {
242
+ again = false;
243
+ await bundle();
244
+ watchFolder();
245
+ } while (again && !closed);
246
+ running = undefined;
247
+ })();
248
+ };
249
+ const schedule = () => {
250
+ if (closed) {
251
+ return;
252
+ }
253
+ clearTimeout(timer);
254
+ timer = setTimeout(run, WATCH_DELAY_MS);
255
+ };
256
+ // Watches the folder if it exists. Stops the watch if the folder was removed.
257
+ const watchFolder = () => {
258
+ if (closed) {
259
+ return;
260
+ }
261
+ const exists = fs.existsSync(extensionsDir);
262
+ if (exists && folderWatcher == null) {
263
+ folderWatcher = fs.watch(extensionsDir, { recursive: true }, (_event, file) => {
264
+ if (file == null || !file.toString().split(/[\\/]/).includes('node_modules')) {
265
+ schedule();
266
+ }
267
+ });
268
+ // For example, the folder was removed.
269
+ folderWatcher.on('error', () => {
270
+ folderWatcher?.close();
271
+ folderWatcher = undefined;
272
+ schedule();
273
+ });
274
+ }
275
+ else if (!exists && folderWatcher != null) {
276
+ folderWatcher.close();
277
+ folderWatcher = undefined;
278
+ }
279
+ };
280
+ // While the folder does not exist, a check each second. The timer also keeps
281
+ // the process of the watch script alive until close().
282
+ const poll = setInterval(() => {
283
+ if (folderWatcher == null && running == null && fs.existsSync(extensionsDir)) {
284
+ schedule();
285
+ }
286
+ }, 1000);
287
+ await bundle();
288
+ watchFolder();
289
+ return {
290
+ close: () => {
291
+ closed = true;
292
+ clearTimeout(timer);
293
+ clearInterval(poll);
294
+ folderWatcher?.close();
295
+ },
296
+ };
297
+ }
@@ -5,8 +5,16 @@
5
5
  */
6
6
  import fs from 'node:fs';
7
7
  import { availableParallelism } from 'node:os';
8
+ import path from 'node:path';
8
9
  import * as scaffoldCommand from './commands/scaffold/index.js';
9
10
  import * as manageCommands from './commands/manage/index.js';
11
+ import { runDevWatch } from './commands/run-dev-watch.js';
12
+ import { runTemplateHook } from './commands/run-template-hook.js';
13
+ import { parseGlobalOptions } from './util/global-options.js';
14
+ import { ConfigError, EXIT_USAGE, JSON_SCHEMA_VERSION, fail, isJsonMode, recordFailure, setJsonResult, setUpOutput, writeJsonOutput, } from './util/output.js';
15
+ import { getOwnVersion } from './util/package.js';
16
+ import { detectProjectMode } from './util/config.js';
17
+ import { PROJECT_FILE_NAME, RC_FILE_NAME } from '../models/config/static-publish-project.js';
10
18
  // Register storage builder providers
11
19
  import { registerStorageProviderBuilder } from './storage/storage-provider.js';
12
20
  import * as kvStoreProvider from './storage/kv-store-provider.js';
@@ -22,11 +30,96 @@ registerStorageProviderBuilder(s3StorageProvider.buildStoreProvider);
22
30
  if (process.env.UV_THREADPOOL_SIZE == null) {
23
31
  process.env.UV_THREADPOOL_SIZE = String(Math.max(4, Math.min(availableParallelism(), 16)));
24
32
  }
25
- if (!fs.existsSync('./static-publish.rc.js')) {
26
- console.log("🧑‍💻Fastly Compute JavaScript Static Publisher (Scaffolding mode)");
27
- await scaffoldCommand.action(process.argv);
33
+ // The template hooks of an app call this on each install and build. It works
34
+ // in any directory and prints no banner.
35
+ if (process.argv[2] === 'run-template-hook') {
36
+ process.exitCode = runTemplateHook(process.argv[3]);
37
+ }
38
+ else if (process.argv[2] === 'run-dev-watch') {
39
+ // The dev:watch script of an app calls this. It works in any directory and
40
+ // prints no banner.
41
+ process.exitCode = await runDevWatch(process.argv.slice(3));
28
42
  }
29
43
  else {
30
- console.log("🧑‍💻Fastly Compute JavaScript Static Publisher (Management mode)");
31
- await manageCommands.action(process.argv);
44
+ await main();
45
+ }
46
+ async function main() {
47
+ const globalOptions = parseGlobalOptions(process.argv.slice(2), process.env);
48
+ if ('error' in globalOptions) {
49
+ console.error(`❌ ${globalOptions.error}`);
50
+ process.exitCode = EXIT_USAGE;
51
+ // The output is not set up yet, so write the JSON object here.
52
+ if (process.argv.includes('--json')) {
53
+ const error = { code: 'usage', message: globalOptions.error };
54
+ process.stdout.write(JSON.stringify({ schemaVersion: JSON_SCHEMA_VERSION, error }, undefined, 2) + '\n');
55
+ }
56
+ return;
57
+ }
58
+ setUpOutput(globalOptions, process.env);
59
+ try {
60
+ await run(globalOptions);
61
+ }
62
+ catch (err) {
63
+ if (err instanceof ConfigError) {
64
+ fail('config-invalid', err.message);
65
+ }
66
+ else {
67
+ // Through console.error(), so that secrets are redacted.
68
+ console.error(err);
69
+ recordFailure('failed', String(err instanceof Error ? err.message : err));
70
+ }
71
+ }
72
+ writeJsonOutput();
73
+ }
74
+ async function run(globalOptions) {
75
+ // --version works in any directory, before the mode is detected.
76
+ if (globalOptions.version) {
77
+ if (isJsonMode()) {
78
+ setJsonResult({ version: getOwnVersion() });
79
+ }
80
+ else {
81
+ process.stdout.write(getOwnVersion() + '\n');
82
+ }
83
+ return;
84
+ }
85
+ if (globalOptions.projectDir != null) {
86
+ const projectDir = path.resolve(globalOptions.projectDir);
87
+ if (!fs.existsSync(projectDir) || !fs.statSync(projectDir).isDirectory()) {
88
+ fail('project-dir-not-found', `--project-dir '${globalOptions.projectDir}' is not a directory.`);
89
+ return;
90
+ }
91
+ if (!fs.existsSync(path.resolve(projectDir, RC_FILE_NAME)) &&
92
+ !fs.existsSync(path.resolve(projectDir, PROJECT_FILE_NAME))) {
93
+ fail('project-dir-not-found', `--project-dir '${globalOptions.projectDir}' has no ${RC_FILE_NAME} or ${PROJECT_FILE_NAME}.`);
94
+ console.error(` * Give the directory of the app, for example --project-dir=./compute-js. To scaffold an app in another directory, use --output.`);
95
+ return;
96
+ }
97
+ // After this, all relative paths are relative to the project dir: the paths
98
+ // in the config files, and the paths in the arguments.
99
+ process.chdir(projectDir);
100
+ }
101
+ // The commands get process.argv without the global options. command-line-args
102
+ // removes the first two items (node and the script) only if it gets
103
+ // process.argv itself, so change it in place.
104
+ process.argv.splice(2, process.argv.length - 2, ...globalOptions.argv);
105
+ const mode = detectProjectMode();
106
+ if (mode === 'conflict') {
107
+ fail('config-invalid', `This directory has both ${PROJECT_FILE_NAME} (a managed project) and ${RC_FILE_NAME} (an ejected app). Remove one of them.`);
108
+ return;
109
+ }
110
+ if (mode === 'scaffold') {
111
+ console.log("🧑‍💻Fastly Compute JavaScript Static Publisher (Scaffolding mode)");
112
+ if (isJsonMode()) {
113
+ fail('json-not-supported', '--json is not supported for scaffolding.');
114
+ return;
115
+ }
116
+ await scaffoldCommand.action(process.argv);
117
+ }
118
+ else {
119
+ console.log(`🧑‍💻Fastly Compute JavaScript Static Publisher (Management mode${mode === 'managed' ? ', managed project' : ''})`);
120
+ if (globalOptions.projectDir != null) {
121
+ console.log(` | Project directory: ${process.cwd()}`);
122
+ }
123
+ await manageCommands.action(process.argv);
124
+ }
32
125
  }
@@ -0,0 +1,21 @@
1
+ import { type StaticPublishProjectNormalized } from '../util/config.js';
2
+ import { type AppConfig } from '../commands/scaffold/generate-app.js';
3
+ export declare function managedAppConfig(projectDir: string, project: StaticPublishProjectNormalized, appDirOverride?: string): Promise<AppConfig>;
4
+ export declare function writeManagedAppFiles(appDir: string, files: Record<string, string>): string[];
5
+ export declare function needsInstall(appDir: string): boolean;
6
+ export declare function installManagedApp(appDir: string): boolean;
7
+ export declare function folderFilesForFingerprint(dir: string, prefix: string): Record<string, string>;
8
+ export declare function managedAppState(projectDir: string, project: StaticPublishProjectNormalized): Promise<{
9
+ appDir: string;
10
+ appConfig: AppConfig;
11
+ files: Record<string, string>;
12
+ fingerprint: string;
13
+ }>;
14
+ export declare function prepareManagedApp(projectDir: string, project: StaticPublishProjectNormalized): Promise<{
15
+ appDir: string;
16
+ appConfig: AppConfig;
17
+ files: Record<string, string>;
18
+ fingerprint: string;
19
+ installed: boolean;
20
+ }>;
21
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../src/cli/managed/app.ts"],"names":[],"mappings":"AAUA,OAAO,EAAiC,KAAK,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AAGvG,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,sCAAsC,CAAC;AAYnF,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CA+B/I;AAKD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAe5F;AAcD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAGpD;AAID,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAezD;AAMD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmB7F;AAED,wBAAsB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B;;;;;GAqBhG;AAID,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B;;;;;;GASlG"}