Skip to content

Commit

Permalink
Merge pull request #34 from rob-at-airwalk/main
Browse files Browse the repository at this point in the history
feat: cleanup and re baseline
  • Loading branch information
rob-at-airwalk authored Apr 12, 2024
2 parents 2b33da4 + 719a7c1 commit 24efeb8
Show file tree
Hide file tree
Showing 551 changed files with 35,136 additions and 342,104 deletions.
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

34 changes: 0 additions & 34 deletions .devcontainer.json

This file was deleted.

26 changes: 13 additions & 13 deletions Dockerfile.vscode → .devcontainer/Dockerfile.vscode
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.18-alpine
FROM node:lts-alpine
ARG DEBIAN_FRONTEND=noninteractive
ARG USERNAME=vscode
ARG USER_UID=1000
Expand All @@ -18,26 +18,26 @@ RUN apk add doas git github-cli; \
RUN git config --global url."[email protected]:".insteadOf "https://github.com/"
RUN git config --global url."[email protected]:".insteadOf "https://ssh.dev.azure.com/"

## fix npm file issues
RUN mkdir /tmp/npm \
&& mkdir /tmp/npm-cache \
&& npm config set prefix /tmp/npm \
&& npm config set cache /tmp/npm-cache \
&& chown -R $USERNAME /tmp/npm \
&& mkdir /workspaces && chown -R $USERNAME /workspaces
# ## fix npm file issues
# RUN mkdir /tmp/npm \
# && mkdir /tmp/npm-cache \
# && npm config set prefix /tmp/npm \
# && npm config set cache /tmp/npm-cache \
# && chown -R $USERNAME /tmp/npm \
# && mkdir /workspaces && chown -R $USERNAME /workspaces
## fix M1 pupetteer issues
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium

# [Optional] Set the default user. Omit if you want to keep the default as root.
USER $USERNAME

COPY . /tmp/npm
# COPY . /tmp/npm

RUN doas chown -R $USERNAME /tmp/npm
RUN npm config set prefix /tmp/npm
RUN yarn config set prefix /tmp/npm
RUN cd /tmp/npm && npm i
# RUN doas chown -R $USERNAME /tmp/npm
# RUN npm config set prefix /tmp/npm
# RUN yarn config set prefix /tmp/npm
# RUN npm i
# RUN git clone https://github.com/AirWalk-Digital/airview-mdx.git /tmp/airview-mdx && cd /tmp/airview-mdx && npm i && npm link


44 changes: 44 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details or
// https://aka.ms/vscode-dev-containers/definitions for sample configurations.
{
"name": "Airview Next",
"dockerFile": "Dockerfile.vscode",
"remoteUser": "vscode",
//"mounts": [
// "source=/Users/robe/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached"
//],
"forwardPorts": [3000, 6006],
"portsAttributes": {
"3000": {
"label": "Next JS",
"onAutoForward": "silent"
},
"6006": {
"label": "Storybook",
"onAutoForward": "silent"
}
},
// "postCreateCommand": "",
"postCreateCommand": {
// "fix npm" : "rm -Rf /workspaces/airview-next/node_modules && ln -s /tmp/npm/node_modules /workspaces/airview-next/node_modules"
"install modules": "cd ${containerWorkspaceFolder} && npm i"
},
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"mikestead.dotenv",
"csstools.postcss",
"bradlc.vscode-tailwindcss",
"Orta.vscode-jest",
"humao.rest-client",
"yoavbls.pretty-ts-errors",
"ms-playwright.playwright",
"github.vscode-github-actions",
"lokalise.i18n-ally",
"GitHub.copilot",
"esbenp.prettier-vscode"
]
}
}
}
49 changes: 49 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# Etherpad
ETHERPAD_API_KEY=
ETHERPAD_BASE_URL=
ETHERPAD_URL=

# FontAwesome
FONTAWESOME_NPM_AUTH_TOKEN=

# Github
GITHUB_REPO_NAME=
GITHUB_ORG_NAME=
GITHUB_INSTALLATION_ID=
GITHUB_APP_ID=
GITHUB_PRIVATE_KEY_FILE=

