Skip to content

Commit

Permalink
Merge pull request #7 from miku0129/development
Browse files Browse the repository at this point in the history
Add authentication and test.
  • Loading branch information
miku0129 authored Aug 7, 2024
2 parents fe0f29a + 0d5db1a commit 729df29
Show file tree
Hide file tree
Showing 39 changed files with 9,279 additions and 9,554 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_HANKO_API_URL_LOCAL=
59 changes: 0 additions & 59 deletions .github/workflows/githubpages-hosting-PR.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ dist-ssr
*.sln
*.sw?

sample-student-data.ts
sample-student-data.ts
.env
coverage
16 changes: 16 additions & 0 deletions @types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
interface FormContent {
id:number;
name: string;
email: string;
fromWhen?: string;
myGoal?: string;
myMethod?: string;
}

interface showForm {
bool: boolean
}

interface isEditVal {
bool: boolean
}
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

* [TypeScript](https://www.typescriptlang.org/), [Vue3](https://vuejs.org/), [Vite](https://vitejs.dev/) for development.
* Using Github to manage code (versioning, issues, pull request...)
* Use OVH web-hosting for production.
* Applied [Hanko](https://www.hanko.io/) for authentication.
* Use [OVH](https://www.ovhcloud.com/fr/) web-hosting for production.
* Use FileZilla for production deployment.
* Implemented unit test with [jest](https://jestjs.io/) and [Vue Test Utils](https://test-utils.vuejs.org/)

<img src=https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExd2JoNDNyYmVmaHlpMGFscTh2cWtpM25uZnIybGhnNjdmdTRwbTc1cCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/rkaKsUP1LHq9ndg1w9/giphy.gif>

# Future feature

* Allow user to create an account
* Add user authentication
* Allow user to edit it's profile
* ~~Implements CI/CD with Github Actions~~
* ~~Add tests for UI~~
28 changes: 19 additions & 9 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
// Only used by Jest
module.exports = {
env: {
test: {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
],
},
presets: [
[
'@babel/preset-env',
{ useBuiltIns: 'entry', corejs: '2', targets: { node: 'current' } },
],
'@babel/preset-typescript',
],
plugins: [
function () {
return {
visitor: {
MetaProperty(path) {
path.replaceWithSourceString('process')
},
},
}
},
};
],
}
7 changes: 6 additions & 1 deletion components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
AuthDashboard: typeof import('./src/components/AuthDashboard.vue')['default']
AuthLogin: typeof import('./src/components/AuthLogin.vue')['default']
AuthLogoutBtn: typeof import('./src/components/AuthLogoutBtn.vue')['default']
AuthProfile: typeof import('./src/components/AuthProfile.vue')['default']
BButton: typeof import('bootstrap-vue-next')['BButton']
BCollapse: typeof import('bootstrap-vue-next')['BCollapse']
BForm: typeof import('bootstrap-vue-next')['BForm']
Expand All @@ -23,8 +27,9 @@ declare module 'vue' {
EtudiantCreate: typeof import('./src/components/EtudiantCreate.vue')['default']
EtudiantEdit: typeof import('./src/components/EtudiantEdit.vue')['default']
EtudiantPreview: typeof import('./src/components/EtudiantPreview.vue')['default']
EtudintRemove: typeof import('./src/components/EtudintRemove.vue')['default']
Footer: typeof import('./src/components/Footer.vue')['default']
Gallery: typeof import('./src/components/Gallery.vue')['default']
Form: typeof import('./src/components/Form.vue')['default']
Header: typeof import('./src/components/Header.vue')['default']
Home: typeof import('./src/components/Home.vue')['default']
RouteHome: typeof import('./src/components/RouteHome.vue')['default']
Expand Down
35 changes: 18 additions & 17 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
module.exports = {
moduleFileExtensions: ["vue", "js", "ts", "tsx" ],
moduleNameMapper: {
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/__mocks__/fileMock.js",
},
preset: "ts-jest",
testEnvironment: "jest-environment-jsdom",
testEnvironmentOptions: {
customExportConditions: ["node", "node-addons"],
},
transform: {
"^.+\\.(t|j)s?$": "babel-jest",
"^.+\\.vue$": "@vue/vue3-jest",
},
setupFilesAfterEnv: ['./tests/router-mock-setup.js'],
};

moduleFileExtensions: ["vue", "js", "ts", "tsx"],
moduleNameMapper: {
"\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/__mocks__/fileMock.js",
},
preset: "ts-jest",
testEnvironment: "jest-environment-jsdom",
testEnvironmentOptions: {
customExportConditions: ["node", "node-addons"],
},
transform: {
"^.+\\.(t|j)s?$": "babel-jest",
"^.+\\.vue$": "@vue/vue3-jest",
},
setupFilesAfterEnv: ["./tests/router-mock-setup.js"],
transformIgnorePatterns: ["<rootDir>/node_modules/(?!@teamhanko)"],
collectCoverageFrom: ["**/*.{ts,vue}", "!**/node_modules/**"],
};
Loading

0 comments on commit 729df29

Please sign in to comment.