Skip to content

Commit

Permalink
Angular SDK (#5)
Browse files Browse the repository at this point in the history
* Initialise files for angular Login component

* Add a default value for the defaultClasses argument

* Update types for onSubmit handler

* Modify onSubmitButton which accepts a single argument containing a callback and ssoIdentifier

* Add getTargetPath property to update output path for angular, remove unncessary imports for angular using plugins and link a stylesUrl for angular output

* Update entryFile

* Lib folder for buildinf library

* Generate a components folder and add that in docs

* Remove mitosis generated output

* Pin packages and cleanup

* Setup tailwind

* Create prism services for syntax highlighting

* Navbar for routing

* Home component view

* Boxyhq logo

* Cleanup app view

* Unpin packgaes and install tailwind

* Setup styles for tailwind and prismjs

* Setup routes for home and components view

* Include all components in app imports

* Update components view

* Add gitignore for src

* Modify onSubmit callback into an arrow function

* Modify plugin to map types to the output event emitter

* Update docs styles

* Update components view

* Pin packages

* Update components view

* Adjust margin

* Fix installation issues with angular dependencies

* Fix duplicate options

* Update mitosis

* Out mitosis files for angular to tmp folder

* Set `types` for sso subentry

* Switch back to typescript entry

* Refactor utils to 1 level up

* Enable typescript for vue3

* Fix typescript setup and declaration emitting

* build script for shaping angular lib

* Override entry file for sso to use named export

* postbuild, postcss setups

* Update css styleUrl

* Pass literal classname value as default class name

* Exclude overrides folder

* Update .gitignore

* Formatting changes

* Default to lib project build

* [dx - vscode intellisense] Point to library source code

* Fix public-api for main entry point

* Update angular peer dependencies for lib

* Refactor lib structure

* [doc app Fixes] imports, onSubmit event handling , tsconfig paths

* Tweak and add comments

* [skip ci] Override types for angular

* Minor formatting change

* Override vue3 types

* Resolve types path for vue in overrides folder

* Use dev script to open up doc app

* Add angular sdk build

* Try with order change

* Fix expression

* Fix `format`

* Add prepare step for angular build

* Fix peer dependencies for lib

* Minor fixes

* Refactor, publish angular package from dist folder

* Cleanup

* Update peer dependencies for vue2 lib

---------

Co-authored-by: Ryukemeister <[email protected]>
  • Loading branch information
niwsa and Ryukemeister authored Jun 12, 2023
1 parent a4422c2 commit d5b377c
Show file tree
Hide file tree
Showing 70 changed files with 14,764 additions and 75 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ jobs:
name: mitosis-out-vue2
path: |
./vue2/src
- name: Export framework code for angular
uses: actions/upload-artifact@v3
with:
name: mitosis-out-angular
path: |
./angular/projects/boxyhq/angular-ui/**/*
- id: sdk-version
name: Retrieve version and publishtag
run: |
Expand All @@ -68,16 +74,16 @@ jobs:
echo "NPM_VERSION=${JACKSON_VERSION}" >> $GITHUB_OUTPUT
echo "PUBLISH_TAG=${publishTag}" >> $GITHUB_OUTPUT
build-publish-framework-lib:
build-publish-lib:
needs: ['mitosis-generate']
runs-on: ubuntu-latest

strategy:
matrix:
framework: [react, vue, vue2]
framework: [react, angular, vue, vue2]
defaults:
run:
working-directory: ${{ matrix.framework}}
working-directory: ${{ matrix.framework }}

steps:
- uses: actions/checkout@v3
Expand All @@ -94,9 +100,11 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: mitosis-out-${{ matrix.framework }}
path: ./${{ matrix.framework }}/src
path: ${{ matrix.framework == 'angular' && './angular/projects/boxyhq/angular-ui' || format('./{0}/src',matrix.framework) }}
- run: npm ci
- name: Publish NPM
# Publish angular package from the dist folder
working-directory: ${{ matrix.framework == 'angular' && 'angular/dist/boxyhq/angular-ui' || matrix.framework }}
if: github.ref == 'refs/heads/release' || contains(github.ref, 'refs/tags/beta-v')
run: |
npm install -g json
Expand Down
16 changes: 16 additions & 0 deletions angular/.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
42 changes: 42 additions & 0 deletions angular/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
**/tmp
/out-tsc
/bazel-out

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

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

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

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

# System files
.DS_Store
Thumbs.db
27 changes: 27 additions & 0 deletions angular/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Angular

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

## 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.
113 changes: 113 additions & 0 deletions angular/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"docs": {
"projectType": "application",
"schematics": {},
"root": "projects/docs",
"sourceRoot": "projects/docs/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/docs",
"index": "projects/docs/src/index.html",
"main": "projects/docs/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "projects/docs/tsconfig.app.json",
"assets": ["projects/docs/src/favicon.ico", "projects/docs/src/assets"],
"styles": ["projects/docs/src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"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": "docs:build:production"
},
"development": {
"browserTarget": "docs:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "docs:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "projects/docs/tsconfig.spec.json",
"assets": ["projects/docs/src/favicon.ico", "projects/docs/src/assets"],
"styles": ["projects/docs/src/styles.css"],
"scripts": []
}
}
}
},
"@boxyhq/angular-ui": {
"projectType": "library",
"root": "projects/boxyhq/angular-ui",
"sourceRoot": "projects/boxyhq/angular-ui",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/boxyhq/angular-ui/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/boxyhq/angular-ui/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/boxyhq/angular-ui/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": "projects/boxyhq/angular-ui/tsconfig.spec.json",
"polyfills": ["zone.js", "zone.js/testing"]
}
}
}
}
}
}
Loading

0 comments on commit d5b377c

Please sign in to comment.