# Redis
REDIS_HOST=172.17.0.1
REDIS_PASSWORD=
REDIS_PORT=
INDEX_NAME=

# SharePoint
SHAREPOINT_CLIENT_ID=
SHAREPOINT_TENANT=
SHAREPOINT_PRIVATE_KEY_FILE=
SHAREPOINT_PRIVATE_KEY_THUMBPRINT=
SHAREPOINT_BASE=

# Timesheet Portal
TSP_CLIENT_ID=
TSP_CLIENT_SECRET=

# Microsoft Graph
AZURE_APP_CLIENT_ID=
AZURE_APP_CLIENT_SECRET=
AZURE_TENANT_ID=

# OpenAI
OPENAI_API_KEY=
MODEL_TEMPERATURE=0.8

# Sentry.io
# SENTRY_AUTH_TOKEN=

# Langchain
SIMILARITY_THRESHOLD=0.8
# LANGCHAIN_API_KEY=
# LANGCHAIN_PROJECT=
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
out
docs
.storybook
.archive
.next
storybook-static
119 changes: 119 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
// Configuration for JavaScript files
"extends": [
"airbnb-base",
"next/core-web-vitals", // Needed to avoid warning in next.js build: 'The Next.js plugin was not detected in your ESLint configuration'
"plugin:prettier/recommended"
],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"endOfLine": "auto"
}
], // Avoid conflict rule between Prettier and Airbnb Eslint
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
]
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"overrides": [
// Configuration for TypeScript files
{
"files": ["**/*.ts", "**/*.tsx"],
"plugins": [
"@typescript-eslint",
"unused-imports",
"tailwindcss",
"simple-import-sort"
],
"extends": [
"plugin:tailwindcss/recommended",
"airbnb",
"airbnb-typescript",
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"endOfLine": "auto"
}
], // Avoid conflict rule between Prettier and Airbnb Eslint
"import/extensions": "off", // Avoid missing file extension errors, TypeScript already provides a similar feature
"react/function-component-definition": "off", // Disable Airbnb's specific function type
"react/destructuring-assignment": "off", // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
"react/require-default-props": "off", // Allow non-defined react props as undefined
"react/jsx-props-no-spreading": "off", // _app.tsx uses spread operator and also, react-hook-form
"@typescript-eslint/comma-dangle": "off", // Avoid conflict rule between Eslint and Prettier
"@typescript-eslint/consistent-type-imports": "error", // Ensure `import type` is used when it's necessary
"no-restricted-syntax": [
"error",
"ForInStatement",
"LabeledStatement",
"WithStatement"
], // Overrides Airbnb configuration and enable no-restricted-syntax
"import/prefer-default-export": "off", // Named export is easier to refactor automatically
"simple-import-sort/imports": "error", // Import configuration for `eslint-plugin-simple-import-sort`
"simple-import-sort/exports": "error", // Export configuration for `eslint-plugin-simple-import-sort`
"import/order": "off", // Avoid conflict rule between `eslint-plugin-import` and `eslint-plugin-simple-import-sort`
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
]
}
},
// Configuration for testing
{
"files": ["**/*.test.ts", "**/*.test.tsx"],
"plugins": ["jest", "jest-formatting", "testing-library", "jest-dom"],
"extends": [
"plugin:jest/recommended",
"plugin:jest-formatting/recommended",
"plugin:testing-library/react",
"plugin:jest-dom/recommended"
]
},
// Configuration for e2e testing (Playwright)
{
"files": ["**/*.spec.ts"],
"extends": ["plugin:playwright/recommended"]
},
// Configuration for Storybook
{
"files": ["*.stories.*"],
"extends": ["plugin:storybook/recommended"],
"rules": {
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
]
}
}
]
}
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

2 changes: 1 addition & 1 deletion .github/workflows/auto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 18.x
node-version: 20.x

- name: Install semantic-release extra plugins
run: mv package.json package.json.bak && npm install --no-save @semantic-release/changelog @semantic-release-plus/docker && mv package.json.bak package.json
Expand Down
Loading

0 comments on commit 24efeb8

Please sign in to comment.