Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: web client #204

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b9f8b78
feat: init web artifact as maven module
SalathielGenese Dec 11, 2022
f0d55be
feat: init yarn package
SalathielGenese Dec 11, 2022
fb57456
feat: init angular application
SalathielGenese Dec 11, 2022
5a6102e
feat: clean up generated content
SalathielGenese Dec 11, 2022
903b7ea
feat: add UI framework
SalathielGenese Dec 11, 2022
611e888
feat: bootstrap Tailwind default configuration
SalathielGenese Dec 11, 2022
6caf637
feat: configure and test Tailwind integration
SalathielGenese Dec 11, 2022
5976814
feat: scaffold popup and test it with configuration popup
SalathielGenese Dec 11, 2022
85134df
feat: render popup content children
SalathielGenese Dec 11, 2022
b0a2872
feat: support popup close with escape key
SalathielGenese Dec 11, 2022
f4817a6
feat: add configuration form
SalathielGenese Dec 11, 2022
21f73df
feat: style configuration form
SalathielGenese Dec 11, 2022
03672ec
fix: label casing
SalathielGenese Dec 11, 2022
a3d848f
feat: add configuration popup title
SalathielGenese Dec 11, 2022
a38124e
feat: style popup title
SalathielGenese Dec 11, 2022
2ef9ead
feat: introduce theme color
SalathielGenese Dec 11, 2022
f6ee9a2
feat: improve popup close with escape key
SalathielGenese Dec 11, 2022
5f56c60
feat: add backdrop effect to opened popup
SalathielGenese Dec 11, 2022
fc26463
fix: the dialog popup opened/not-opened internal status and update pr…
SalathielGenese Dec 11, 2022
9ef0dab
feat: model configuration
SalathielGenese Dec 11, 2022
55a4ff5
feat: provide default configuration
SalathielGenese Dec 11, 2022
827fda2
feat: inject configuration as our Single sSource of Truth
SalathielGenese Dec 11, 2022
b6f24e1
feat: design and integrate the navigation bar, from which we can cont…
SalathielGenese Dec 12, 2022
a6fca8a
feat: add footer to the web page
SalathielGenese Dec 12, 2022
a763ec2
feat: design general layout flow
SalathielGenese Dec 12, 2022
3c82ff4
feat: add full fledge web editor dependency
SalathielGenese Dec 12, 2022
bbf4ddd
feat: configure monaco-editor
SalathielGenese Dec 12, 2022
2eab1ac
feat: implement MonaCoEditorService as a loader for the monaco editor…
SalathielGenese Dec 12, 2022
3b46722
feat: test Monaco Editor assets loading
SalathielGenese Dec 12, 2022
773bcbe
feat: scaffold an actual Monaco Editor
SalathielGenese Dec 12, 2022
61826e6
feat: force editors layout
SalathielGenese Dec 12, 2022
3b96ae0
feat: unsubscribe after Monaco Editor is loaded
SalathielGenese Dec 12, 2022
e0f74e6
feat: disable hard-coded dimension
SalathielGenese Dec 12, 2022
d206d0b
feat: optimize imports
SalathielGenese Dec 12, 2022
6143906
feat: set initial dimensions as relative
SalathielGenese Dec 12, 2022
88c915e
feat: detect resize and throttle dimension changes
SalathielGenese Dec 12, 2022
1758753
feat: compute editor size at container initialization
SalathielGenese Dec 12, 2022
e4e07fa
feat: adjust monaco editor upon resize
SalathielGenese Dec 12, 2022
1e0de7d
feat: make editor options configurable
SalathielGenese Dec 12, 2022
6790f63
feat: implement monaco editor as an Angular form-control
SalathielGenese Dec 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,44 @@ build/

### VS Code ###
.vscode/

# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/jsgenerator-web/dist
/jsgenerator-web/tmp
/jsgenerator-web/out-tsc
/jsgenerator-web/bazel-out

# Node
/jsgenerator-web/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/jsgenerator-web/.angular/cache
.sass-cache/
/jsgenerator-web/connect.lock
/jsgenerator-web/coverage
/jsgenerator-web/libpeerconnection.log
testem.log
/jsgenerator-web/typings

-# System files
-.DS_Store
-Thumbs.db
16 changes: 16 additions & 0 deletions jsgenerator-web/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
16 changes: 16 additions & 0 deletions jsgenerator-web/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
27 changes: 27 additions & 0 deletions jsgenerator-web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# JsgeneratorWeb

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.1.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
125 changes: 125 additions & 0 deletions jsgenerator-web/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"analytics": "9f07072f-05fe-4575-bb4b-8a0344a894e6",
"packageManager": "yarn"
},
"newProjectRoot": ".",
"projects": {
"jsgenerator-web": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "sass"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "jsgenerator",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/jsgenerator-web",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "sass",
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "**/*",
"input": "node_modules/monaco-editor",
"output": "assets/monaco-editor"
}
],
"styles": [
"src/styles.sass"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "jsgenerator-web:build:production"
},
"development": {
"browserTarget": "jsgenerator-web:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "jsgenerator-web:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "sass",
"assets": [
"src/favicon.ico",
"src/assets",
{
"glob": "**/*",
"input": "node_modules/monaco-editor",
"output": "assets/monaco-editor"
}
],
"styles": [
"src/styles.sass"
],
"scripts": []
}
}
}
}
},
"defaultProject": "jsgenerator-web"
}
44 changes: 44 additions & 0 deletions jsgenerator-web/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/jsgenerator-web'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
43 changes: 43 additions & 0 deletions jsgenerator-web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "jsgenerator-web",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~13.3.0",
"@angular/common": "~13.3.0",
"@angular/compiler": "~13.3.0",
"@angular/core": "~13.3.0",
"@angular/forms": "~13.3.0",
"@angular/platform-browser": "~13.3.0",
"@angular/platform-browser-dynamic": "~13.3.0",
"@angular/router": "~13.3.0",
"monaco-editor": "^0.34.1",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.3.1",
"@angular/cli": "~13.3.1",
"@angular/compiler-cli": "~13.3.0",
"@types/jasmine": "~3.10.0",
"@types/node": "^12.11.1",
"autoprefixer": "^10.4.13",
"jasmine-core": "~4.0.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"postcss": "^8.4.19",
"tailwindcss": "^3.2.4",
"typescript": "~4.6.2"
}
}
22 changes: 22 additions & 0 deletions jsgenerator-web/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>jsgenerator</artifactId>
<groupId>com.osscameroon</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>jsgenerator-web</artifactId>

<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
10 changes: 10 additions & 0 deletions jsgenerator-web/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
8 changes: 8 additions & 0 deletions jsgenerator-web/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<jsgenerator-navigation></jsgenerator-navigation>
<pre>{{ code }}</pre>
<main class="p-3 md:p-4 lg:p-6 grid grid-cols-2 items-stretch">
<jsgenerator-monaco-editor [(ngModel)]="code"></jsgenerator-monaco-editor>
<!-- <jsgenerator-monaco-editor [options]="{readOnly: true}"></jsgenerator-monaco-editor>-->
</main>
<jsgenerator-configuration></jsgenerator-configuration>
<jsgenerator-footer></jsgenerator-footer>
5 changes: 5 additions & 0 deletions jsgenerator-web/src/app/app.component.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
:host
@apply min-h-screen flex-col flex

> main
@apply flex-grow relative
Loading