@netlify/build-info 6.6.1 → 6.7.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.
- package/bin.js +1 -1
- package/lib/{browser → src/browser}/file-system.d.ts +4 -3
- package/lib/{browser → src/browser}/file-system.js +5 -2
- package/lib/src/browser/file-system.js.map +1 -0
- package/lib/{build-systems → src/build-systems}/bazel.d.ts +1 -2
- package/lib/{build-systems → src/build-systems}/bazel.js +5 -2
- package/lib/src/build-systems/bazel.js.map +1 -0
- package/lib/{build-systems → src/build-systems}/buck.d.ts +1 -2
- package/lib/{build-systems → src/build-systems}/buck.js +5 -2
- package/lib/src/build-systems/buck.js.map +1 -0
- package/lib/src/build-systems/build-system.d.ts +38 -0
- package/lib/src/build-systems/build-system.js +30 -0
- package/lib/src/build-systems/build-system.js.map +1 -0
- package/lib/{build-systems → src/build-systems}/gradle.d.ts +1 -2
- package/lib/{build-systems → src/build-systems}/gradle.js +5 -2
- package/lib/src/build-systems/gradle.js.map +1 -0
- package/lib/src/build-systems/index.d.ts +11 -0
- package/lib/src/build-systems/index.js.map +1 -0
- package/lib/src/build-systems/lage.js.map +1 -0
- package/lib/{build-systems → src/build-systems}/moon.d.ts +1 -2
- package/lib/{build-systems → src/build-systems}/moon.js +5 -5
- package/lib/src/build-systems/moon.js.map +1 -0
- package/lib/{build-systems → src/build-systems}/nix.d.ts +1 -2
- package/lib/{build-systems → src/build-systems}/nix.js +5 -2
- package/lib/src/build-systems/nix.js.map +1 -0
- package/lib/src/build-systems/nrwl.d.ts +15 -0
- package/lib/src/build-systems/nrwl.js +73 -0
- package/lib/src/build-systems/nrwl.js.map +1 -0
- package/lib/{build-systems → src/build-systems}/pants.d.ts +1 -2
- package/lib/{build-systems → src/build-systems}/pants.js +5 -2
- package/lib/src/build-systems/pants.js.map +1 -0
- package/lib/src/build-systems/rush.js.map +1 -0
- package/lib/src/build-systems/turbo.js.map +1 -0
- package/lib/{file-system.d.ts → src/file-system.d.ts} +9 -17
- package/lib/{file-system.js → src/file-system.js} +38 -64
- package/lib/src/file-system.js.map +1 -0
- package/lib/src/frameworks/angular.d.ts +24 -0
- package/lib/src/frameworks/angular.js +23 -0
- package/lib/src/frameworks/angular.js.map +1 -0
- package/lib/src/frameworks/assemble.d.ts +16 -0
- package/lib/src/frameworks/assemble.js +17 -0
- package/lib/src/frameworks/assemble.js.map +1 -0
- package/lib/src/frameworks/astro.d.ts +25 -0
- package/lib/src/frameworks/astro.js +24 -0
- package/lib/src/frameworks/astro.js.map +1 -0
- package/lib/src/frameworks/blitz.d.ts +23 -0
- package/lib/src/frameworks/blitz.js +22 -0
- package/lib/src/frameworks/blitz.js.map +1 -0
- package/lib/src/frameworks/brunch.d.ts +24 -0
- package/lib/src/frameworks/brunch.js +23 -0
- package/lib/src/frameworks/brunch.js.map +1 -0
- package/lib/src/frameworks/cecil.d.ts +23 -0
- package/lib/src/frameworks/cecil.js +22 -0
- package/lib/src/frameworks/cecil.js.map +1 -0
- package/lib/src/frameworks/docpad.d.ts +18 -0
- package/lib/src/frameworks/docpad.js +17 -0
- package/lib/src/frameworks/docpad.js.map +1 -0
- package/lib/src/frameworks/docusaurus.d.ts +30 -0
- package/lib/src/frameworks/docusaurus.js +45 -0
- package/lib/src/frameworks/docusaurus.js.map +1 -0
- package/lib/src/frameworks/eleventy.d.ts +24 -0
- package/lib/src/frameworks/eleventy.js +23 -0
- package/lib/src/frameworks/eleventy.js.map +1 -0
- package/lib/src/frameworks/ember.d.ts +24 -0
- package/lib/src/frameworks/ember.js +23 -0
- package/lib/src/frameworks/ember.js.map +1 -0
- package/lib/src/frameworks/expo.d.ts +24 -0
- package/lib/src/frameworks/expo.js +23 -0
- package/lib/src/frameworks/expo.js.map +1 -0
- package/lib/src/frameworks/framework.d.ts +187 -0
- package/lib/src/frameworks/framework.js +225 -0
- package/lib/src/frameworks/framework.js.map +1 -0
- package/lib/src/frameworks/gatsby.d.ts +32 -0
- package/lib/src/frameworks/gatsby.js +45 -0
- package/lib/src/frameworks/gatsby.js.map +1 -0
- package/lib/src/frameworks/gridsome.d.ts +24 -0
- package/lib/src/frameworks/gridsome.js +23 -0
- package/lib/src/frameworks/gridsome.js.map +1 -0
- package/lib/src/frameworks/grunt.d.ts +16 -0
- package/lib/src/frameworks/grunt.js +17 -0
- package/lib/src/frameworks/grunt.js.map +1 -0
- package/lib/src/frameworks/gulp.d.ts +16 -0
- package/lib/src/frameworks/gulp.js +17 -0
- package/lib/src/frameworks/gulp.js.map +1 -0
- package/lib/src/frameworks/harp.d.ts +23 -0
- package/lib/src/frameworks/harp.js +22 -0
- package/lib/src/frameworks/harp.js.map +1 -0
- package/lib/src/frameworks/hexo.d.ts +24 -0
- package/lib/src/frameworks/hexo.js +23 -0
- package/lib/src/frameworks/hexo.js.map +1 -0
- package/lib/src/frameworks/hugo.d.ts +23 -0
- package/lib/src/frameworks/hugo.js +22 -0
- package/lib/src/frameworks/hugo.js.map +1 -0
- package/lib/src/frameworks/hydrogen.d.ts +23 -0
- package/lib/src/frameworks/hydrogen.js +22 -0
- package/lib/src/frameworks/hydrogen.js.map +1 -0
- package/lib/src/frameworks/index.d.ts +49 -0
- package/lib/src/frameworks/index.js +97 -0
- package/lib/src/frameworks/index.js.map +1 -0
- package/lib/src/frameworks/jekyll.d.ts +23 -0
- package/lib/src/frameworks/jekyll.js +22 -0
- package/lib/src/frameworks/jekyll.js.map +1 -0
- package/lib/src/frameworks/metalsmith.d.ts +16 -0
- package/lib/src/frameworks/metalsmith.js +17 -0
- package/lib/src/frameworks/metalsmith.js.map +1 -0
- package/lib/src/frameworks/middleman.d.ts +23 -0
- package/lib/src/frameworks/middleman.js +22 -0
- package/lib/src/frameworks/middleman.js.map +1 -0
- package/lib/src/frameworks/next.d.ts +48 -0
- package/lib/src/frameworks/next.js +64 -0
- package/lib/src/frameworks/next.js.map +1 -0
- package/lib/src/frameworks/nuxt.d.ts +25 -0
- package/lib/src/frameworks/nuxt.js +41 -0
- package/lib/src/frameworks/nuxt.js.map +1 -0
- package/lib/src/frameworks/parcel.d.ts +23 -0
- package/lib/src/frameworks/parcel.js +22 -0
- package/lib/src/frameworks/parcel.js.map +1 -0
- package/lib/src/frameworks/phenomic.d.ts +23 -0
- package/lib/src/frameworks/phenomic.js +22 -0
- package/lib/src/frameworks/phenomic.js.map +1 -0
- package/lib/src/frameworks/quasar.d.ts +25 -0
- package/lib/src/frameworks/quasar.js +37 -0
- package/lib/src/frameworks/quasar.js.map +1 -0
- package/lib/src/frameworks/qwik.d.ts +19 -0
- package/lib/src/frameworks/qwik.js +18 -0
- package/lib/src/frameworks/qwik.js.map +1 -0
- package/lib/src/frameworks/react-static.d.ts +24 -0
- package/lib/src/frameworks/react-static.js +23 -0
- package/lib/src/frameworks/react-static.js.map +1 -0
- package/lib/src/frameworks/react.d.ts +28 -0
- package/lib/src/frameworks/react.js +24 -0
- package/lib/src/frameworks/react.js.map +1 -0
- package/lib/src/frameworks/redwoodjs.d.ts +25 -0
- package/lib/src/frameworks/redwoodjs.js +27 -0
- package/lib/src/frameworks/redwoodjs.js.map +1 -0
- package/lib/src/frameworks/remix.d.ts +20 -0
- package/lib/src/frameworks/remix.js +21 -0
- package/lib/src/frameworks/remix.js.map +1 -0
- package/lib/src/frameworks/roots.d.ts +23 -0
- package/lib/src/frameworks/roots.js +22 -0
- package/lib/src/frameworks/roots.js.map +1 -0
- package/lib/src/frameworks/sapper.d.ts +24 -0
- package/lib/src/frameworks/sapper.js +23 -0
- package/lib/src/frameworks/sapper.js.map +1 -0
- package/lib/src/frameworks/solid-start.d.ts +23 -0
- package/lib/src/frameworks/solid-start.js +22 -0
- package/lib/src/frameworks/solid-start.js.map +1 -0
- package/lib/src/frameworks/solid.d.ts +24 -0
- package/lib/src/frameworks/solid.js +23 -0
- package/lib/src/frameworks/solid.js.map +1 -0
- package/lib/src/frameworks/stencil.d.ts +28 -0
- package/lib/src/frameworks/stencil.js +27 -0
- package/lib/src/frameworks/stencil.js.map +1 -0
- package/lib/src/frameworks/svelte-kit.d.ts +24 -0
- package/lib/src/frameworks/svelte-kit.js +23 -0
- package/lib/src/frameworks/svelte-kit.js.map +1 -0
- package/lib/src/frameworks/svelte.d.ts +25 -0
- package/lib/src/frameworks/svelte.js +24 -0
- package/lib/src/frameworks/svelte.js.map +1 -0
- package/lib/src/frameworks/vite.d.ts +24 -0
- package/lib/src/frameworks/vite.js +23 -0
- package/lib/src/frameworks/vite.js.map +1 -0
- package/lib/src/frameworks/vue.d.ts +23 -0
- package/lib/src/frameworks/vue.js +22 -0
- package/lib/src/frameworks/vue.js.map +1 -0
- package/lib/src/frameworks/vuepress.d.ts +23 -0
- package/lib/src/frameworks/vuepress.js +22 -0
- package/lib/src/frameworks/vuepress.js.map +1 -0
- package/lib/src/frameworks/wintersmith.d.ts +24 -0
- package/lib/src/frameworks/wintersmith.js +23 -0
- package/lib/src/frameworks/wintersmith.js.map +1 -0
- package/lib/src/frameworks/wmr.d.ts +23 -0
- package/lib/src/frameworks/wmr.js +22 -0
- package/lib/src/frameworks/wmr.js.map +1 -0
- package/lib/src/frameworks/zola.d.ts +18 -0
- package/lib/src/frameworks/zola.js +17 -0
- package/lib/src/frameworks/zola.js.map +1 -0
- package/lib/src/get-dev-commands.d.ts +2 -0
- package/lib/src/get-dev-commands.js +29 -0
- package/lib/src/get-dev-commands.js.map +1 -0
- package/lib/src/get-framework.d.ts +4 -0
- package/lib/src/get-framework.js +16 -0
- package/lib/src/get-framework.js.map +1 -0
- package/lib/{index.d.ts → src/index.d.ts} +1 -0
- package/lib/src/index.js +4 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/metrics.js.map +1 -0
- package/lib/{node → src/node}/bin.js +4 -1
- package/lib/src/node/bin.js.map +1 -0
- package/lib/{node → src/node}/file-system.d.ts +2 -1
- package/lib/{node → src/node}/file-system.js +3 -5
- package/lib/src/node/file-system.js.map +1 -0
- package/lib/{node → src/node}/get-build-info.d.ts +3 -3
- package/lib/{node → src/node}/get-build-info.js +16 -18
- package/lib/src/node/get-build-info.js.map +1 -0
- package/lib/src/node/index.d.ts +2 -0
- package/lib/src/node/index.js +3 -0
- package/lib/src/node/index.js.map +1 -0
- package/lib/src/node/metrics.js.map +1 -0
- package/lib/{package-managers → src/package-managers}/detect-package-manager.d.ts +6 -2
- package/lib/{package-managers → src/package-managers}/detect-package-manager.js +9 -2
- package/lib/src/package-managers/detect-package-manager.js.map +1 -0
- package/lib/{project.d.ts → src/project.d.ts} +27 -6
- package/lib/src/project.js +248 -0
- package/lib/src/project.js.map +1 -0
- package/lib/src/settings/get-toml-settings.d.ts +15 -0
- package/lib/src/settings/get-toml-settings.js +34 -0
- package/lib/src/settings/get-toml-settings.js.map +1 -0
- package/lib/{workspaces → src/workspaces}/detect-workspace.d.ts +1 -1
- package/lib/{workspaces → src/workspaces}/detect-workspace.js +14 -5
- package/lib/src/workspaces/detect-workspace.js.map +1 -0
- package/lib/src/workspaces/get-workspace-packages.d.ts +20 -0
- package/lib/{workspaces → src/workspaces}/get-workspace-packages.js +19 -5
- package/lib/src/workspaces/get-workspace-packages.js.map +1 -0
- package/lib/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +9 -8
- package/lib/browser/file-system.js.map +0 -1
- package/lib/build-systems/bazel.js.map +0 -1
- package/lib/build-systems/buck.js.map +0 -1
- package/lib/build-systems/build-system.d.ts +0 -20
- package/lib/build-systems/build-system.js +0 -19
- package/lib/build-systems/build-system.js.map +0 -1
- package/lib/build-systems/gradle.js.map +0 -1
- package/lib/build-systems/index.d.ts +0 -2
- package/lib/build-systems/index.js.map +0 -1
- package/lib/build-systems/lage.js.map +0 -1
- package/lib/build-systems/moon.js.map +0 -1
- package/lib/build-systems/nix.js.map +0 -1
- package/lib/build-systems/nrwl.d.ts +0 -11
- package/lib/build-systems/nrwl.js +0 -12
- package/lib/build-systems/nrwl.js.map +0 -1
- package/lib/build-systems/pants.js.map +0 -1
- package/lib/build-systems/rush.js.map +0 -1
- package/lib/build-systems/turbo.js.map +0 -1
- package/lib/file-system.js.map +0 -1
- package/lib/index.js +0 -3
- package/lib/index.js.map +0 -1
- package/lib/metrics.js.map +0 -1
- package/lib/node/bin.js.map +0 -1
- package/lib/node/file-system.js.map +0 -1
- package/lib/node/get-build-info.js.map +0 -1
- package/lib/node/metrics.js.map +0 -1
- package/lib/package-managers/detect-package-manager.js.map +0 -1
- package/lib/project.js +0 -97
- package/lib/project.js.map +0 -1
- package/lib/workspaces/detect-workspace.js.map +0 -1
- package/lib/workspaces/get-workspace-packages.d.ts +0 -3
- package/lib/workspaces/get-workspace-packages.js.map +0 -1
- /package/lib/{build-systems → src/build-systems}/index.js +0 -0
- /package/lib/{build-systems → src/build-systems}/lage.d.ts +0 -0
- /package/lib/{build-systems → src/build-systems}/lage.js +0 -0
- /package/lib/{build-systems → src/build-systems}/rush.d.ts +0 -0
- /package/lib/{build-systems → src/build-systems}/rush.js +0 -0
- /package/lib/{build-systems → src/build-systems}/turbo.d.ts +0 -0
- /package/lib/{build-systems → src/build-systems}/turbo.js +0 -0
- /package/lib/{metrics.d.ts → src/metrics.d.ts} +0 -0
- /package/lib/{metrics.js → src/metrics.js} +0 -0
- /package/lib/{node → src/node}/bin.d.ts +0 -0
- /package/lib/{node → src/node}/metrics.d.ts +0 -0
- /package/lib/{node → src/node}/metrics.js +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import type { PackageJson } from 'read-pkg';
|
|
2
|
+
import { SemVer } from 'semver';
|
|
3
|
+
import { Project } from '../project.js';
|
|
4
|
+
export declare enum Category {
|
|
5
|
+
FrontendFramework = "frontend_framework",
|
|
6
|
+
SSG = "static_site_generator",
|
|
7
|
+
BuildTool = "build_tool"
|
|
8
|
+
}
|
|
9
|
+
export declare enum Accuracy {
|
|
10
|
+
NPM = 4,
|
|
11
|
+
ConfigOnly = 3,
|
|
12
|
+
Config = 2,
|
|
13
|
+
NPMHoisted = 1
|
|
14
|
+
}
|
|
15
|
+
export type PollingStrategy = {
|
|
16
|
+
name: any;
|
|
17
|
+
};
|
|
18
|
+
/** Information on how it was detected and how accurate the detection is */
|
|
19
|
+
export type Detection = {
|
|
20
|
+
/**
|
|
21
|
+
* The grade of how much we trust in having the right result detected.
|
|
22
|
+
* Sometimes it's hard to predict it to 100% as for config files, some frameworks can share the same config file
|
|
23
|
+
*/
|
|
24
|
+
accuracy: Accuracy;
|
|
25
|
+
/** The NPM package that was able to detect it (high accuracy) */
|
|
26
|
+
package?: {
|
|
27
|
+
name: string;
|
|
28
|
+
version?: SemVer;
|
|
29
|
+
};
|
|
30
|
+
packageJSON?: PackageJson;
|
|
31
|
+
/** The config file that is associated with the framework */
|
|
32
|
+
config?: string;
|
|
33
|
+
};
|
|
34
|
+
export type FrameworkInfo = ReturnType<Framework['toJSON']>;
|
|
35
|
+
export interface Framework {
|
|
36
|
+
project: Project;
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
category: Category;
|
|
40
|
+
configFiles: string[];
|
|
41
|
+
npmDependencies: string[];
|
|
42
|
+
excludedNpmDependencies?: string[];
|
|
43
|
+
version?: SemVer;
|
|
44
|
+
/** Information on how it was detected and how accurate the detection is */
|
|
45
|
+
detected?: Detection;
|
|
46
|
+
staticAssetsDirectory?: string;
|
|
47
|
+
dev?: {
|
|
48
|
+
command: string;
|
|
49
|
+
port?: number;
|
|
50
|
+
pollingStrategies?: PollingStrategy[];
|
|
51
|
+
};
|
|
52
|
+
build: {
|
|
53
|
+
command: string;
|
|
54
|
+
directory: string;
|
|
55
|
+
};
|
|
56
|
+
logo?: {
|
|
57
|
+
default: string;
|
|
58
|
+
light?: string;
|
|
59
|
+
dark?: string;
|
|
60
|
+
};
|
|
61
|
+
plugins: string[];
|
|
62
|
+
env: Record<string, string>;
|
|
63
|
+
detect(): Promise<DetectedFramework | undefined>;
|
|
64
|
+
toJSON(): {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
category: Category;
|
|
68
|
+
package: {
|
|
69
|
+
name?: string;
|
|
70
|
+
version: string | 'unknown';
|
|
71
|
+
};
|
|
72
|
+
dev: {
|
|
73
|
+
commands: string[];
|
|
74
|
+
port?: number;
|
|
75
|
+
pollingStrategies?: PollingStrategy[];
|
|
76
|
+
};
|
|
77
|
+
build: {
|
|
78
|
+
commands: string[];
|
|
79
|
+
directory: string;
|
|
80
|
+
};
|
|
81
|
+
staticAssetsDirectory?: string;
|
|
82
|
+
env: Record<string, string>;
|
|
83
|
+
logo?: Record<string, string>;
|
|
84
|
+
plugins: string[];
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export type DetectedFramework = Omit<Framework, 'detected'> & {
|
|
88
|
+
detected: Detection;
|
|
89
|
+
};
|
|
90
|
+
/** Filters a list of detected frameworks by relevance, meaning we drop build tools if we find static site generators */
|
|
91
|
+
export declare function filterByRelevance(detected: DetectedFramework[]): DetectedFramework[];
|
|
92
|
+
/**
|
|
93
|
+
* sort a list of frameworks based on the accuracy and on it's type (prefer static site generators over build tools)
|
|
94
|
+
* from most accurate to least accurate
|
|
95
|
+
* 1. a npm dependency was specified and matched
|
|
96
|
+
* 2. only a config file was specified and matched
|
|
97
|
+
* 3. an npm dependency was specified but matched over the config file (least accurate)
|
|
98
|
+
*/
|
|
99
|
+
export declare function sortFrameworksBasedOnAccuracy(a: DetectedFramework, b: DetectedFramework): number;
|
|
100
|
+
/** Merges a list of detection results based on accuracy to get the one with the highest accuracy */
|
|
101
|
+
export declare function mergeDetections(detections: Array<Detection | undefined>): Detection | undefined;
|
|
102
|
+
export declare abstract class BaseFramework implements Framework {
|
|
103
|
+
/** The current project inside we want to detect the framework */
|
|
104
|
+
project: Project;
|
|
105
|
+
/** An absolute path considered as the baseDirectory for detection, prefer that over the project baseDirectory */
|
|
106
|
+
path?: string | undefined;
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
category: Category;
|
|
110
|
+
detected?: Detection;
|
|
111
|
+
version?: SemVer;
|
|
112
|
+
configFiles: string[];
|
|
113
|
+
npmDependencies: string[];
|
|
114
|
+
excludedNpmDependencies: string[];
|
|
115
|
+
plugins: string[];
|
|
116
|
+
staticAssetsDirectory?: string;
|
|
117
|
+
env: {};
|
|
118
|
+
dev?: {
|
|
119
|
+
command: string;
|
|
120
|
+
port?: number;
|
|
121
|
+
pollingStrategies?: PollingStrategy[];
|
|
122
|
+
};
|
|
123
|
+
build: {
|
|
124
|
+
command: string;
|
|
125
|
+
directory: string;
|
|
126
|
+
};
|
|
127
|
+
logo?: {
|
|
128
|
+
default: string;
|
|
129
|
+
light?: string;
|
|
130
|
+
dark?: string;
|
|
131
|
+
};
|
|
132
|
+
constructor(
|
|
133
|
+
/** The current project inside we want to detect the framework */
|
|
134
|
+
project: Project,
|
|
135
|
+
/** An absolute path considered as the baseDirectory for detection, prefer that over the project baseDirectory */
|
|
136
|
+
path?: string | undefined);
|
|
137
|
+
setDetected(accuracy: Accuracy, reason?: {
|
|
138
|
+
name: string;
|
|
139
|
+
version?: SemVer;
|
|
140
|
+
} | string): DetectedFramework;
|
|
141
|
+
/** Retrieves the version of a npm package from the node_modules */
|
|
142
|
+
private getVersionFromNodeModules;
|
|
143
|
+
/** check if the npmDependencies are used inside the provided package.json */
|
|
144
|
+
private npmDependenciesUsed;
|
|
145
|
+
/** detect if the framework occurs inside the package.json dependencies */
|
|
146
|
+
private detectNpmDependency;
|
|
147
|
+
/** detect if the framework config file is located somewhere up the tree */
|
|
148
|
+
private detectConfigFile;
|
|
149
|
+
/**
|
|
150
|
+
* Checks if the project is using a specific framework:
|
|
151
|
+
* - if `npmDependencies` is set, one of them must be present in then `package.json` `dependencies|devDependencies`
|
|
152
|
+
* - if `excludedNpmDependencies` is set, none of them must be present in the `package.json` `dependencies|devDependencies`
|
|
153
|
+
* - if `configFiles` is set, one of the files must exist
|
|
154
|
+
*/
|
|
155
|
+
detect(): Promise<DetectedFramework | undefined>;
|
|
156
|
+
/**
|
|
157
|
+
* Retrieve framework's dev commands.
|
|
158
|
+
* We use, in priority order:
|
|
159
|
+
* - `package.json` `scripts` containing the frameworks dev command
|
|
160
|
+
* - `package.json` `scripts` whose names are among a list of common dev scripts like: `dev`, `serve`, `develop`, ...
|
|
161
|
+
* - The frameworks dev command
|
|
162
|
+
*/
|
|
163
|
+
getDevCommands(): string[];
|
|
164
|
+
/** This method will be called by the JSON.stringify */
|
|
165
|
+
toJSON(): {
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
package: {
|
|
169
|
+
name: string;
|
|
170
|
+
version: string;
|
|
171
|
+
};
|
|
172
|
+
category: Category;
|
|
173
|
+
dev: {
|
|
174
|
+
commands: string[];
|
|
175
|
+
port: number | undefined;
|
|
176
|
+
pollingStrategies: PollingStrategy[] | undefined;
|
|
177
|
+
};
|
|
178
|
+
build: {
|
|
179
|
+
commands: string[];
|
|
180
|
+
directory: string;
|
|
181
|
+
};
|
|
182
|
+
staticAssetsDirectory: string | undefined;
|
|
183
|
+
env: {};
|
|
184
|
+
logo: {} | undefined;
|
|
185
|
+
plugins: string[];
|
|
186
|
+
};
|
|
187
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { coerce, parse } from 'semver';
|
|
2
|
+
import { getDevCommands } from '../get-dev-commands.js';
|
|
3
|
+
export var Category;
|
|
4
|
+
(function (Category) {
|
|
5
|
+
Category["FrontendFramework"] = "frontend_framework";
|
|
6
|
+
Category["SSG"] = "static_site_generator";
|
|
7
|
+
Category["BuildTool"] = "build_tool";
|
|
8
|
+
})(Category = Category || (Category = {}));
|
|
9
|
+
export var Accuracy;
|
|
10
|
+
(function (Accuracy) {
|
|
11
|
+
Accuracy[Accuracy["NPM"] = 4] = "NPM";
|
|
12
|
+
Accuracy[Accuracy["ConfigOnly"] = 3] = "ConfigOnly";
|
|
13
|
+
Accuracy[Accuracy["Config"] = 2] = "Config";
|
|
14
|
+
Accuracy[Accuracy["NPMHoisted"] = 1] = "NPMHoisted";
|
|
15
|
+
})(Accuracy = Accuracy || (Accuracy = {}));
|
|
16
|
+
/** Filters a list of detected frameworks by relevance, meaning we drop build tools if we find static site generators */
|
|
17
|
+
export function filterByRelevance(detected) {
|
|
18
|
+
const filtered = [];
|
|
19
|
+
for (const framework of detected.sort(sortFrameworksBasedOnAccuracy)) {
|
|
20
|
+
// only keep the frameworks on the highest accuracy level. (so if multiple SSG are detected use them but drop build tools)
|
|
21
|
+
if (filtered.length === 0 || filtered[0].detected.accuracy === framework.detected.accuracy) {
|
|
22
|
+
filtered.push(framework);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return filtered;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* sort a list of frameworks based on the accuracy and on it's type (prefer static site generators over build tools)
|
|
29
|
+
* from most accurate to least accurate
|
|
30
|
+
* 1. a npm dependency was specified and matched
|
|
31
|
+
* 2. only a config file was specified and matched
|
|
32
|
+
* 3. an npm dependency was specified but matched over the config file (least accurate)
|
|
33
|
+
*/
|
|
34
|
+
export function sortFrameworksBasedOnAccuracy(a, b) {
|
|
35
|
+
let sort = a.detected.accuracy > b.detected.accuracy ? -1 : a.detected.accuracy < b.detected.accuracy ? 1 : 0;
|
|
36
|
+
if (sort >= 0) {
|
|
37
|
+
// prefer SSG over build tools
|
|
38
|
+
if (a.category === Category.SSG && b.category === Category.BuildTool) {
|
|
39
|
+
sort--;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return sort;
|
|
43
|
+
}
|
|
44
|
+
/** Merges a list of detection results based on accuracy to get the one with the highest accuracy */
|
|
45
|
+
export function mergeDetections(detections) {
|
|
46
|
+
return detections
|
|
47
|
+
.filter(Boolean)
|
|
48
|
+
.sort((a, b) => (a.accuracy > b.accuracy ? -1 : a.accuracy < b.accuracy ? 1 : 0))?.[0];
|
|
49
|
+
}
|
|
50
|
+
export class BaseFramework {
|
|
51
|
+
project;
|
|
52
|
+
path;
|
|
53
|
+
id;
|
|
54
|
+
name;
|
|
55
|
+
category;
|
|
56
|
+
detected;
|
|
57
|
+
version;
|
|
58
|
+
configFiles = [];
|
|
59
|
+
npmDependencies = [];
|
|
60
|
+
excludedNpmDependencies = [];
|
|
61
|
+
plugins = [];
|
|
62
|
+
staticAssetsDirectory;
|
|
63
|
+
env = {};
|
|
64
|
+
dev;
|
|
65
|
+
build = {
|
|
66
|
+
command: 'npm run build',
|
|
67
|
+
directory: 'dist',
|
|
68
|
+
};
|
|
69
|
+
logo;
|
|
70
|
+
constructor(
|
|
71
|
+
/** The current project inside we want to detect the framework */
|
|
72
|
+
project,
|
|
73
|
+
/** An absolute path considered as the baseDirectory for detection, prefer that over the project baseDirectory */
|
|
74
|
+
path) {
|
|
75
|
+
this.project = project;
|
|
76
|
+
this.path = path;
|
|
77
|
+
if (project.packageManager?.runCommand) {
|
|
78
|
+
this.build.command = `${project.packageManager.runCommand} build`;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
setDetected(accuracy, reason) {
|
|
82
|
+
this.detected = {
|
|
83
|
+
accuracy,
|
|
84
|
+
};
|
|
85
|
+
if (typeof reason === 'string') {
|
|
86
|
+
this.detected.config = reason;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
this.detected.package = reason;
|
|
90
|
+
}
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
/** Retrieves the version of a npm package from the node_modules */
|
|
94
|
+
async getVersionFromNodeModules(packageName) {
|
|
95
|
+
// on the browser we can omit this check
|
|
96
|
+
if (this.project.fs.getEnvironment() === "browser" /* Environment.Browser */) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
const packageJson = await this.project.fs.findUp(this.project.fs.join('node_modules', packageName, 'package.json'), {
|
|
101
|
+
cwd: this.path || this.project.baseDirectory,
|
|
102
|
+
stopAt: this.project.root,
|
|
103
|
+
});
|
|
104
|
+
if (packageJson) {
|
|
105
|
+
const { version } = await this.project.fs.readJSON(packageJson);
|
|
106
|
+
if (typeof version === 'string') {
|
|
107
|
+
return parse(version) || undefined;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
// noop
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** check if the npmDependencies are used inside the provided package.json */
|
|
116
|
+
async npmDependenciesUsed(pkgJSON) {
|
|
117
|
+
const allDeps = [...Object.entries(pkgJSON.dependencies || {}), ...Object.entries(pkgJSON.devDependencies || {})];
|
|
118
|
+
const found = allDeps.find(([depName]) => this.npmDependencies.includes(depName));
|
|
119
|
+
// check for excluded dependencies
|
|
120
|
+
const excluded = allDeps.some(([depName]) => this.excludedNpmDependencies.includes(depName));
|
|
121
|
+
if (!excluded && found?.[0]) {
|
|
122
|
+
const version = await this.getVersionFromNodeModules(found[0]);
|
|
123
|
+
return {
|
|
124
|
+
name: found[0],
|
|
125
|
+
// coerce to parse syntax like ~0.1.2 or ^1.2.3
|
|
126
|
+
version: version || parse(coerce(found[1])) || undefined,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/** detect if the framework occurs inside the package.json dependencies */
|
|
131
|
+
async detectNpmDependency() {
|
|
132
|
+
if (this.npmDependencies.length) {
|
|
133
|
+
const startDir = this.path || this.project.baseDirectory;
|
|
134
|
+
const pkg = await this.project.getPackageJSON(startDir);
|
|
135
|
+
const dep = await this.npmDependenciesUsed(pkg);
|
|
136
|
+
if (dep) {
|
|
137
|
+
this.version = dep.version;
|
|
138
|
+
return {
|
|
139
|
+
// if the match of the npm package was in a directory up we don't have a high accuracy
|
|
140
|
+
accuracy: this.project.fs.join(startDir, 'package.json') === pkg.pkgPath ? Accuracy.NPM : Accuracy.NPMHoisted,
|
|
141
|
+
package: dep,
|
|
142
|
+
packageJSON: pkg,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/** detect if the framework config file is located somewhere up the tree */
|
|
148
|
+
async detectConfigFile() {
|
|
149
|
+
if (this.configFiles?.length) {
|
|
150
|
+
const config = await this.project.fs.findUp(this.configFiles, {
|
|
151
|
+
cwd: this.path || this.project.baseDirectory,
|
|
152
|
+
stopAt: this.project.root,
|
|
153
|
+
});
|
|
154
|
+
if (config) {
|
|
155
|
+
return {
|
|
156
|
+
// Have higher trust on a detection of a config file if there is no npm dependency specified for this framework
|
|
157
|
+
// otherwise the npm dependency should have already triggered the detection
|
|
158
|
+
accuracy: this.npmDependencies.length === 0 ? Accuracy.ConfigOnly : Accuracy.Config,
|
|
159
|
+
config,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Checks if the project is using a specific framework:
|
|
166
|
+
* - if `npmDependencies` is set, one of them must be present in then `package.json` `dependencies|devDependencies`
|
|
167
|
+
* - if `excludedNpmDependencies` is set, none of them must be present in the `package.json` `dependencies|devDependencies`
|
|
168
|
+
* - if `configFiles` is set, one of the files must exist
|
|
169
|
+
*/
|
|
170
|
+
async detect() {
|
|
171
|
+
const npm = await this.detectNpmDependency();
|
|
172
|
+
const config = await this.detectConfigFile();
|
|
173
|
+
this.detected = mergeDetections([npm, config]);
|
|
174
|
+
if (this.detected) {
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
// nothing detected
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Retrieve framework's dev commands.
|
|
181
|
+
* We use, in priority order:
|
|
182
|
+
* - `package.json` `scripts` containing the frameworks dev command
|
|
183
|
+
* - `package.json` `scripts` whose names are among a list of common dev scripts like: `dev`, `serve`, `develop`, ...
|
|
184
|
+
* - The frameworks dev command
|
|
185
|
+
*/
|
|
186
|
+
getDevCommands() {
|
|
187
|
+
// Some frameworks don't have a dev command
|
|
188
|
+
if (this.dev?.command === undefined) {
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
191
|
+
const devCommands = getDevCommands(this.dev.command, this.detected?.packageJSON?.scripts);
|
|
192
|
+
if (devCommands.length > 0) {
|
|
193
|
+
return devCommands.map((command) => this.project.getNpmScriptCommand(command));
|
|
194
|
+
}
|
|
195
|
+
return [this.dev.command];
|
|
196
|
+
}
|
|
197
|
+
/** This method will be called by the JSON.stringify */
|
|
198
|
+
toJSON() {
|
|
199
|
+
return {
|
|
200
|
+
id: this.id,
|
|
201
|
+
name: this.name,
|
|
202
|
+
package: {
|
|
203
|
+
name: this.detected?.package?.name || this.npmDependencies?.[0],
|
|
204
|
+
version: this.detected?.package?.version?.raw || 'unknown',
|
|
205
|
+
},
|
|
206
|
+
category: this.category,
|
|
207
|
+
dev: {
|
|
208
|
+
commands: this.getDevCommands(),
|
|
209
|
+
port: this.dev?.port,
|
|
210
|
+
pollingStrategies: this.dev?.pollingStrategies,
|
|
211
|
+
},
|
|
212
|
+
build: {
|
|
213
|
+
commands: [this.build.command],
|
|
214
|
+
directory: this.build.directory,
|
|
215
|
+
},
|
|
216
|
+
staticAssetsDirectory: this.staticAssetsDirectory,
|
|
217
|
+
env: this.env,
|
|
218
|
+
logo: this.logo
|
|
219
|
+
? Object.entries(this.logo).reduce((prev, [key, value]) => ({ ...prev, [key]: `https://framework-info.netlify.app${value}` }), {})
|
|
220
|
+
: undefined,
|
|
221
|
+
plugins: this.plugins,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=framework.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework.js","sourceRoot":"","sources":["../../../src/frameworks/framework.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAGvD,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,oDAAwC,CAAA;IACxC,yCAA6B,CAAA;IAC7B,oCAAwB,CAAA;AAC1B,CAAC,EAJW,QAAQ,GAAR,QAAQ,KAAR,QAAQ,QAInB;AAED,MAAM,CAA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AE,CAAC,GAAG,CAAC,EAAE,qCAAqC,KAAK,EAAE,EAAE,CAAC,EAC1F,EAAE,CACH;gBACH,CAAC,CAAC,SAAS;YACb,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BaseFramework, Category, DetectedFramework, Framework } from './framework.js';
|
|
2
|
+
export declare class Gatsby extends BaseFramework implements Framework {
|
|
3
|
+
readonly id = "gatsby";
|
|
4
|
+
name: string;
|
|
5
|
+
configFiles: string[];
|
|
6
|
+
npmDependencies: string[];
|
|
7
|
+
category: Category;
|
|
8
|
+
staticAssetsDirectory: string;
|
|
9
|
+
dev: {
|
|
10
|
+
command: string;
|
|
11
|
+
port: number;
|
|
12
|
+
pollingStrategies: {
|
|
13
|
+
name: string;
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
16
|
+
build: {
|
|
17
|
+
command: string;
|
|
18
|
+
directory: string;
|
|
19
|
+
};
|
|
20
|
+
logo: {
|
|
21
|
+
default: string;
|
|
22
|
+
light: string;
|
|
23
|
+
dark: string;
|
|
24
|
+
};
|
|
25
|
+
env: {
|
|
26
|
+
GATSBY_LOGGER: string;
|
|
27
|
+
GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS: string;
|
|
28
|
+
AWS_LAMBDA_JS_RUNTIME: string;
|
|
29
|
+
NODE_VERSION: string;
|
|
30
|
+
};
|
|
31
|
+
detect(): Promise<DetectedFramework | undefined>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { gte } from 'semver';
|
|
2
|
+
import { BaseFramework, Category } from './framework.js';
|
|
3
|
+
export class Gatsby extends BaseFramework {
|
|
4
|
+
id = 'gatsby';
|
|
5
|
+
name = 'Gatsby';
|
|
6
|
+
configFiles = ['gatsby-config.js', 'gatsby-config.ts'];
|
|
7
|
+
npmDependencies = ['gatsby'];
|
|
8
|
+
category = Category.SSG;
|
|
9
|
+
staticAssetsDirectory = 'static';
|
|
10
|
+
dev = {
|
|
11
|
+
command: 'gatsby develop',
|
|
12
|
+
port: 8000,
|
|
13
|
+
pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }],
|
|
14
|
+
};
|
|
15
|
+
build = {
|
|
16
|
+
command: 'gatsby build',
|
|
17
|
+
directory: 'public',
|
|
18
|
+
};
|
|
19
|
+
logo = {
|
|
20
|
+
default: '/logos/gatsby/default.svg',
|
|
21
|
+
light: '/logos/gatsby/light.svg',
|
|
22
|
+
dark: '/logos/gatsby/dark.svg',
|
|
23
|
+
};
|
|
24
|
+
env = {
|
|
25
|
+
GATSBY_LOGGER: 'yurnalist',
|
|
26
|
+
GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS: 'true',
|
|
27
|
+
AWS_LAMBDA_JS_RUNTIME: 'nodejs14.x',
|
|
28
|
+
NODE_VERSION: '14',
|
|
29
|
+
};
|
|
30
|
+
async detect() {
|
|
31
|
+
await super.detect();
|
|
32
|
+
if (this.detected) {
|
|
33
|
+
if (this.version && gte(this.version, '5.0.0')) {
|
|
34
|
+
this.env.NODE_VERSION = '18';
|
|
35
|
+
this.env.AWS_LAMBDA_JS_RUNTIME = 'nodejs18.x';
|
|
36
|
+
}
|
|
37
|
+
const nodeVersion = await this.project.getCurrentNodeVersion();
|
|
38
|
+
if (nodeVersion && gte(nodeVersion, '12.13.0')) {
|
|
39
|
+
this.plugins.push('@netlify/plugin-gatsby');
|
|
40
|
+
}
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=gatsby.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gatsby.js","sourceRoot":"","sources":["../../../src/frameworks/gatsby.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAgC,MAAM,gBAAgB,CA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,EAAE;gBAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA;aAC5C;YACD,OAAO,IAAyB,CAAA;SACjC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseFramework, Category, Framework } from './framework.js';
|
|
2
|
+
export declare class Gridsome extends BaseFramework implements Framework {
|
|
3
|
+
readonly id = "gridsome";
|
|
4
|
+
name: string;
|
|
5
|
+
configFiles: string[];
|
|
6
|
+
npmDependencies: string[];
|
|
7
|
+
category: Category;
|
|
8
|
+
dev: {
|
|
9
|
+
command: string;
|
|
10
|
+
port: number;
|
|
11
|
+
pollingStrategies: {
|
|
12
|
+
name: string;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
build: {
|
|
16
|
+
command: string;
|
|
17
|
+
directory: string;
|
|
18
|
+
};
|
|
19
|
+
logo: {
|
|
20
|
+
default: string;
|
|
21
|
+
light: string;
|
|
22
|
+
dark: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseFramework, Category } from './framework.js';
|
|
2
|
+
export class Gridsome extends BaseFramework {
|
|
3
|
+
id = 'gridsome';
|
|
4
|
+
name = 'Gridsome';
|
|
5
|
+
configFiles = ['gridsome.config.js'];
|
|
6
|
+
npmDependencies = ['gridsome'];
|
|
7
|
+
category = Category.SSG;
|
|
8
|
+
dev = {
|
|
9
|
+
command: 'gridsome develop',
|
|
10
|
+
port: 8080,
|
|
11
|
+
pollingStrategies: [{ name: 'TCP' }, { name: 'HTTP' }],
|
|
12
|
+
};
|
|
13
|
+
build = {
|
|
14
|
+
command: 'gridsome build',
|
|
15
|
+
directory: 'dist',
|
|
16
|
+
};
|
|
17
|
+
logo = {
|
|
18
|
+
default: '/logos/gridsome/default.svg',
|
|
19
|
+
light: '/logos/gridsome/light.svg',
|
|
20
|
+
dark: '/logos/gridsome/dark.svg',
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=gridsome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gridsome.js","sourceRoot":"","sources":["../../../src/frameworks/gridsome.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAa,MAAM,gBAAgB,CAAA;AAEnE,MAAM,OAAO,QAAS,SAAQ,aAAa;IAChC,EAAE,GAAG,UAAU,CAAA;IACxB,IAAI,GAAG,UAAU,CAAA;IACjB,WAAW,GAAG,CAAC,oBAAoB,CAAC,CAAA;IACpC,eAAe,GAAG,CAAC,UAAU,CAAC,CAAA;IAC9B,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAA;IAEvB,GAAG,GAAG;QACJ,OAAO,EAAE,kBAAkB;QAC3B,IAAI,EAAE,IAAI;QACV,iBAAiB,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KACvD,CAAA;IAED,KAAK,GAAG;QACN,OAAO,EAAE,gBAAgB;QACzB,SAAS,EAAE,MAAM;KAClB,CAAA;IAED,IAAI,GAAG;QACL,OAAO,EAAE,6BAA6B;QACtC,KAAK,EAAE,2BAA2B;QAClC,IAAI,EAAE,0BAA0B;KACjC,CAAA;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseFramework, Category, Framework } from './framework.js';
|
|
2
|
+
export declare class Grunt extends BaseFramework implements Framework {
|
|
3
|
+
readonly id = "grunt";
|
|
4
|
+
name: string;
|
|
5
|
+
npmDependencies: string[];
|
|
6
|
+
category: Category;
|
|
7
|
+
build: {
|
|
8
|
+
command: string;
|
|
9
|
+
directory: string;
|
|
10
|
+
};
|
|
11
|
+
logo: {
|
|
12
|
+
default: string;
|
|
13
|
+
light: string;
|
|
14
|
+
dark: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseFramework, Category } from './framework.js';
|
|
2
|
+
export class Grunt extends BaseFramework {
|
|
3
|
+
id = 'grunt';
|
|
4
|
+
name = 'Grunt';
|
|
5
|
+
npmDependencies = ['grunt'];
|
|
6
|
+
category = Category.BuildTool;
|
|
7
|
+
build = {
|
|
8
|
+
command: 'grunt build',
|
|
9
|
+
directory: 'dist',
|
|
10
|
+
};
|
|
11
|
+
logo = {
|
|
12
|
+
default: '/logos/grunt/default.svg',
|
|
13
|
+
light: '/logos/grunt/default.svg',
|
|
14
|
+
dark: '/logos/grunt/default.svg',
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=grunt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grunt.js","sourceRoot":"","sources":["../../../src/frameworks/grunt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAa,MAAM,gBAAgB,CAAA;AAEnE,MAAM,OAAO,KAAM,SAAQ,aAAa;IAC7B,EAAE,GAAG,OAAO,CAAA;IACrB,IAAI,GAAG,OAAO,CAAA;IACd,eAAe,GAAG,CAAC,OAAO,CAAC,CAAA;IAC3B,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAA;IAE7B,KAAK,GAAG;QACN,OAAO,EAAE,aAAa;QACtB,SAAS,EAAE,MAAM;KAClB,CAAA;IAED,IAAI,GAAG;QACL,OAAO,EAAE,0BAA0B;QACnC,KAAK,EAAE,0BAA0B;QACjC,IAAI,EAAE,0BAA0B;KACjC,CAAA;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseFramework, Category, Framework } from './framework.js';
|
|
2
|
+
export declare class Gulp extends BaseFramework implements Framework {
|
|
3
|
+
readonly id = "gulp";
|
|
4
|
+
name: string;
|
|
5
|
+
npmDependencies: string[];
|
|
6
|
+
category: Category;
|
|
7
|
+
build: {
|
|
8
|
+
command: string;
|
|
9
|
+
directory: string;
|
|
10
|
+
};
|
|
11
|
+
logo: {
|
|
12
|
+
default: string;
|
|
13
|
+
light: string;
|
|
14
|
+
dark: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseFramework, Category } from './framework.js';
|
|
2
|
+
export class Gulp extends BaseFramework {
|
|
3
|
+
id = 'gulp';
|
|
4
|
+
name = 'gulp.js';
|
|
5
|
+
npmDependencies = ['gulp'];
|
|
6
|
+
category = Category.BuildTool;
|
|
7
|
+
build = {
|
|
8
|
+
command: 'gulp build',
|
|
9
|
+
directory: 'dist',
|
|
10
|
+
};
|
|
11
|
+
logo = {
|
|
12
|
+
default: '/logos/gulp/default.svg',
|
|
13
|
+
light: '/logos/gulp/default.svg',
|
|
14
|
+
dark: '/logos/gulp/default.svg',
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=gulp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gulp.js","sourceRoot":"","sources":["../../../src/frameworks/gulp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAa,MAAM,gBAAgB,CAAA;AAEnE,MAAM,OAAO,IAAK,SAAQ,aAAa;IAC5B,EAAE,GAAG,MAAM,CAAA;IACpB,IAAI,GAAG,SAAS,CAAA;IAChB,eAAe,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAA;IAE7B,KAAK,GAAG;QACN,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,MAAM;KAClB,CAAA;IAED,IAAI,GAAG;QACL,OAAO,EAAE,yBAAyB;QAClC,KAAK,EAAE,yBAAyB;QAChC,IAAI,EAAE,yBAAyB;KAChC,CAAA;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseFramework, Category, Framework } from './framework.js';
|
|
2
|
+
export declare class Harp extends BaseFramework implements Framework {
|
|
3
|
+
readonly id = "harp";
|
|
4
|
+
name: string;
|
|
5
|
+
npmDependencies: string[];
|
|
6
|
+
category: Category;
|
|
7
|
+
dev: {
|
|
8
|
+
command: string;
|
|
9
|
+
port: number;
|
|
10
|
+
pollingStrategies: {
|
|
11
|
+
name: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
build: {
|
|
15
|
+
command: string;
|
|
16
|
+
directory: string;
|
|
17
|
+
};
|
|
18
|
+
logo: {
|
|
19
|
+
default: string;
|
|
20
|
+
light: string;
|
|
21
|
+
dark: string;
|
|
22
|
+
};
|
|
23
|
+
}
|