@fastly/compute-js-static-publish 2.2.2 → 2.3.0-alpha.0

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 (56) hide show
  1. package/build/assets.d.ts +8 -0
  2. package/build/assets.d.ts.map +1 -0
  3. package/build/assets.js +24 -0
  4. package/build/build-static.d.ts +3 -0
  5. package/build/build-static.d.ts.map +1 -0
  6. package/build/build-static.js +0 -3
  7. package/build/cli.d.ts +3 -0
  8. package/build/cli.d.ts.map +1 -0
  9. package/build/cli.js +77 -0
  10. package/build/index.d.ts +3 -0
  11. package/build/index.d.ts.map +1 -0
  12. package/build/index.js +2 -77
  13. package/build/init-app.d.ts +3 -0
  14. package/build/init-app.d.ts.map +1 -0
  15. package/build/presets/implementations/create-react-app.d.ts +16 -0
  16. package/build/presets/implementations/create-react-app.d.ts.map +1 -0
  17. package/build/presets/implementations/docusaurus.d.ts +11 -0
  18. package/build/presets/implementations/docusaurus.d.ts.map +1 -0
  19. package/build/presets/implementations/gatsby.d.ts +11 -0
  20. package/build/presets/implementations/gatsby.d.ts.map +1 -0
  21. package/build/presets/implementations/next.d.ts +11 -0
  22. package/build/presets/implementations/next.d.ts.map +1 -0
  23. package/build/presets/implementations/sveltekit.d.ts +11 -0
  24. package/build/presets/implementations/sveltekit.d.ts.map +1 -0
  25. package/build/presets/implementations/vite.d.ts +11 -0
  26. package/build/presets/implementations/vite.d.ts.map +1 -0
  27. package/build/presets/index.d.ts +3 -0
  28. package/build/presets/index.d.ts.map +1 -0
  29. package/build/presets/preset-base.d.ts +18 -0
  30. package/build/presets/preset-base.d.ts.map +1 -0
  31. package/build/static-assets.d.ts +8 -0
  32. package/build/static-assets.d.ts.map +1 -0
  33. package/build/static-assets.js +24 -0
  34. package/build/types.d.ts +26 -0
  35. package/build/types.d.ts.map +1 -0
  36. package/build/types.js +1 -0
  37. package/package.json +13 -4
  38. package/.idea/compute-js-static-publish.iml +0 -12
  39. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  40. package/.idea/jsLibraryMappings.xml +0 -6
  41. package/.idea/misc.xml +0 -6
  42. package/.idea/modules.xml +0 -8
  43. package/.idea/vcs.xml +0 -6
  44. package/src/build-static.ts +0 -245
  45. package/src/content-types.ts +0 -7
  46. package/src/index.ts +0 -89
  47. package/src/init-app.ts +0 -331
  48. package/src/presets/implementations/create-react-app.ts +0 -34
  49. package/src/presets/implementations/docusaurus.ts +0 -13
  50. package/src/presets/implementations/gatsby.ts +0 -13
  51. package/src/presets/implementations/next.ts +0 -13
  52. package/src/presets/implementations/sveltekit.ts +0 -13
  53. package/src/presets/implementations/vite.ts +0 -13
  54. package/src/presets/index.ts +0 -18
  55. package/src/presets/preset-base.ts +0 -18
  56. package/tsconfig.json +0 -19
