Skip to content

Commit

Permalink
feat: add initial angular project
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanosdev committed Jan 5, 2024
1 parent 04717bf commit c2d9c20
Show file tree
Hide file tree
Showing 38 changed files with 4,681 additions and 904 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ module.exports = {
'@typescript-eslint/comma-dangle': ['error', 'always-multiline'],
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/quotes': 'off',
'@typescript-eslint/member-delimiter-style': 'off',
'import/first': 'off',
},
},
],
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ jobs:

- name: Build
run: dfx build

- name: Run frontend tests
run: pnpm -F frontend test:ci
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
shamefully-hoist=true
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@

### Marketing

| Command | Description |
| -------------------------------- | ------------------------------ |
| `dfx deploy marketing` | Deploy to a local DFX replica |
| `pnpm run -F marketing... start` | Run a local development server |
| Command | Description |
| ---------------------------- | ------------------------------ |
| `dfx deploy marketing` | Deploy to a local DFX replica |
| `pnpm -F marketing... start` | Run a local development server |

### Docs
### Frontend

| Command | Description |
| --------------------------- | ------------------------------ |
| `dfx deploy docs` | Deploy to a local DFX replica |
| `pnpm run -F docs... start` | Run a local development server |
| `dfx deploy frontend` | Deploy to a local DFX replica |
| `pnpm -F frontend... start` | Run a local development server |

### Docs

| Command | Description |
| ----------------------- | ------------------------------ |
| `dfx deploy docs` | Deploy to a local DFX replica |
| `pnpm -F docs... start` | Run a local development server |
110 changes: 110 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "src",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"style": "scss",
"changeDetection": "OnPush",
"standalone": true
}
},
"cli": {
"analytics": false,
"cache": {
"enabled": false
},
"packageManager": "pnpm"
},
"projects": {
"frontend": {
"projectType": "application",
"root": "src/frontend",
"sourceRoot": "src/frontend/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@hadronous/ic-build-angular:application",
"options": {
"outputPath": "src/frontend/dist",
"index": "src/frontend/src/index.html",
"browser": "src/frontend/src/main.ts",
"tsConfig": "src/frontend/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/frontend/src/favicon.ico",
"src/frontend/src/.ic-assets.json",
"src/frontend/src/assets"
],
"styles": ["src/frontend/src/app.scss"],
"polyfills": ["zone.js"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true,
"fileReplacements": [
{
"replace": "src/frontend/src/environments/environment.ts",
"with": "src/frontend/src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@hadronous/ic-build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "frontend:build:production"
},
"development": {
"buildTarget": "frontend:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"buildTarget": "frontend:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": "src/frontend/tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/frontend/src/favicon.ico",
"src/frontend/src/assets"
],
"styles": ["src/frontend/src/app.scss"],
"polyfills": ["zone.js", "zone.js/testing"],
"scripts": []
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"frontend": {
"dependencies": ["backend"],
"frontend": {
"entrypoint": "src/frontend/src/index.html"
"entrypoint": "src/frontend/dist/browser/index.html"
},
"source": ["src/frontend/dist"],
"source": ["src/frontend/dist/browser"],
"type": "assets",
"build": ["pnpm -F frontend... build"]
},
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@
},
"dependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react-dom": "^18.0.0",
"@dfinity/agent": "^0.20.2",
"@dfinity/auth-client": "^0.20.2",
"@dfinity/candid": "^0.20.2",
"@dfinity/principal": "^0.20.2",
"zone.js": "~0.14.2"
},
"devDependencies": {
"@angular/cli": "^17.0.8",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/node": "^20.0.0",
Expand All @@ -29,6 +35,8 @@
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.33.2",
"typescript": "~5.2.2",
"prettier": "^3.1.1"
"tslib": "^2.6.2",
"prettier": "^3.1.1",
"dotenv": "^16.3.1"
}
}
Loading

0 comments on commit c2d9c20

Please sign in to comment.