mirror of
https://github.com/github/codeql-action.git
synced 2026-11-04 20:20:23 +00:00
Compare commits
2 Commits
v4.39.2
...
mbg/esbuil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7776325064 | ||
|
|
9af13e3a4a |
13
build.mjs
13
build.mjs
@@ -11,6 +11,7 @@ const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const SRC_DIR = join(__dirname, "src");
|
||||
const BUILD_DIR = join(__dirname, "build");
|
||||
const OUT_DIR = join(__dirname, "lib");
|
||||
|
||||
/**
|
||||
@@ -69,7 +70,7 @@ const SHARED_ENTRYPOINT = "entry-points";
|
||||
const UPLOAD_LIB_EXPORT = "uploadLib";
|
||||
|
||||
/** The relative source path of the `upload-lib` module that we re-export from `entry-points`. */
|
||||
const UPLOAD_LIB_SRC = "./src/upload-lib";
|
||||
const UPLOAD_LIB_SRC = "./build/upload-lib.js";
|
||||
|
||||
/**
|
||||
* This plugin finds all source files that contain Action entry points. It then generates the
|
||||
@@ -95,7 +96,7 @@ const entryPointsPlugin = {
|
||||
|
||||
// Find the source files containing Action entry points.
|
||||
build.onStart(() => {
|
||||
const actionFiles = globSync("src/*-action{,-post}.ts");
|
||||
const actionFiles = globSync(join(BUILD_DIR, "*-action{,-post}.js"));
|
||||
for (const actionFile of actionFiles) {
|
||||
const match = basename(actionFile).match(/(.*)-action(-post)?/);
|
||||
|
||||
@@ -137,7 +138,7 @@ const entryPointsPlugin = {
|
||||
const imports = actionsSorted
|
||||
.map(
|
||||
(action) =>
|
||||
`import * as ${action.pascalCaseName} from "./src/${basename(action.path)}";`,
|
||||
`import * as ${action.pascalCaseName} from "./build/${basename(action.path)}";`,
|
||||
)
|
||||
.join("\n");
|
||||
const wrappers = actionsSorted
|
||||
@@ -153,14 +154,14 @@ const entryPointsPlugin = {
|
||||
return {
|
||||
contents: `"use strict";\n${imports}\n\n${uploadLibReExport}\n\n${wrappers}\n`,
|
||||
resolveDir: ".",
|
||||
loader: "ts",
|
||||
loader: "js",
|
||||
};
|
||||
});
|
||||
|
||||
// Emit entry point stubs for each Action using the entry template.
|
||||
build.onEnd(async () => {
|
||||
const makeHeader = (templatePath, sourceFile) =>
|
||||
`// Automatically generated from '${templatePath}' for 'src/${basename(sourceFile)}'.\n\n`;
|
||||
`// Automatically generated from '${templatePath}' for 'build/${basename(sourceFile)}'.\n\n`;
|
||||
|
||||
// Read the entry point template.
|
||||
const actionTemplatePath = "action-entry.js.tpl";
|
||||
@@ -191,7 +192,7 @@ const entryPointsPlugin = {
|
||||
);
|
||||
await writeFile(
|
||||
join(OUT_DIR, "upload-lib.js"),
|
||||
makeHeader(uploadLibStubTemplatePath, `${UPLOAD_LIB_SRC}.ts`) +
|
||||
makeHeader(uploadLibStubTemplatePath, `${UPLOAD_LIB_SRC}`) +
|
||||
uploadLibStubTemplate.replaceAll(
|
||||
"__UPLOAD_LIB_EXPORT__",
|
||||
UPLOAD_LIB_EXPORT,
|
||||
|
||||
2
lib/analyze-entry.js
generated
2
lib/analyze-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/analyze-action.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/analyze-action.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/analyze-post-entry.js
generated
2
lib/analyze-post-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/analyze-action-post.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/analyze-action-post.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/autobuild-entry.js
generated
2
lib/autobuild-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/autobuild-action.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/autobuild-action.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
61537
lib/entry-points.js
generated
61537
lib/entry-points.js
generated
File diff suppressed because it is too large
Load Diff
2
lib/init-entry.js
generated
2
lib/init-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/init-action.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/init-action.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/init-post-entry.js
generated
2
lib/init-post-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/init-action-post.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/init-action-post.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/resolve-environment-entry.js
generated
2
lib/resolve-environment-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/resolve-environment-action.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/resolve-environment-action.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/setup-codeql-entry.js
generated
2
lib/setup-codeql-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/setup-codeql-action.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/setup-codeql-action.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/start-proxy-entry.js
generated
2
lib/start-proxy-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/start-proxy-action.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/start-proxy-action.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/start-proxy-post-entry.js
generated
2
lib/start-proxy-post-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/start-proxy-action-post.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/start-proxy-action-post.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/upload-lib.js
generated
2
lib/upload-lib.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'upload-lib-stub.js.tpl' for 'src/upload-lib.ts'.
|
||||
// Automatically generated from 'upload-lib-stub.js.tpl' for 'build/upload-lib.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/upload-sarif-entry.js
generated
2
lib/upload-sarif-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/upload-sarif-action.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/upload-sarif-action.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
2
lib/upload-sarif-post-entry.js
generated
2
lib/upload-sarif-post-entry.js
generated
@@ -1,4 +1,4 @@
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'src/upload-sarif-action-post.ts'.
|
||||
// Automatically generated from 'action-entry.js.tpl' for 'build/upload-sarif-action-post.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"rootDir": "./src",
|
||||
"sourceMap": true,
|
||||
"types": ["node"],
|
||||
"removeComments": true, /* Remove all comments. */
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
|
||||
Reference in New Issue
Block a user