@@ -1,34 +0,0 @@
1
- import { IPresetBase } from '../preset-base.js';
2
-
3
- export class CreateReactAppPreset implements IPresetBase {
4
- name = 'Create React App';
5
- defaultOptions = {
6
- 'public-dir': './build',
7
- 'static-dir': '[public-dir]/static',
8
- name: 'my-create-react-app',
9
- description: 'Compute@Edge static site from create-react-app',
10
- };
11
-
12
- check(packageJson: any): boolean {
13
- if(packageJson == null) {
14
- console.error("❌ Can't read/parse package.json");
15
- console.error("Run this from a create-react-app project directory.");
16
- return false;
17
- }
18
- if(packageJson?.dependencies?.['react-scripts'] == null) {
19
- console.error("❌ Can't find react-scripts in dependencies");
20
- console.error("Run this from a create-react-app project directory.");
21
- console.log("If this is a project created with create-react-app and has since been ejected, specify preset cra-eject to skip this check.")
22
- return false;
23
- }
24
- return true;
25
- }
26
-
27
- }
28
-
29
- export class CreateReactAppEjectedPreset extends CreateReactAppPreset {
30
- name = 'Create React App (Ejected)';
31
- check() {
32
- return true;
33
- }
34
- }
@@ -1,13 +0,0 @@
1
- import { IPresetBase } from '../preset-base.js';
2
-
3
- export class DocusaurusPreset implements IPresetBase {
4
- name = 'Docusaurus';
5
- defaultOptions = {
6
- 'public-dir': './build',
7
- name: 'my-docusaurus-app',
8
- description: 'Compute@Edge static site from docusaurus',
9
- };
10
- check() {
11
- return true;
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import { IPresetBase } from '../preset-base.js';
2
-
3
- export class GatsbyPreset implements IPresetBase {
4
- name = 'Gatsby';
5
- defaultOptions = {
6
- 'public-dir': './public',
7
- name: 'my-gatsby-app',
8
- description: 'Compute@Edge static site from Gatsby',
9
- };
10
- check() {
11
- return true;
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import { IPresetBase } from '../preset-base.js';
2
-
3
- export class NextJsPreset implements IPresetBase {
4
- name = 'Next.js';
5
- defaultOptions = {
6
- 'public-dir': './out',
7
- name: 'my-next-app',
8
- description: 'Compute@Edge static site from Next.js',
9
- };
10
- check() {
11
- return true;
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import { IPresetBase } from '../preset-base.js';
2
-
3
- export class SvelteKitPreset implements IPresetBase {
4
- name = 'SvelteKit';
5
- defaultOptions = {
6
- 'public-dir': './dist',
7
- name: 'my-sveltekit-app',
8
- description: 'Compute@Edge static site from SvelteKit',
9
- };
10
- check() {
11
- return true;
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import { IPresetBase } from '../preset-base.js';
2
-
3
- export class VitePreset implements IPresetBase {
4
- name = 'Vite';
5
- defaultOptions = {
6
- 'public-dir': './dist',
7
- name: 'my-vite-app',
8
- description: 'Compute@Edge static site from Vite',
9
- };
10
- check() {
11
- return true;
12
- }
13
- }
@@ -1,18 +0,0 @@
1
- import { IPresetBase } from './preset-base.js';
2
- import { CreateReactAppPreset, CreateReactAppEjectedPreset } from './implementations/create-react-app.js';
3
- import { VitePreset } from './implementations/vite.js';
4
- import { SvelteKitPreset } from './implementations/sveltekit.js';
5
- import { NextJsPreset } from './implementations/next.js';
6
- import { GatsbyPreset } from './implementations/gatsby.js';
7
- import { DocusaurusPreset } from './implementations/docusaurus.js';
8
-
9
- export const presets: Record<string, new() => IPresetBase> = {
10
- 'cra': CreateReactAppPreset,
11
- 'create-react-app': CreateReactAppPreset,
12
- 'cra-eject': CreateReactAppEjectedPreset,
13
- 'vite': VitePreset,
14
- 'sveltekit': SvelteKitPreset,
15
- 'next': NextJsPreset,
16
- 'gatsby': GatsbyPreset,
17
- 'docusaurus': DocusaurusPreset,
18
- };
@@ -1,18 +0,0 @@
1
- export type AppOptions = {
2
- 'public-dir': string | undefined,
3
- 'static-dir': string | undefined,
4
- spa: string | null | undefined,
5
- 'not-found-page': string | null | undefined,
6
- 'auto-index': string[] | null | undefined,
7
- 'auto-ext': string[] | null | undefined,
8
- name: string,
9
- author: string,
10
- description: string,
11
- 'service-id': string | undefined,
12
- };
13
-
14
- export interface IPresetBase {
15
- name: string;
16
- defaultOptions: Partial<AppOptions>;
17
- check(packageJson: any | null, options: AppOptions): boolean;
18
- }
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "./src",
4
- "outDir": "./build/",
5
- "target": "es2018",
6
- "module": "node16",
7
- "resolveJsonModule": true,
8
- "strict": true,
9
- "skipLibCheck": true,
10
- "moduleResolution": "node16"
11
- },
12
- "include": [
13
- "src/**/*.ts",
14
- "test/**/*.ts"
15
- ],
16
- "exclude": [
17
- "node_modules",
18
- ]
19
- }