-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
85 changed files
with
5,534 additions
and
1,350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ body: | |
options: | ||
- Stable | ||
- Development | ||
- Experimental | ||
validations: | ||
required: true | ||
- type: textarea | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
const dotenv = require('dotenv'); | ||
const path = require("path"); | ||
|
||
function defineEnvVars() { | ||
dotenv.config({ path: '.env.local' }); | ||
dotenv.config(); | ||
|
||
const defines = {}; | ||
|
||
for (const envVar of Object.keys(process.env)) { | ||
const value = process.env[envVar].trim(); | ||
|
||
let replacement; | ||
if (value.trim() === 'true' || value.trim() === 'false') { | ||
replacement = value; | ||
} else if (!Number.isNaN(parseFloat(value))) { | ||
replacement = parseFloat(value).toString(); | ||
} else { | ||
replacement = `"${value}"`; | ||
} | ||
|
||
defines[`process.env.${envVar}`] = replacement; | ||
} | ||
|
||
return defines; | ||
} | ||
|
||
module.exports.defineEnvVars = defineEnvVars; | ||
|
||
/** | ||
* @param projectRoot {string} the project root folder, as a path relative to the root of the repository | ||
* @param globalName {string|undefined} the name of the global to define in the output IIFE | ||
* @param entryPoint {string} the entrypoint path, as an absolute path | ||
* @param outFile {string} the output file path, as a path relative to the root of the repository | ||
*/ | ||
function esbuildModuleBuild(projectRoot, globalName, entryPoint, outFile) { | ||
const isProductionBuild = process.env.A32NX_PRODUCTION_BUILD === '1'; | ||
|
||
process.chdir(projectRoot); | ||
|
||
return { | ||
absWorkingDir: __dirname, | ||
|
||
define: { DEBUG: 'false', ...defineEnvVars() }, | ||
|
||
entryPoints: [entryPoint], | ||
bundle: true, | ||
treeShaking: false, | ||
minify: isProductionBuild, | ||
|
||
outfile: path.join(__dirname, outFile), | ||
|
||
format: 'iife', | ||
globalName, | ||
|
||
sourcemap: isProductionBuild ? undefined : 'linked', | ||
|
||
// Target approximate CoherentGT WebKit version | ||
target: 'safari11', | ||
}; | ||
} | ||
|
||
module.exports.esbuildModuleBuild = esbuildModuleBuild; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.