Skip to content

Commit

Permalink
feat: add starter
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Mar 24, 2022
1 parent db2a1f1 commit 588a2a5
Show file tree
Hide file tree
Showing 170 changed files with 78,637 additions and 140 deletions.
5 changes: 5 additions & 0 deletions apps/starter/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.DS_Store
dist
storybook-static
.firebase
1 change: 1 addition & 0 deletions apps/starter/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=https://api-starter.warsono.id/
2 changes: 2 additions & 0 deletions apps/starter/.env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NODE_ENV=production
VITE_API_BASE_URL=https://api-starter.warsono.id/
Empty file added apps/starter/.eslintignore
Empty file.
30 changes: 30 additions & 0 deletions apps/starter/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
// "eslint:recommended",
"plugin:vue/vue3-recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint"
],
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "babel-eslint",
"ecmaVersion": 2021
},
"plugins": [],
"rules": {
"vue/valid-v-slot": ["error", {"allowModifiers": true}],
"vue/component-tags-order": [
"error",
{
"order": ["script", "template", "style"]
}
]
}
}
14 changes: 14 additions & 0 deletions apps/starter/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"projects": {
"default": "gits-starter"
},
"targets": {
"gits-starter": {
"hosting": {
"starter": [
"gits-starter"
]
}
}
}
}
9 changes: 9 additions & 0 deletions apps/starter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
.DS_Store
dist
dist-ssr
*.local
storybook-static
hosting.*
.env
yarn-error.log
82 changes: 82 additions & 0 deletions apps/starter/.gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
stages:
- analyze
- build
- deploy

image: node:14.17.5-alpine

cache:
paths:
- node_modules/

# build-staging:
# stage: build
# rules:
# - if: $CI_COMMIT_BRANCH == "staging"
# script:
# # Install dependencies
# - npm install
# # Build App
# - npm run build
# artifacts:
# paths:
# # Build folder
# - dist
# expire_in: 1 hour

# deploy-staging:
# stage: deploy
# script:
# - npm install -g firebase-tools
# - firebase use --token $FIREBASE_TOKEN staging
# - firebase deploy --only hosting -m "Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --non-interactive --token $FIREBASE_TOKEN
# rules:
# - if: $CI_COMMIT_BRANCH == "staging"

analyze:sonar:
stage: analyze
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
GIT_DEPTH: 0
image:
name: sonarsource/sonar-scanner-cli:4.5
entrypoint: [""]
cache:
key: "${CI_JOB_NAME}"
paths:
- .sonar/cache
script:
- sonar-scanner -Dsonar.projectKey=$CI_PROJECT_NAME -Dsonar.sources=. -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_USER -Dsonar.password=$SONAR_PASSWORD
allow_failure: false
only:
- main
tags:
- nginx-proxy-sonar

build-production:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == "main"
script:
# Install dependencies
- npm install
# Build App
- npm run build
artifacts:
paths:
# Build folder
- dist
expire_in: 1 hour
tags:
- nginx-proxy-sonar

deploy-production:
stage: deploy
script:
- npm install -g firebase-tools
- firebase use gits-starter --token $FIREBASE_TOKEN
- firebase deploy --only hosting:starter -m "Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --non-interactive --token $FIREBASE_TOKEN
rules:
- if: $CI_COMMIT_BRANCH == "main"
tags:
- nginx-proxy-sonar
25 changes: 25 additions & 0 deletions apps/starter/.gitlab/merge_request_templates/General.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

## Screenshot

For UI changes, please provide screenshots on mobile and desktop versions if relevant.
4 changes: 4 additions & 0 deletions apps/starter/.husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
6 changes: 6 additions & 0 deletions apps/starter/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
.gitlab
.vscode
components.d.ts
packages
dist
7 changes: 7 additions & 0 deletions apps/starter/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"bracketSpacing": false,
"trailingComma": "all"
}
41 changes: 41 additions & 0 deletions apps/starter/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const Pages = require('vite-plugin-pages').default;
const Layouts = require('vite-plugin-vue-layouts').default;
// const Vue = require('@vitejs/plugin-vue').default;

module.exports = {
stories: [
'../src/**/*.stories.mdx',
'../src/**/*.stories.@(js|jsx|ts|tsx)',
// dev only
// '../packages/ui/src/**/*.stories.mdx',
// '../packages/ui/src/**/*.stories.@(js|jsx|ts|tsx)',
// prod
'../node_modules/@frontend/ui/src/**/*.stories.mdx',
'../node_modules/@frontend/ui/src/**/*.stories.@(js|jsx|ts|tsx)',
],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
// '@storybook/addon-postcss/register',
],
core: {
builder: 'storybook-builder-vite',
},
async viteFinal(config, {configType}) {
// customize the Vite config here
// config.resolve.alias.foo = 'bar';

config.plugins = [
...config.plugins,
// Vue(),
Pages({
exclude: ['**/parts/*.vue'],
nuxtStyle: true,
}),
Layouts(),
];

// return the customized config
return config;
},
};
24 changes: 24 additions & 0 deletions apps/starter/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import '../src/index.css';
import {app} from '@storybook/vue3';
// import CorePlugins from '../src/core';
import {createMemoryHistory, createRouter} from 'vue-router';
import VueFeather from 'vue-feather';

const router = createRouter({
history: createMemoryHistory(),
routes: [],
});

// app.use(CorePlugins);
app.use(router);
app.component(VueFeather.name, VueFeather);

export const parameters = {
actions: {argTypesRegex: '^on[A-Z].*'},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
3 changes: 3 additions & 0 deletions apps/starter/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
Loading

0 comments on commit 588a2a5

Please sign in to comment.