mirror of
https://github.com/github/codeql-action.git
synced 2026-10-21 10:11:28 +00:00
Use tsc output in build.mjs rather than compiling twice
This commit is contained in:
@@ -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");
|
||||
|
||||
/**
|
||||
@@ -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,7 +154,7 @@ const entryPointsPlugin = {
|
||||
return {
|
||||
contents: `"use strict";\n${imports}\n\n${uploadLibReExport}\n\n${wrappers}\n`,
|
||||
resolveDir: ".",
|
||||
loader: "ts",
|
||||
loader: "js",
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
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 'src/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 'src/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 'src/autobuild-action.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
47242
lib/entry-points.js
generated
47242
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 'src/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 'src/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 'src/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 'src/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 'src/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 'src/start-proxy-action-post.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 'src/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 'src/upload-sarif-action-post.js'.
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user