@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
package/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DirType, FileSystem } from '../file-system.js';
|
|
2
|
-
/** A sample implementation of a
|
|
1
|
+
import { DirType, Environment, FileSystem } from '../file-system.js';
|
|
2
|
+
/** A sample implementation of a GitHub provider */
|
|
3
3
|
export declare class GithubProvider {
|
|
4
4
|
repo: string;
|
|
5
5
|
branch?: string | undefined;
|
|
@@ -11,10 +11,11 @@ export declare class GithubProvider {
|
|
|
11
11
|
read(filePath: string): Promise<string>;
|
|
12
12
|
private request;
|
|
13
13
|
}
|
|
14
|
-
/** A sample implementation of a web based file system that fetches from
|
|
14
|
+
/** A sample implementation of a web based file system that fetches from GitHub */
|
|
15
15
|
export declare class WebFS extends FileSystem {
|
|
16
16
|
git: GithubProvider;
|
|
17
17
|
constructor(git: GithubProvider);
|
|
18
|
+
getEnvironment(): Environment;
|
|
18
19
|
isAbsolute(path: string): boolean;
|
|
19
20
|
resolve(...paths: string[]): string;
|
|
20
21
|
fileExists(path: string): Promise<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileSystem } from '../file-system.js';
|
|
2
|
-
/** A sample implementation of a
|
|
2
|
+
/** A sample implementation of a GitHub provider */
|
|
3
3
|
export class GithubProvider {
|
|
4
4
|
repo;
|
|
5
5
|
branch;
|
|
@@ -34,13 +34,16 @@ export class GithubProvider {
|
|
|
34
34
|
return response.text();
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
/** A sample implementation of a web based file system that fetches from
|
|
37
|
+
/** A sample implementation of a web based file system that fetches from GitHub */
|
|
38
38
|
export class WebFS extends FileSystem {
|
|
39
39
|
git;
|
|
40
40
|
constructor(git) {
|
|
41
41
|
super();
|
|
42
42
|
this.git = git;
|
|
43
43
|
}
|
|
44
|
+
getEnvironment() {
|
|
45
|
+
return "browser" /* Environment.Browser */;
|
|
46
|
+
}
|
|
44
47
|
isAbsolute(path) {
|
|
45
48
|
return path.startsWith('/');
|
|
46
49
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../../src/browser/file-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEpE,mDAAmD;AACnD,MAAM,OAAO,cAAc;IACN;IAAqB;IAAxC,YAAmB,IAAY,EAAS,MAAe;QAApC,SAAI,GAAJ,IAAI,CAAQ;QAAS,WAAM,GAAN,MAAM,CAAS;IAAG,CAAC;IAE3D,KAAK,CAAC,GAAG,CAAC,QAAQ,GAAG,EAAE;QACrB,IAAI,IAAI,GAAG,UAAU,IAAI,CAAC,IAAI,YAAY,QAA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,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Project } from '../project.js';
|
|
2
1
|
import { BaseBuildTool } from './build-system.js';
|
|
3
2
|
export declare class Bazel extends BaseBuildTool {
|
|
4
3
|
id: string;
|
|
5
4
|
name: string;
|
|
6
5
|
configFiles: string[];
|
|
7
|
-
detect(
|
|
6
|
+
detect(): Promise<this | undefined>;
|
|
8
7
|
}
|
|
@@ -3,8 +3,11 @@ export class Bazel extends BaseBuildTool {
|
|
|
3
3
|
id = 'bazel';
|
|
4
4
|
name = 'Bazel';
|
|
5
5
|
configFiles = ['.bazelrc', 'WORKSPACE', 'WORKSPACE.bazel', 'BUILD.bazel'];
|
|
6
|
-
async detect(
|
|
7
|
-
const config = await project.fs.findUp(this.configFiles, {
|
|
6
|
+
async detect() {
|
|
7
|
+
const config = await this.project.fs.findUp(this.configFiles, {
|
|
8
|
+
cwd: this.project.baseDirectory,
|
|
9
|
+
stopAt: this.project.root,
|
|
10
|
+
});
|
|
8
11
|
if (config) {
|
|
9
12
|
return this;
|
|
10
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bazel.js","sourceRoot":"","sources":["../../../src/build-systems/bazel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,KAAM,SAAQ,aAAa;IACtC,EAAE,GAAG,OAAO,CAAA;IACZ,IAAI,GAAG,OAAO,CAAA;IACd,WAAW,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAA;IAEzE,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;YAC5D,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Project } from '../project.js';
|
|
2
1
|
import { BaseBuildTool } from './build-system.js';
|
|
3
2
|
export declare class Buck extends BaseBuildTool {
|
|
4
3
|
id: string;
|
|
5
4
|
name: string;
|
|
6
5
|
configFiles: string[];
|
|
7
|
-
detect(
|
|
6
|
+
detect(): Promise<this | undefined>;
|
|
8
7
|
}
|
|
@@ -3,8 +3,11 @@ export class Buck extends BaseBuildTool {
|
|
|
3
3
|
id = 'buck';
|
|
4
4
|
name = 'Buck';
|
|
5
5
|
configFiles = ['.buckconfig', 'BUCK'];
|
|
6
|
-
async detect(
|
|
7
|
-
const config = await project.fs.findUp(this.configFiles, {
|
|
6
|
+
async detect() {
|
|
7
|
+
const config = await this.project.fs.findUp(this.configFiles, {
|
|
8
|
+
cwd: this.project.baseDirectory,
|
|
9
|
+
stopAt: this.project.root,
|
|
10
|
+
});
|
|
8
11
|
if (config) {
|
|
9
12
|
return this;
|
|
10
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buck.js","sourceRoot":"","sources":["../../../src/build-systems/buck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,IAAK,SAAQ,aAAa;IACrC,EAAE,GAAG,MAAM,CAAA;IACX,IAAI,GAAG,MAAM,CAAA;IACb,WAAW,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IAErC,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;YAC5D,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PollingStrategy } from '../frameworks/framework.js';
|
|
2
|
+
import { Project } from '../project.js';
|
|
3
|
+
export type Command = {
|
|
4
|
+
type: 'build' | 'dev' | 'unknown';
|
|
5
|
+
command: string;
|
|
6
|
+
};
|
|
7
|
+
export interface BuildSystem {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
project: Project;
|
|
11
|
+
version?: string;
|
|
12
|
+
build?: {
|
|
13
|
+
command: string;
|
|
14
|
+
directory?: string;
|
|
15
|
+
};
|
|
16
|
+
dev?: {
|
|
17
|
+
command: string;
|
|
18
|
+
port?: number;
|
|
19
|
+
pollingStrategies?: PollingStrategy[];
|
|
20
|
+
};
|
|
21
|
+
getCommands?(path: string): Promise<Command[]>;
|
|
22
|
+
detect(): Promise<BuildSystem | undefined>;
|
|
23
|
+
}
|
|
24
|
+
export declare abstract class BaseBuildTool {
|
|
25
|
+
project: Project;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
version?: string;
|
|
29
|
+
configFiles: string[];
|
|
30
|
+
constructor(project: Project);
|
|
31
|
+
detect(): Promise<this | undefined>;
|
|
32
|
+
/** Gets a JSON from the class information */
|
|
33
|
+
toJSON(): {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
version: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class BaseBuildTool {
|
|
2
|
+
project;
|
|
3
|
+
id;
|
|
4
|
+
name;
|
|
5
|
+
version;
|
|
6
|
+
configFiles = [];
|
|
7
|
+
constructor(project) {
|
|
8
|
+
this.project = project;
|
|
9
|
+
}
|
|
10
|
+
async detect() {
|
|
11
|
+
const config = await this.project.fs.findUp(this.configFiles, {
|
|
12
|
+
cwd: this.project.baseDirectory,
|
|
13
|
+
stopAt: this.project.root,
|
|
14
|
+
});
|
|
15
|
+
if (config) {
|
|
16
|
+
const pkgJson = await this.project.getPackageJSON(this.project.fs.dirname(config));
|
|
17
|
+
this.version = pkgJson.devDependencies?.[this.id];
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** Gets a JSON from the class information */
|
|
22
|
+
toJSON() {
|
|
23
|
+
return {
|
|
24
|
+
id: this.id,
|
|
25
|
+
name: this.name,
|
|
26
|
+
version: this.version,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=build-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-system.js","sourceRoot":"","sources":["../../../src/build-systems/build-system.ts"],"names":[],"mappings":"AA8BA,MAAM,OAAgB,aAAa;IAMd;IALnB,EAAE,CAAQ;IACV,IAAI,CAAQ;IACZ,OAAO,CAAS;IAChB,WAAW,GAAa,EAAE,CAAA;IAE1B,YAAmB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAEvC,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;YAC5D,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;YAClF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACjD,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;IAED,6CAA6C;IAC7C,MAAM;QACJ,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Project } from '../project.js';
|
|
2
1
|
import { BaseBuildTool } from './build-system.js';
|
|
3
2
|
export declare class Gradle extends BaseBuildTool {
|
|
4
3
|
id: string;
|
|
5
4
|
name: string;
|
|
6
5
|
configFiles: string[];
|
|
7
|
-
detect(
|
|
6
|
+
detect(): Promise<this | undefined>;
|
|
8
7
|
}
|
|
@@ -3,8 +3,11 @@ export class Gradle extends BaseBuildTool {
|
|
|
3
3
|
id = 'gradle';
|
|
4
4
|
name = 'Gradle';
|
|
5
5
|
configFiles = ['build.gradle'];
|
|
6
|
-
async detect(
|
|
7
|
-
const config = await project.fs.findUp(this.configFiles, {
|
|
6
|
+
async detect() {
|
|
7
|
+
const config = await this.project.fs.findUp(this.configFiles, {
|
|
8
|
+
cwd: this.project.baseDirectory,
|
|
9
|
+
stopAt: this.project.root,
|
|
10
|
+
});
|
|
8
11
|
if (config) {
|
|
9
12
|
return this;
|
|
10
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradle.js","sourceRoot":"","sources":["../../../src/build-systems/gradle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,MAAO,SAAQ,aAAa;IACvC,EAAE,GAAG,QAAQ,CAAA;IACb,IAAI,GAAG,QAAQ,CAAA;IACf,WAAW,GAAG,CAAC,cAAc,CAAC,CAAA;IAE9B,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;YAC5D,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Bazel } from './bazel.js';
|
|
2
|
+
import { Buck } from './buck.js';
|
|
3
|
+
import { Gradle } from './gradle.js';
|
|
4
|
+
import { Lage } from './lage.js';
|
|
5
|
+
import { Moon } from './moon.js';
|
|
6
|
+
import { Nix } from './nix.js';
|
|
7
|
+
import { Lerna, Nx } from './nrwl.js';
|
|
8
|
+
import { Pants } from './pants.js';
|
|
9
|
+
import { Rush } from './rush.js';
|
|
10
|
+
import { Turbo } from './turbo.js';
|
|
11
|
+
export declare const buildSystems: readonly [typeof Bazel, typeof Buck, typeof Gradle, typeof Lage, typeof Lerna, typeof Moon, typeof Nix, typeof Nx, typeof Pants, typeof Rush, typeof Turbo];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/build-systems/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lage.js","sourceRoot":"","sources":["../../../src/build-systems/lage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,IAAK,SAAQ,aAAa;IACrC,EAAE,GAAG,MAAM,CAAA;IACX,IAAI,GAAG,MAAM,CAAA;IACb,WAAW,GAAG,CAAC,gBAAgB,CAAC,CAAA;CACjC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Project } from '../project.js';
|
|
2
1
|
import { BaseBuildTool } from './build-system.js';
|
|
3
2
|
export declare class Moon extends BaseBuildTool {
|
|
4
3
|
id: string;
|
|
5
4
|
name: string;
|
|
6
5
|
configFiles: string[];
|
|
7
|
-
detect(
|
|
6
|
+
detect(): Promise<this | undefined>;
|
|
8
7
|
}
|
|
@@ -3,14 +3,14 @@ export class Moon extends BaseBuildTool {
|
|
|
3
3
|
id = 'moon';
|
|
4
4
|
name = 'MoonRepo';
|
|
5
5
|
configFiles = ['.moon'];
|
|
6
|
-
async detect(
|
|
7
|
-
const config = await project.fs.findUp(this.configFiles, {
|
|
8
|
-
cwd: project.baseDirectory,
|
|
6
|
+
async detect() {
|
|
7
|
+
const config = await this.project.fs.findUp(this.configFiles, {
|
|
8
|
+
cwd: this.project.baseDirectory,
|
|
9
9
|
type: 'directory',
|
|
10
|
-
stopAt: project.root,
|
|
10
|
+
stopAt: this.project.root,
|
|
11
11
|
});
|
|
12
12
|
if (config) {
|
|
13
|
-
const pkgJson = await project.getPackageJSON(config);
|
|
13
|
+
const pkgJson = await this.project.getPackageJSON(config);
|
|
14
14
|
this.version = pkgJson.devDependencies?.[this.id];
|
|
15
15
|
return this;
|
|
16
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moon.js","sourceRoot":"","sources":["../../../src/build-systems/moon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,IAAK,SAAQ,aAAa;IACrC,EAAE,GAAG,MAAM,CAAA;IACX,IAAI,GAAG,UAAU,CAAA;IACjB,WAAW,GAAG,CAAC,OAAO,CAAC,CAAA;IAEvB,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;YAC5D,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;YAC/B,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;YACzD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YACjD,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CACF"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Project } from '../project.js';
|
|
2
1
|
import { BaseBuildTool } from './build-system.js';
|
|
3
2
|
export declare class Nix extends BaseBuildTool {
|
|
4
3
|
id: string;
|
|
5
4
|
name: string;
|
|
6
5
|
configFiles: string[];
|
|
7
|
-
detect(
|
|
6
|
+
detect(): Promise<this | undefined>;
|
|
8
7
|
}
|
|
@@ -3,8 +3,11 @@ export class Nix extends BaseBuildTool {
|
|
|
3
3
|
id = 'nix';
|
|
4
4
|
name = 'Nix';
|
|
5
5
|
configFiles = ['default.nix', 'shell.nix', 'release.nix'];
|
|
6
|
-
async detect(
|
|
7
|
-
const config = await project.fs.findUp(this.configFiles, {
|
|
6
|
+
async detect() {
|
|
7
|
+
const config = await this.project.fs.findUp(this.configFiles, {
|
|
8
|
+
cwd: this.project.baseDirectory,
|
|
9
|
+
stopAt: this.project.root,
|
|
10
|
+
});
|
|
8
11
|
if (config) {
|
|
9
12
|
return this;
|
|
10
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nix.js","sourceRoot":"","sources":["../../../src/build-systems/nix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,GAAI,SAAQ,aAAa;IACpC,EAAE,GAAG,KAAK,CAAA;IACV,IAAI,GAAG,KAAK,CAAA;IACZ,WAAW,GAAG,CAAC,aAAa,EAAE,WAAW,EAAE,aAAa,CAAC,CAAA;IAEzD,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;YAC5D,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseBuildTool, Command } from './build-system.js';
|
|
2
|
+
export declare class Nx extends BaseBuildTool {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
configFiles: string[];
|
|
6
|
+
build: {};
|
|
7
|
+
/** Retrieves a list of possible commands for a package */
|
|
8
|
+
getCommands(packagePath: string): Promise<Command[]>;
|
|
9
|
+
detect(): Promise<this | undefined>;
|
|
10
|
+
}
|
|
11
|
+
export declare class Lerna extends BaseBuildTool {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
configFiles: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { findPackages } from '../workspaces/get-workspace-packages.js';
|
|
2
|
+
import { BaseBuildTool } from './build-system.js';
|
|
3
|
+
export class Nx extends BaseBuildTool {
|
|
4
|
+
id = 'nx';
|
|
5
|
+
name = 'Nx';
|
|
6
|
+
configFiles = ['nx.json'];
|
|
7
|
+
build = {};
|
|
8
|
+
/** Retrieves a list of possible commands for a package */
|
|
9
|
+
async getCommands(packagePath) {
|
|
10
|
+
const { name, targets } = await this.project.fs.readJSON(this.project.fs.join(packagePath, 'project.json'));
|
|
11
|
+
if (name && targets) {
|
|
12
|
+
return Object.keys(targets).map((target) => {
|
|
13
|
+
let type = 'unknown';
|
|
14
|
+
if (['dev', 'serve'].includes(target)) {
|
|
15
|
+
type = 'dev';
|
|
16
|
+
}
|
|
17
|
+
if (['build'].includes(target)) {
|
|
18
|
+
type = 'build';
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
type,
|
|
22
|
+
command: `nx run ${name}:${target}`,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
async detect() {
|
|
29
|
+
const detected = await super.detect();
|
|
30
|
+
const fs = this.project.fs;
|
|
31
|
+
if (detected) {
|
|
32
|
+
try {
|
|
33
|
+
// in nx integrated setup the workspace is not managed through the package manager
|
|
34
|
+
// in this case we have to check the `nx.json` for the project references
|
|
35
|
+
if (this.project.workspace === null) {
|
|
36
|
+
const { workspaceLayout } = await fs.readJSON(fs.join(this.project.jsWorkspaceRoot, 'nx.json'));
|
|
37
|
+
// if an apps dir is specified get it.
|
|
38
|
+
if (workspaceLayout?.appsDir?.length) {
|
|
39
|
+
const identifyPkg = async ({ entry, directory }) => {
|
|
40
|
+
if (entry === 'project.json') {
|
|
41
|
+
try {
|
|
42
|
+
// we need to check the project json for application types (we don't care about libraries)
|
|
43
|
+
const { projectType } = await fs.readJSON(fs.join(directory, entry));
|
|
44
|
+
return projectType === 'application';
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
};
|
|
52
|
+
const packages = await findPackages(this.project, workspaceLayout.appsDir, identifyPkg, '*');
|
|
53
|
+
this.project.workspace = {
|
|
54
|
+
isRoot: this.project.jsWorkspaceRoot === this.project.baseDirectory,
|
|
55
|
+
packages,
|
|
56
|
+
rootDir: this.project.jsWorkspaceRoot,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// noop
|
|
63
|
+
}
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export class Lerna extends BaseBuildTool {
|
|
69
|
+
id = 'lerna';
|
|
70
|
+
name = 'Lerna';
|
|
71
|
+
configFiles = ['lerna.json'];
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=nrwl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nrwl.js","sourceRoot":"","sources":["../../../src/build-systems/nrwl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,yCAAyC,CAAA;AAEzF,OAAO,EAAE,aAAa,EAAW,MAAM,mBAAmB,CAAA;AAE1D,MAAM,OAAO,EAAG,SAAQ,aAAa;IACnC,EAAE,GAAG,IAAI,CAAA;IACT,IAAI,GAAG,IAAI,CAAA;IACX,WAAW,GAAG,CAAC,SAAS,CAAC,CAAA;IAEzB,KAAK,GAAG,EAAE,CAAA;IAEV,0DAA0D;IAC1D,KAAK,CAAC,WAAW,CAAC,WAAmB;QACnC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,C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AE;4BACpE,IAAI,KAAK,KAAK,cAAc,EAAE;gCAC5B,IAAI;oCACF,0FAA0F;oCAC1F,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;oCACpE,OAAO,WAAW,KAAK,aAAa,CAAA;iCACrC;gCAAC,MAAM;oCACN,OAAO,KAAK,CAAA;iCACb;6BACF;4BACD,OAAO,KAAK,CAAA;wBACd,CAAC,CAAA;wBACD,MAAM,QAAQ,GAAG,MAAM,YAAY,CACjC,IAAI,CAAC,OAAO,EACZ,eAAe,CAAC,OAAO,EACvB,WAAW,EACX,GAAG,CACJ,CAAA;wBACD,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG;4BACvB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,OAAO,CAAC,aAAa;4BACnE,QAAQ;4BACR,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe;yBACtC,CAAA;qBACF;iBACF;aACF;YAAC,MAAM;gBACN,OAAO;aACR;YACD,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CACF;AAED,MAAM,OAAO,KAAM,SAAQ,aAAa;IACtC,EAAE,GAAG,OAAO,CAAA;IACZ,IAAI,GAAG,OAAO,CAAA;IACd,WAAW,GAAG,CAAC,YAAY,CAAC,CAAA;CAC7B"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Project } from '../project.js';
|
|
2
1
|
import { BaseBuildTool } from './build-system.js';
|
|
3
2
|
export declare class Pants extends BaseBuildTool {
|
|
4
3
|
id: string;
|
|
5
4
|
name: string;
|
|
6
5
|
configFiles: string[];
|
|
7
|
-
detect(
|
|
6
|
+
detect(): Promise<this | undefined>;
|
|
8
7
|
}
|
|
@@ -3,8 +3,11 @@ export class Pants extends BaseBuildTool {
|
|
|
3
3
|
id = 'pants';
|
|
4
4
|
name = 'Pants';
|
|
5
5
|
configFiles = ['pants.toml'];
|
|
6
|
-
async detect(
|
|
7
|
-
const config = await project.fs.findUp(this.configFiles, {
|
|
6
|
+
async detect() {
|
|
7
|
+
const config = await this.project.fs.findUp(this.configFiles, {
|
|
8
|
+
cwd: this.project.baseDirectory,
|
|
9
|
+
stopAt: this.project.root,
|
|
10
|
+
});
|
|
8
11
|
if (config) {
|
|
9
12
|
return this;
|
|
10
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pants.js","sourceRoot":"","sources":["../../../src/build-systems/pants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,KAAM,SAAQ,aAAa;IACtC,EAAE,GAAG,OAAO,CAAA;IACZ,IAAI,GAAG,OAAO,CAAA;IACd,WAAW,GAAG,CAAC,YAAY,CAAC,CAAA;IAE5B,KAAK,CAAC,MAAM;QACV,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;YAC5D,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa;YAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;SAC1B,CAAC,CAAA;QAEF,IAAI,MAAM,EAAE;YACV,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rush.js","sourceRoot":"","sources":["../../../src/build-systems/rush.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,IAAK,SAAQ,aAAa;IACrC,EAAE,GAAG,MAAM,CAAA;IACX,IAAI,GAAG,MAAM,CAAA;IACb,WAAW,GAAG,CAAC,WAAW,CAAC,CAAA;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"turbo.js","sourceRoot":"","sources":["../../../src/build-systems/turbo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,MAAM,OAAO,KAAM,SAAQ,aAAa;IACtC,EAAE,GAAG,OAAO,CAAA;IACZ,IAAI,GAAG,WAAW,CAAA;IAClB,WAAW,GAAG,CAAC,YAAY,CAAC,CAAA;CAC7B"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export declare const enum Environment {
|
|
2
|
+
Browser = "browser",
|
|
3
|
+
Node = "node"
|
|
4
|
+
}
|
|
1
5
|
export interface Logger {
|
|
2
6
|
debug(...any: any[]): void;
|
|
3
7
|
log(...any: any[]): void;
|
|
@@ -24,17 +28,13 @@ export type findUpOptions = {
|
|
|
24
28
|
type?: DirType;
|
|
25
29
|
stopAt?: string;
|
|
26
30
|
};
|
|
31
|
+
/** A platform independent version of path.join() */
|
|
32
|
+
export declare function join(...segments: string[]): string;
|
|
27
33
|
export declare abstract class FileSystem {
|
|
28
34
|
logger: Logger;
|
|
29
|
-
/**
|
|
30
|
-
* This is a in memory representation of the parsed files
|
|
31
|
-
* The keys are always stored in posix style
|
|
32
|
-
* If the value is null then the file did not get read up in memory yet.
|
|
33
|
-
* If the value is a string it already got read up in mem.
|
|
34
|
-
*/
|
|
35
|
-
files: Map<string, File | null>;
|
|
36
35
|
/** The current working directory will be set by the project */
|
|
37
36
|
cwd: string;
|
|
37
|
+
abstract getEnvironment(): Environment;
|
|
38
38
|
abstract fileExists(path: string): Promise<boolean>;
|
|
39
39
|
abstract readDir(path: string): Promise<string[]>;
|
|
40
40
|
abstract readDir(path: string, withFileTypes: true): Promise<Record<string, DirType>>;
|
|
@@ -52,16 +52,8 @@ export declare abstract class FileSystem {
|
|
|
52
52
|
dirname(path: string): string;
|
|
53
53
|
/** A platform independent version of path.join() */
|
|
54
54
|
join(...segments: string[]): string;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
/** get a file from the file map */
|
|
58
|
-
getFile(path: string): File | null;
|
|
59
|
-
/** get a json file from the file map */
|
|
60
|
-
getJSONFile<T = Record<string, any>>(path: string): JSONFile<T> | null;
|
|
61
|
-
/** get a toml file from the file map */
|
|
62
|
-
getTOMLFile(path: string): TOMLFile | null;
|
|
63
|
-
/** Checks if a file is already in our in memory representation */
|
|
64
|
-
hasFile(path: any): boolean;
|
|
55
|
+
/** Gracefully reads the file and returns null if it does not exist */
|
|
56
|
+
gracefullyReadFile(path: string): Promise<string | null>;
|
|
65
57
|
/** Gracefully reads a file as JSON and parses it */
|
|
66
58
|
readJSON<V = Record<string, unknown>>(path: string): Promise<Partial<V>>;
|
|
67
59
|
/** Find a file or directory by walking up parent directories. */
|
|
@@ -19,15 +19,37 @@ class DefaultLogger {
|
|
|
19
19
|
console.warn(...data);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
/** A platform independent version of path.join() */
|
|
23
|
+
export function join(...segments) {
|
|
24
|
+
let parts = [];
|
|
25
|
+
for (let i = 0, max = segments.length; i < max; i++) {
|
|
26
|
+
// split the segments to parts by all kind of separator (forward and backward)
|
|
27
|
+
parts = parts.concat(segments[i].split(/[\\/]/g));
|
|
28
|
+
}
|
|
29
|
+
// resolve .. inside path segments
|
|
30
|
+
const resolvedParts = [];
|
|
31
|
+
for (let i = 0, max = parts.length; i < max; i++) {
|
|
32
|
+
const part = parts[i];
|
|
33
|
+
// Remove leading and trailing slashes
|
|
34
|
+
// Also remove "." segments
|
|
35
|
+
if (!part || part === '.')
|
|
36
|
+
continue;
|
|
37
|
+
// Interpret ".." to pop the last segment
|
|
38
|
+
if (part === '..') {
|
|
39
|
+
resolvedParts.pop();
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
resolvedParts.push(part);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Preserve the initial slash if there was one.
|
|
46
|
+
if (parts[0] === '') {
|
|
47
|
+
resolvedParts.unshift('');
|
|
48
|
+
}
|
|
49
|
+
return resolvedParts.join('/') || (resolvedParts.length ? '/' : '.');
|
|
50
|
+
}
|
|
22
51
|
export class FileSystem {
|
|
23
52
|
logger = new DefaultLogger();
|
|
24
|
-
/**
|
|
25
|
-
* This is a in memory representation of the parsed files
|
|
26
|
-
* The keys are always stored in posix style
|
|
27
|
-
* If the value is null then the file did not get read up in memory yet.
|
|
28
|
-
* If the value is a string it already got read up in mem.
|
|
29
|
-
*/
|
|
30
|
-
files = new Map();
|
|
31
53
|
/** The current working directory will be set by the project */
|
|
32
54
|
cwd = '/';
|
|
33
55
|
/** returns the last portion of a path */
|
|
@@ -59,7 +81,7 @@ export class FileSystem {
|
|
|
59
81
|
const fromUp = fromParts.length - matching.length;
|
|
60
82
|
// the max we have to go up
|
|
61
83
|
const up = Math.max(toUp, fromUp);
|
|
62
|
-
// if we have something from the 'from' to go up
|
|
84
|
+
// if we have something from the 'from' to go up the max difference
|
|
63
85
|
const result = fromUp > 0 ? [...new Array(up).fill('..')] : [];
|
|
64
86
|
// if we have some parts left add them to the going up
|
|
65
87
|
if (toUp > 0) {
|
|
@@ -79,69 +101,21 @@ export class FileSystem {
|
|
|
79
101
|
}
|
|
80
102
|
/** A platform independent version of path.join() */
|
|
81
103
|
join(...segments) {
|
|
82
|
-
|
|
83
|
-
for (let i = 0, max = segments.length; i < max; i++) {
|
|
84
|
-
// split the segments to parts by all kind of separator (forward and backward)
|
|
85
|
-
parts = parts.concat(segments[i].split(/[\\/]/g));
|
|
86
|
-
}
|
|
87
|
-
// resolve .. inside path segments
|
|
88
|
-
const resolvedParts = [];
|
|
89
|
-
for (let i = 0, max = parts.length; i < max; i++) {
|
|
90
|
-
const part = parts[i];
|
|
91
|
-
// Remove leading and trailing slashes
|
|
92
|
-
// Also remove "." segments
|
|
93
|
-
if (!part || part === '.')
|
|
94
|
-
continue;
|
|
95
|
-
// Interpret ".." to pop the last segment
|
|
96
|
-
if (part === '..') {
|
|
97
|
-
resolvedParts.pop();
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
resolvedParts.push(part);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
// Preserve the initial slash if there was one.
|
|
104
|
-
if (parts[0] === '') {
|
|
105
|
-
resolvedParts.unshift('');
|
|
106
|
-
}
|
|
107
|
-
return resolvedParts.join('/') || (resolvedParts.length ? '/' : '.');
|
|
108
|
-
}
|
|
109
|
-
/** adds a file to the file map */
|
|
110
|
-
setFile(path, content) {
|
|
111
|
-
this.files.set(path, content);
|
|
104
|
+
return join(...segments);
|
|
112
105
|
}
|
|
113
|
-
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/** get a json file from the file map */
|
|
118
|
-
getJSONFile(path) {
|
|
119
|
-
const file = this.files.get(path) || null;
|
|
120
|
-
if (file?.type === 'json') {
|
|
121
|
-
return file;
|
|
106
|
+
/** Gracefully reads the file and returns null if it does not exist */
|
|
107
|
+
async gracefullyReadFile(path) {
|
|
108
|
+
try {
|
|
109
|
+
return await this.readFile(path);
|
|
122
110
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/** get a toml file from the file map */
|
|
126
|
-
getTOMLFile(path) {
|
|
127
|
-
const file = this.files.get(path) || null;
|
|
128
|
-
if (file?.type === 'toml') {
|
|
129
|
-
return file;
|
|
111
|
+
catch {
|
|
112
|
+
return null;
|
|
130
113
|
}
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
/** Checks if a file is already in our in memory representation */
|
|
134
|
-
hasFile(path) {
|
|
135
|
-
const resolvedPath = path;
|
|
136
|
-
const file = this.files.get(resolvedPath);
|
|
137
|
-
return Boolean(file?.content);
|
|
138
114
|
}
|
|
139
115
|
/** Gracefully reads a file as JSON and parses it */
|
|
140
116
|
async readJSON(path) {
|
|
141
117
|
try {
|
|
142
|
-
|
|
143
|
-
this.files.set(path, { content, type: 'json' });
|
|
144
|
-
return content;
|
|
118
|
+
return JSON.parse(await this.readFile(path));
|
|
145
119
|
}
|
|
146
120
|
catch (error) {
|
|
147
121
|
this.logger.error(`Could not parse JSON file ${path}\n${error}`);
|