-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(efb): Fuel Page Airframe request
- Loading branch information
1 parent
e454050
commit f73b432
Showing
9 changed files
with
349 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// Copyright (c) 2022 FlyByWire Simulations | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
import fs from 'fs'; | ||
import { join } from 'path'; | ||
import image from '@rollup/plugin-image'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import { babel as babelPlugin } from '@rollup/plugin-babel'; | ||
import { typescriptPaths } from 'rollup-plugin-typescript-paths'; | ||
import replace from '@rollup/plugin-replace'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import tailwindcss from 'tailwindcss'; | ||
import dotenv from 'dotenv'; | ||
import json from '@rollup/plugin-json'; | ||
import postcssColorFunctionalNotation from 'postcss-color-functional-notation'; | ||
import { Directories } from './directories.mjs'; | ||
|
||
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs']; | ||
|
||
dotenv.config(); | ||
|
||
function babel() { | ||
return babelPlugin({ | ||
presets: [ | ||
['@babel/preset-env', { targets: { safari: '11' } }], | ||
['@babel/preset-react', { runtime: 'automatic', throwIfNamespace: false }], | ||
['@babel/preset-typescript'], | ||
], | ||
plugins: [ | ||
'@babel/plugin-proposal-class-properties', | ||
['@babel/plugin-transform-runtime', { regenerator: true }], | ||
], | ||
babelHelpers: 'runtime', | ||
compact: false, | ||
extensions, | ||
}); | ||
} | ||
|
||
function postCss(_, instrumentFolder) { | ||
let plugins; | ||
|
||
const tailwindConfigPath = join(Directories.instruments, 'src', instrumentFolder, 'tailwind.config.js'); | ||
|
||
if (fs.existsSync(tailwindConfigPath)) { | ||
plugins = [ | ||
tailwindcss(tailwindConfigPath), | ||
]; | ||
} else { | ||
plugins = []; | ||
} | ||
|
||
plugins.push(postcssColorFunctionalNotation()); | ||
|
||
return postcss({ | ||
use: { sass: {} }, | ||
plugins, | ||
extract: 'bundle.css', | ||
}); | ||
} | ||
|
||
export function baseCompile(instrumentName, instrumentFolder) { | ||
return [ | ||
image(), | ||
nodeResolve({ extensions, browser: true }), | ||
json(), | ||
commonjs({ include: /node_modules/ }), | ||
babel(), | ||
typescriptPaths({ | ||
tsConfigPath: join(Directories.src, 'tsconfig.json'), | ||
preserveExtensions: true, | ||
}), | ||
replace({ | ||
'DEBUG': 'false', | ||
'preventAssignment': true, | ||
'process.env.VITE_BUILD': 'false', | ||
'process.env.NODE_ENV': JSON.stringify('production'), | ||
'process.env.CLIENT_ID': JSON.stringify(process.env.CLIENT_ID), | ||
'process.env.CLIENT_SECRET': JSON.stringify(process.env.CLIENT_SECRET), | ||
'process.env.CHARTFOX_SECRET': JSON.stringify(process.env.CHARTFOX_SECRET), | ||
'process.env.SENTRY_DSN': JSON.stringify(process.env.SENTRY_DSN), | ||
}), | ||
postCss(instrumentName, instrumentFolder), | ||
]; | ||
} |
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,85 @@ | ||
// Copyright (c) 2022 FlyByWire Simulations | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
import fs from 'fs'; | ||
import { join } from 'path'; | ||
import image from '@rollup/plugin-image'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import { babel as babelPlugin } from '@rollup/plugin-babel'; | ||
import { typescriptPaths } from 'rollup-plugin-typescript-paths'; | ||
import replace from '@rollup/plugin-replace'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import tailwindcss from 'tailwindcss'; | ||
import dotenv from 'dotenv'; | ||
import json from '@rollup/plugin-json'; | ||
import postcssColorFunctionalNotation from 'postcss-color-functional-notation'; | ||
import { Directories } from './directories.mjs'; | ||
|
||
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs']; | ||
|
||
dotenv.config(); | ||
|
||
function babel() { | ||
return babelPlugin({ | ||
presets: [ | ||
['@babel/preset-env', { targets: { safari: '11' } }], | ||
['@babel/preset-react', { runtime: 'automatic', throwIfNamespace: false }], | ||
['@babel/preset-typescript'], | ||
], | ||
plugins: [ | ||
'@babel/plugin-proposal-class-properties', | ||
['@babel/plugin-transform-runtime', { regenerator: true }], | ||
], | ||
babelHelpers: 'runtime', | ||
compact: false, | ||
extensions, | ||
}); | ||
} | ||
|
||
function postCss(_, instrumentFolder) { | ||
let plugins; | ||
|
||
const tailwindConfigPath = join(Directories.instruments, 'src', instrumentFolder, 'tailwind.config.js'); | ||
|
||
if (fs.existsSync(tailwindConfigPath)) { | ||
plugins = [ | ||
tailwindcss(tailwindConfigPath), | ||
]; | ||
} else { | ||
plugins = []; | ||
} | ||
|
||
plugins.push(postcssColorFunctionalNotation()); | ||
|
||
return postcss({ | ||
use: { sass: {} }, | ||
plugins, | ||
extract: 'bundle.css', | ||
}); | ||
} | ||
|
||
export function baseCompile(instrumentName, instrumentFolder) { | ||
return [ | ||
image(), | ||
nodeResolve({ extensions, browser: true }), | ||
json(), | ||
commonjs({ include: /node_modules/ }), | ||
babel(), | ||
typescriptPaths({ | ||
tsConfigPath: join(Directories.src, 'tsconfig.json'), | ||
preserveExtensions: true, | ||
}), | ||
replace({ | ||
'DEBUG': 'false', | ||
'preventAssignment': true, | ||
'process.env.VITE_BUILD': 'false', | ||
'process.env.NODE_ENV': JSON.stringify('production'), | ||
'process.env.CLIENT_ID': JSON.stringify(process.env.CLIENT_ID), | ||
'process.env.CLIENT_SECRET': JSON.stringify(process.env.CLIENT_SECRET), | ||
'process.env.CHARTFOX_SECRET': JSON.stringify(process.env.CHARTFOX_SECRET), | ||
'process.env.SENTRY_DSN': JSON.stringify(process.env.SENTRY_DSN), | ||
}), | ||
postCss(instrumentName, instrumentFolder), | ||
]; | ||
} |
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,85 @@ | ||
// Copyright (c) 2022 FlyByWire Simulations | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
import fs from 'fs'; | ||
import { join } from 'path'; | ||
import image from '@rollup/plugin-image'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import { babel as babelPlugin } from '@rollup/plugin-babel'; | ||
import { typescriptPaths } from 'rollup-plugin-typescript-paths'; | ||
import replace from '@rollup/plugin-replace'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import tailwindcss from 'tailwindcss'; | ||
import dotenv from 'dotenv'; | ||
import json from '@rollup/plugin-json'; | ||
import postcssColorFunctionalNotation from 'postcss-color-functional-notation'; | ||
import { Directories } from './directories.mjs'; | ||
|
||
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs']; | ||
|
||
dotenv.config(); | ||
|
||
function babel() { | ||
return babelPlugin({ | ||
presets: [ | ||
['@babel/preset-env', { targets: { safari: '11' } }], | ||
['@babel/preset-react', { runtime: 'automatic', throwIfNamespace: false }], | ||
['@babel/preset-typescript'], | ||
], | ||
plugins: [ | ||
'@babel/plugin-proposal-class-properties', | ||
['@babel/plugin-transform-runtime', { regenerator: true }], | ||
], | ||
babelHelpers: 'runtime', | ||
compact: false, | ||
extensions, | ||
}); | ||
} | ||
|
||
function postCss(_, instrumentFolder) { | ||
let plugins; | ||
|
||
const tailwindConfigPath = join(Directories.instruments, 'src', instrumentFolder, 'tailwind.config.js'); | ||
|
||
if (fs.existsSync(tailwindConfigPath)) { | ||
plugins = [ | ||
tailwindcss(tailwindConfigPath), | ||
]; | ||
} else { | ||
plugins = []; | ||
} | ||
|
||
plugins.push(postcssColorFunctionalNotation()); | ||
|
||
return postcss({ | ||
use: { sass: {} }, | ||
plugins, | ||
extract: 'bundle.css', | ||
}); | ||
} | ||
|
||
export function baseCompile(instrumentName, instrumentFolder) { | ||
return [ | ||
image(), | ||
nodeResolve({ extensions, browser: true }), | ||
json(), | ||
commonjs({ include: /node_modules/ }), | ||
babel(), | ||
typescriptPaths({ | ||
tsConfigPath: join(Directories.src, 'tsconfig.json'), | ||
preserveExtensions: true, | ||
}), | ||
replace({ | ||
'DEBUG': 'false', | ||
'preventAssignment': true, | ||
'process.env.VITE_BUILD': 'false', | ||
'process.env.NODE_ENV': JSON.stringify('production'), | ||
'process.env.CLIENT_ID': JSON.stringify(process.env.CLIENT_ID), | ||
'process.env.CLIENT_SECRET': JSON.stringify(process.env.CLIENT_SECRET), | ||
'process.env.CHARTFOX_SECRET': JSON.stringify(process.env.CHARTFOX_SECRET), | ||
'process.env.SENTRY_DSN': JSON.stringify(process.env.SENTRY_DSN), | ||
}), | ||
postCss(instrumentName, instrumentFolder), | ||
]; | ||
} |
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,85 @@ | ||
// Copyright (c) 2022 FlyByWire Simulations | ||
// SPDX-License-Identifier: GPL-3.0 | ||
|
||
import fs from 'fs'; | ||
import { join } from 'path'; | ||
import image from '@rollup/plugin-image'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import { babel as babelPlugin } from '@rollup/plugin-babel'; | ||
import { typescriptPaths } from 'rollup-plugin-typescript-paths'; | ||
import replace from '@rollup/plugin-replace'; | ||
import postcss from 'rollup-plugin-postcss'; | ||
import tailwindcss from 'tailwindcss'; | ||
import dotenv from 'dotenv'; | ||
import json from '@rollup/plugin-json'; | ||
import postcssColorFunctionalNotation from 'postcss-color-functional-notation'; | ||
import { Directories } from './directories.mjs'; | ||
|
||
const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs']; | ||
|
||
dotenv.config(); | ||
|
||
function babel() { | ||
return babelPlugin({ | ||
presets: [ | ||
['@babel/preset-env', { targets: { safari: '11' } }], | ||
['@babel/preset-react', { runtime: 'automatic', throwIfNamespace: false }], | ||
['@babel/preset-typescript'], | ||
], | ||
plugins: [ | ||
'@babel/plugin-proposal-class-properties', | ||
['@babel/plugin-transform-runtime', { regenerator: true }], | ||
], | ||
babelHelpers: 'runtime', | ||
compact: false, | ||
extensions, | ||
}); | ||
} | ||
|
||
function postCss(_, instrumentFolder) { | ||
let plugins; | ||
|
||
const tailwindConfigPath = join(Directories.instruments, 'src', instrumentFolder, 'tailwind.config.js'); | ||
|
||
if (fs.existsSync(tailwindConfigPath)) { | ||
plugins = [ | ||
tailwindcss(tailwindConfigPath), | ||
]; | ||
} else { | ||
plugins = []; | ||
} | ||
|
||
plugins.push(postcssColorFunctionalNotation()); | ||
|
||
return postcss({ | ||
use: { sass: {} }, | ||
plugins, | ||
extract: 'bundle.css', | ||
}); | ||
} | ||
|
||
export function baseCompile(instrumentName, instrumentFolder) { | ||
return [ | ||
image(), | ||
nodeResolve({ extensions, browser: true }), | ||
json(), | ||
commonjs({ include: /node_modules/ }), | ||
babel(), | ||
typescriptPaths({ | ||
tsConfigPath: join(Directories.src, 'tsconfig.json'), | ||
preserveExtensions: true, | ||
}), | ||
replace({ | ||
'DEBUG': 'false', | ||
'preventAssignment': true, | ||
'process.env.VITE_BUILD': 'false', | ||
'process.env.NODE_ENV': JSON.stringify('production'), | ||
'process.env.CLIENT_ID': JSON.stringify(process.env.CLIENT_ID), | ||
'process.env.CLIENT_SECRET': JSON.stringify(process.env.CLIENT_SECRET), | ||
'process.env.CHARTFOX_SECRET': JSON.stringify(process.env.CHARTFOX_SECRET), | ||
'process.env.SENTRY_DSN': JSON.stringify(process.env.SENTRY_DSN), | ||
}), | ||
postCss(instrumentName, instrumentFolder), | ||
]; | ||
} |
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