Skip to content

Commit bdae81f

Browse files
committed
feat(packages): add angular
1 parent aba165f commit bdae81f

33 files changed

+8785
-1638
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
**/node_modules
22
**/dist
33
**/.svelte-kit
4+
**/.angular
45
**/package
56
*.tgz
67
*.log
78
.DS_Store
9+
Thumbs.db

.vscode/extensions.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"recommendations": [
33
"vue.volar",
4+
"angular.ng-template",
45
"svelte.svelte-vscode",
56
"esbenp.prettier-vscode"
67
]

examples/with-angular/.browserslistrc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR

examples/with-angular/angular.json

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"with-angular": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/with-angular",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": "src/polyfills.ts",
20+
"tsConfig": "tsconfig.app.json",
21+
"assets": [
22+
"src/favicon.ico",
23+
"src/assets"
24+
],
25+
"styles": [
26+
"src/styles.css"
27+
],
28+
"scripts": []
29+
},
30+
"configurations": {
31+
"production": {
32+
"budgets": [
33+
{
34+
"type": "initial",
35+
"maximumWarning": "500kb",
36+
"maximumError": "1mb"
37+
},
38+
{
39+
"type": "anyComponentStyle",
40+
"maximumWarning": "2kb",
41+
"maximumError": "4kb"
42+
}
43+
],
44+
"fileReplacements": [
45+
{
46+
"replace": "src/environments/environment.ts",
47+
"with": "src/environments/environment.prod.ts"
48+
}
49+
],
50+
"outputHashing": "all"
51+
},
52+
"development": {
53+
"buildOptimizer": false,
54+
"optimization": false,
55+
"vendorChunk": true,
56+
"extractLicenses": false,
57+
"sourceMap": true,
58+
"namedChunks": true
59+
}
60+
},
61+
"defaultConfiguration": "production"
62+
},
63+
"serve": {
64+
"builder": "@angular-devkit/build-angular:dev-server",
65+
"configurations": {
66+
"production": {
67+
"browserTarget": "with-angular:build:production"
68+
},
69+
"development": {
70+
"browserTarget": "with-angular:build:development"
71+
}
72+
},
73+
"defaultConfiguration": "development"
74+
},
75+
"extract-i18n": {
76+
"builder": "@angular-devkit/build-angular:extract-i18n",
77+
"options": {
78+
"browserTarget": "with-angular:build"
79+
}
80+
},
81+
"test": {
82+
"builder": "@angular-devkit/build-angular:karma",
83+
"options": {
84+
"main": "src/test.ts",
85+
"polyfills": "src/polyfills.ts",
86+
"tsConfig": "tsconfig.spec.json",
87+
"karmaConfig": "karma.conf.js",
88+
"assets": [
89+
"src/favicon.ico",
90+
"src/assets"
91+
],
92+
"styles": [
93+
"src/styles.css"
94+
],
95+
"scripts": []
96+
}
97+
}
98+
}
99+
}
100+
}
101+
}

