Skip to content

Commit

Permalink
Merge branch 'live' into refact/mv-lifecycle-indicat8rs-home
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekNonGeneric committed Apr 4, 2024
2 parents 256e845 + f0dbc37 commit 7a478a4
Show file tree
Hide file tree
Showing 89 changed files with 11,632 additions and 3,150 deletions.
1 change: 1 addition & 0 deletions .config/.rvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.0
5 changes: 1 addition & 4 deletions babel.config.json → .config/babel.config.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"plugins": [
"@babel/plugin-syntax-top-level-await",
"@babel/plugin-syntax-jsx"
],
"plugins": ["@babel/plugin-syntax-jsx"],
"presets": [
[
"@babel/preset-env",
Expand Down
154 changes: 154 additions & 0 deletions .config/babel.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/**
* @file Dynamic Babel configuration.
*
* Notes:
* 1. Plugins run before presets.
* 2. Plugin ordering is first to last.
* 3. Preset ordering is reversed (last to first).
*
* @author The OpenINF Authors & Friends
* @module {ES6Module} /.config/babel
* @license MIT OR Apache-2.0 OR BlueOak-1.0.0
* @see https://babeljs.io/docs/en/plugins#plugin-ordering
*/

// -----------------------------------------------------------------------------
// Requirements
// -----------------------------------------------------------------------------

import { packageConfig } from 'shared/constants';

// -----------------------------------------------------------------------------
// Presets
// -----------------------------------------------------------------------------

const nodeDevelopmentPresets = [
[
// https://babeljs.io/docs/en/babel-preset-env
'@babel/preset-env',
{
// Module transformations are unnecessary as Node is in ES module context.
// Additionally, CommonJS cannot be treeshaken.
modules: false,
targets: {
esmodules: false,
node: true,
},
useBuiltIns: 'entry',
corejs: packageConfig.dependencies['core-js'],
},
],
];

const nodeProductionPresets = [
[
// https://babeljs.io/docs/en/babel-preset-env
'@babel/preset-env',
{
// Module transformations are necessary as Node is in CommonJS context.
// modules: false,
// modules: '',
targets: {
esmodules: true,
node: 'current',
},
loose: true,
include: ['@babel/plugin-transform-classes'],
// 'exclude': ['transform-es2015-typeof-symbol'],
useBuiltIns: 'usage',
corejs: {
version: packageConfig.dependencies['core-js'],
proposals: true,
},
},
],
];

// -----------------------------------------------------------------------------
// Plugins
// -----------------------------------------------------------------------------

const commonNodePlugins = [
// https://babeljs.io/docs/en/babel-plugin-proposal-class-properties
// [
// '@babel/plugin-proposal-class-properties',
// {
// 'loose': true,
// },
// ],
// https://babeljs.io/docs/en/babel-plugin-syntax-import-meta
'@babel/plugin-syntax-import-meta',
// https://babeljs.io/docs/en/babel-plugin-syntax-dynamic-import
'@babel/plugin-syntax-dynamic-import',
// '@babel/plugin-proposal-object-rest-spread',
'babel-plugin-dynamic-import-node-sync',
// '@babel/plugin-transform-classes',
// https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs
[
'@babel/plugin-transform-modules-commonjs',
{
allowTopLevelThis: false,
},
],
];

const nodeDevelopmentPlugins = [
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
[
'@babel/plugin-transform-runtime',
{
corejs: { version: 3, proposals: true },
helpers: true,
regenerator: true,
useESModules: false,
},
],
];

const nodeProductionPlugins = [
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
[
'@babel/plugin-transform-runtime',
{
corejs: { version: 3, proposals: true },
helpers: true,
regenerator: true,
useESModules: true,
},
],
];

// -----------------------------------------------------------------------------
// Export
// -----------------------------------------------------------------------------

const config = (api) => {
// https://babeljs.io/docs/en/config-files#apienv
const envName = api.env();

// eslint-disable-next-line no-console
console.log(`Babel was loaded with the '${envName}' environment.`);

switch (envName) {
case 'development':
return {
presets: nodeDevelopmentPresets,
plugins: commonNodePlugins.concat(nodeDevelopmentPlugins),
ignore: [],
};
case 'production':
return {
presets: nodeProductionPresets,
plugins: commonNodePlugins.concat(nodeProductionPlugins),
ignore: [],
};
default:
return {
presets: nodeDevelopmentPresets,
plugins: commonNodePlugins.concat(nodeDevelopmentPlugins),
ignore: [],
};
}
};

export default config;
30 changes: 30 additions & 0 deletions .config/env-cmd.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

nodeProductionOptions = nodeProductionOptions.join(' ');
nodeDevelopmentOptions = nodeDevelopmentOptions.join(' ');

// -----------------------------------------------------------------------------
// Export
// -----------------------------------------------------------------------------

export default {
'development': {
// Development
// https://github.com/visionmedia/debug#environment-variables
'DEBUG': '*',
// https://www.dynatrace.com/news/blog/the-drastic-effects-of-omitting-node-env-in-your-express-js-applications/
// https://dzone.com/articles/what-you-should-know-about-node-env
'NODE_ENV': 'development',
// https://nodejs.org/api/all.html#cli_node_options_options
'NODE_OPTIONS': nodeDevelopmentOptions,
},
'production': {
// Production
// https://github.com/visionmedia/debug#environment-variables
'DEBUG': false,
// https://nodejs.org/en/docs/guides/simple-profiling/
// https://webpack.js.org/guides/environment-variables/
'NODE_ENV': 'production',
// https://nodejs.org/api/all.html#cli_node_options_options
'NODE_OPTIONS': nodeProductionOptions,
},
};
23 changes: 22 additions & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version = 1

test_patterns = [
"test/**",
"*test.js"
]

[[analyzers]]
name = "ruby"
enabled = true
Expand All @@ -17,8 +22,24 @@ name = "docker"
enabled = true

[analyzers.meta]
dockerfile_paths = [".devcontainer/Dockerfile"]
dockerfile_paths = [".devcontainer/experimental/Dockerfile"]

[[analyzers]]
name = "javascript"
enabled = true

[analyzers.meta]
plugins = []
environment = [
"nodejs",
"browser",
"cypress"
]

[[transformers]]
name = "prettier"
enabled = true

[[transformers]]
name = "rubocop"
enabled = true
18 changes: 10 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
// see documentation located at the following URL:
// https://github.com/OpenINF/docker-fisher
{
"name": "Debianzsz Fisher (OpenINF Community)",
"name": "🦞 OpenINF GrimesAI Salvage Tex: Lunar (OpenINF Community)",
"build": {
"dockerfile": "openinf/debianzsz-fisher:latest"
"dockerfile": "experimental/Dockerfile"
},
"runArgs": [
"--cap-add=SYS_ADMIN",
"--security-opt",
"seccomp=unconfined"
],
"runArgs": [],
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
Expand Down Expand Up @@ -67,8 +63,14 @@
2222
],
"overrideCommand": false,

"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind",
"workspaceFolder": "/workspace",

// Use 'postCreateCommand' to run commands after creating the container.
"postCreateCommand": "fish .devcontainer/post-create.fish",
// https://code.visualstudio.com/docs/devcontainers/create-dev-container#_rebuild
"postCreateCommand": "fish -i '${containerWorkspaceFolder}/tools/devcontainer/post-create.fish'",
"postStartCommand": "fish -i '${containerWorkspaceFolder}/tools/devcontainer/post-start.fish'",
"remoteEnv": {
"PATH": "${containerEnv:PATH}:~/.rbenv/shims/"
},
Expand Down
42 changes: 42 additions & 0 deletions .devcontainer/experimental/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM openinf/grimesai-salvage-tex:lunar@sha256:85db277df2bb6b07922478085cd612a67a9a7d3923b09135a7f6bd9bd65ca89a

ARG USERNAME=vscode
ARG NPM_GLOBAL=/usr/local/share/npm-global

# Add NPM global to PATH.
ENV PATH=${NPM_GLOBAL}/bin:${PATH}

ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG UPGRADE_PACKAGES="true"

USER 0

# COPY library-scripts/*.sh /tmp/library-scripts/
# skipcq: DOK-DL3008
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && /bin/bash /tmp/library-scripts/common-debian.sh "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \
# && /bin/bash /tmp/library-scripts/fish-debian.sh "${USERNAME}" \
# && /bin/bash /tmp/library-scripts/sshd-debian.sh "2222" "${USERNAME}" "true" "root" \
#
# ****************************************************************************
# * TODO: Add any additional OS packages you want included in the definition *
# * here. We want to do this before cleanup to keep the "layer" small. *
# ****************************************************************************
&& apt-get -y install --no-install-recommends build-essential default-jre ruby-dev git-lfs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

USER vscode

# ENV Variables required by Jekyll.
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
TZ=Etc/UTC \
LC_ALL=en_US.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US

ENTRYPOINT ["/usr/local/share/ssh-init.sh"]
CMD ["sleep", "infinity"]

0 comments on commit 7a478a4

Please sign in to comment.