Skip to content

Commit

Permalink
Feature/project files (#3)
Browse files Browse the repository at this point in the history
* feat(devcontainer): added .devcontainer

* feat(issueTemplates): added the issues templates for feature,bug and question

* feat(workflows): added 2 workflows, one for release and one for stale issues

* feat(husky): added husky commit-msg for commitlint and pre-commit for prettier

* feat(vscode): added settings.json for prettier

* feat(deps): added commitlint, prettier, husky, lint-staged

* feat(various): various config files, like prettier, gitignore, cliff.toml and commitlint

* fix(release): removed dev and added main as a branch on release workflow
  • Loading branch information
dragolea authored Oct 23, 2024
1 parent 5d5743a commit d1c54cc
Show file tree
Hide file tree
Showing 17 changed files with 3,473 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .commitlintrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { UserConfig } from '@commitlint/types';
import { RuleConfigSeverity } from '@commitlint/types';

const Configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
RuleConfigSeverity.Error,
'always',
['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', 'delete'],
],
'scope-empty': [RuleConfigSeverity.Error, 'never'],
'subject-empty': [RuleConfigSeverity.Error, 'never'],
},
helpUrl: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint',
};

export default Configuration;
91 changes: 91 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"name": "CDS-TS-Dispatcher TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:20-bullseye",
"features": {
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}
},
"runArgs": ["--name", "gh-action-release"],
"forwardPorts": [4004],
"postCreateCommand": "bash scripts/install-dependencies.sh",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
// Jest
"Orta.vscode-jest",
"firsttris.vscode-jest-runner",

// Rest
"humao.rest-client",

// VSCode
"aaron-bond.better-comments",
"alefragnani.Bookmarks",
"alefragnani.project-manager",

// NPM
"christian-kohler.npm-intellisense",
"mskelton.npm-outdated",

// Theme
"PKief.material-icon-theme",
"zhuangtongfa.material-theme",

// SAP CAP
"SAPSE.vscode-cds",
"SAPOSS.app-studio-toolkit",
"SAPOSS.app-studio-remote-access",
"SAPOS.yeoman-ui",

// Docker
"ms-vscode-remote.remote-containers",
"ms-azuretools.vscode-docker",

// .env
"mikestead.dotenv", //DotENV

// UI5
"SAPSE.sap-ux-fiori-tools-extension-pack",

// SQLite
"qwtel.sqlite-viewer",

// CSV
"janisdd.vscode-edit-csv",
"mechatroner.rainbow-csv",

// TypeScript
"usernamehw.errorlens",
"dbaeumer.vscode-eslint",
"oderwat.indent-rainbow",
"esbenp.prettier-vscode",
"YoavBls.pretty-ts-errors",
"streetsidesoftware.code-spell-checker",
"wayou.vscode-todo-highlight",
"mike-co.import-sorter",

// XML & YAML
"redhat.vscode-yaml",
"DotJoshJohnson.xml",
"SAPOSS.xml-toolkit",

// Git
"waderyan.gitblame",
"donjayamanne.githistory",
"GitHub.vscode-pull-request-github",

// README
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint",
"bierner.jsdoc-markdown-highlighting",

// Others
"VisualStudioExptTeam.vscodeintellicode",
"christian-kohler.path-intellisense",
"donjayamanne.python-extension-pack",
"AykutSarac.jsoncrack-vscode"
]
}
},
"remoteUser": "node"
}
8 changes: 8 additions & 0 deletions .devcontainer/scripts/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

# Install SAP dependencies

npm install -g @sap/cds-dk typescript ts-node

# Install package.json dependencies
npm install
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 🐞 Bug
description: File a bug/issue
title: '[BUG] <title>'
labels: ['type: bug']
body:
- type: textarea
attributes:
label: Current behavior
description: A description of what you're experiencing.
validations:
required: true

- type: textarea
attributes:
label: Expected behavior
description: A description of what you expected to happen.
validations:
required: true

- type: textarea
attributes:
label: Steps to reproduce
description: |
Example steps to reproduce the behavior :
1. In this environment...
2. With this config...
3. With this sample model...
4. Run '...'/ Do...
5. See error...
validations:
required: true
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 💡 Feature Request
description: Request a missing feature
title: '[FEATURE] <title>'
labels: ['type: feature request']
body:
- type: textarea
attributes:
label: Description
description: |
A description of the feature you're interested in.
If possible include use cases, links, and how it would benefit this tool and its users.
validations:
required: true

- type: textarea
attributes:
label: Suggested solution
description: |
Describe your proposed solution.
A description of what your feature request is all about.
validations:
required: true
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: ❓ Question
description: Ask a question
title: '[QUESTION] <title>'
labels: ['type: discussion']
body:
- type: textarea
attributes:
label: Question
description: What would you like to know? If you encounter unusual behavior or identified a missing feature, consider opening a bug report instead.
validations:
required: true
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Reelease
on:
pull_request:
branches:
- main
types:
- closed

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest

steps:
- name: Create release
uses: dxfrontier/gh-action-release@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: main
29 changes: 29 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.

name: Mark stale issues and pull requests

on:
schedule:
- cron: '36 18 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 30
stale-issue-message: 'This issue has not been updated in a while. If it is still relevant, please comment on it to keep it open. The issue will be closed soon if it remains inactive.'
close-issue-message: 'This issue has been closed automatically due to inactivity.'
stale-pr-message: 'This PR has not been updated in a while. If it is still relevant, please comment on it to keep it open. The PR will be closed soon if it remains inactive.'
close-pr-message: 'This PR has been closed automatically due to inactivity.'
stale-issue-label: 'status: stale'
stale-pr-label: 'status: stale'
exempt-issue-labels: 'type: feature request'
exempt-pr-labels: 'type: feature request'
exempt-all-milestones: true
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
.DS_Store

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.npmrc
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit "$1"
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ignore artifacts
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2
}
Loading

0 comments on commit d1c54cc

Please sign in to comment.