examples/with-angular/package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "with-angular",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "ng serve",
7+
"build": "ng build",
8+
"watch": "ng build --watch --configuration development"
9+
},
10+
"private": true,
11+
"dependencies": {
12+
"@fireworks-js/angular": "workspace:*",
13+
"@angular/animations": "^14.0.0",
14+
"@angular/common": "^14.0.0",
15+
"@angular/compiler": "^14.0.0",
16+
"@angular/core": "^14.0.0",
17+
"@angular/forms": "^14.0.0",
18+
"@angular/platform-browser": "^14.0.0",
19+
"@angular/platform-browser-dynamic": "^14.0.0",
20+
"@angular/router": "^14.0.0",
21+
"rxjs": "~7.5.0",
22+
"tslib": "^2.3.0",
23+
"zone.js": "~0.11.4"
24+
},
25+
"devDependencies": {
26+
"@angular-devkit/build-angular": "^14.0.5",
27+
"@angular/cli": "~14.0.5",
28+
"@angular/compiler-cli": "^14.0.0",
29+
"@types/jasmine": "~4.0.0",
30+
"jasmine-core": "~4.1.0",
31+
"typescript": "~4.7.2"
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.fireworks {
2+
top: 0;
3+
left: 0;
4+
width: 100%;
5+
height: 100%;
6+
position: fixed;
7+
background: #000;
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="fireworks">
2+
<ng-fireworks></ng-fireworks>
3+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { Component } from '@angular/core'
2+
3+
@Component({
4+
selector: 'app-root',
5+
templateUrl: './app.component.html',
6+
styleUrls: ['./app.component.css']
7+
})
8+
export class AppComponent {
9+
title = 'with-angular'
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { NgModule } from '@angular/core'
2+
import { BrowserModule } from '@angular/platform-browser'
3+
import { AppComponent } from './app.component'
4+
import { FireworksModule } from '@fireworks-js/angular'
5+
6+
@NgModule({
7+
declarations: [
8+
AppComponent
9+
],
10+
imports: [
11+
BrowserModule,
12+
FireworksModule.withConfig({ opacity: 0 })
13+
],
14+
providers: [],
15+
bootstrap: [AppComponent]
16+
})
17+
export class AppModule { }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file can be replaced during build by using the `fileReplacements` array.
2+
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
3+
// The list of file replacements can be found in `angular.json`.
4+
5+
export const environment = {
6+
production: false
7+
}
8+
9+
/*
10+
* For easier debugging in development mode, you can import the following file
11+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12+
*
13+
* This import should be commented out in production mode because it will have a negative impact
14+
* on performance if an error is thrown.
15+
*/
16+
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.

examples/with-angular/src/index.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<title>@fireworks-js/angular</title>
7+
<base href="/">
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
</head>
10+
11+
<body>
12+
<app-root></app-root>
13+
</body>
14+
15+
</html>

examples/with-angular/src/main.ts

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { enableProdMode } from '@angular/core'
2+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
3+
import { AppModule } from './app/app.module'
4+
import { environment } from './environments/environment'
5+
6+
if (environment.production) {
7+
enableProdMode()
8+
}
9+
10+
platformBrowserDynamic()
11+
.bootstrapModule(AppModule)
12+
.catch((err) => console.error(err))
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* This file includes polyfills needed by Angular and is loaded before the app.
3+
* You can add your own extra polyfills to this file.
4+
*
5+
* This file is divided into 2 sections:
6+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8+
* file.
9+
*
10+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11+
* automatically update themselves. This includes recent versions of Safari, Chrome (including
12+
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
13+
*
14+
* Learn more in https://angular.io/guide/browser-support
15+
*/
16+
17+
/***************************************************************************************************
18+
* BROWSER POLYFILLS
19+
*/
20+
21+
/**
22+
* By default, zone.js will patch all possible macroTask and DomEvents
23+
* user can disable parts of macroTask/DomEvents patch by setting following flags
24+
* because those flags need to be set before `zone.js` being loaded, and webpack
25+
* will put import in the top of bundle, so user need to create a separate file
26+
* in this directory (for example: zone-flags.ts), and put the following flags
27+
* into that file, and then add the following code before importing zone.js.
28+
* import './zone-flags';
29+
*
30+
* The flags allowed in zone-flags.ts are listed here.
31+
*
32+
* The following flags will work for all browsers.
33+
*
34+
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
35+
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
36+
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
37+
*
38+
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
39+
* with the following flag, it will bypass `zone.js` patch for IE/Edge
40+
*
41+
* (window as any).__Zone_enable_cross_context_check = true;
42+
*
43+
*/
44+
45+
/***************************************************************************************************
46+
* Zone JS is required by default for Angular itself.
47+
*/
48+
import 'zone.js'
49+
50+
// Included with Angular CLI.
51+
52+
/***************************************************************************************************
53+
* APPLICATION IMPORTS
54+
*/

examples/with-angular/src/styles.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* You can add global styles to this file, and also import other style files */
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
2+
{
3+
"extends": "./tsconfig.json",
4+
"compilerOptions": {
5+
"outDir": "./out-tsc/app",
6+
"types": []
7+
},
8+
"files": [
9+
"src/main.ts",
10+
"src/polyfills.ts"
11+
],
12+
"include": [
13+
"src/**/*.d.ts"
14+
]
15+
}

examples/with-angular/tsconfig.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
2+
{
3+
"compileOnSave": false,
4+
"compilerOptions": {
5+
"baseUrl": "./",
6+
"outDir": "./dist/out-tsc",
7+
"forceConsistentCasingInFileNames": true,
8+
"strict": true,
9+
"noImplicitOverride": true,
10+
"noPropertyAccessFromIndexSignature": true,
11+
"noImplicitReturns": true,
12+
"noFallthroughCasesInSwitch": true,
13+
"sourceMap": true,
14+
"declaration": false,
15+
"downlevelIteration": true,
16+
"experimentalDecorators": true,
17+
"moduleResolution": "node",
18+
"importHelpers": true,
19+
"target": "es2020",
20+
"module": "es2020",
21+
"lib": [
22+
"es2020",
23+
"dom"
24+
]
25+
},
26+
"angularCompilerOptions": {
27+
"enableI18nLegacyMessageIdFormat": false,
28+
"strictInjectionParameters": true,
29+
"strictInputAccessModifiers": true,
30+
"strictTemplates": true
31+
}
32+
}

packages/angular/.gitkeep

Whitespace-only changes.

packages/angular/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @fireworks-js/angular
2+
3+
> https://github.com/crashmax-dev/fireworks-js

0 commit comments

Comments
 (0)