Skip to content

Commit d76302e

Browse files
authored
Add created recipe files (#38)
1 parent ed86366 commit d76302e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+926
-0
lines changed
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# AngularNg
2+
3+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.9.
4+
5+
## Development server
6+
7+
To start a local development server, run:
8+
9+
```bash
10+
ng serve
11+
```
12+
13+
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
14+
15+
## Code scaffolding
16+
17+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
18+
19+
```bash
20+
ng generate component component-name
21+
```
22+
23+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
24+
25+
```bash
26+
ng generate --help
27+
```
28+
29+
## Building
30+
31+
To build the project run:
32+
33+
```bash
34+
ng build
35+
```
36+
37+
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
38+
39+
## Running unit tests
40+
41+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
42+
43+
```bash
44+
ng test
45+
```
46+
47+
## Running end-to-end tests
48+
49+
For end-to-end (e2e) testing, run:
50+
51+
```bash
52+
ng e2e
53+
```
54+
55+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
56+
57+
## Additional Resources
58+
59+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"angular_ng": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"inlineTemplate": true,
11+
"inlineStyle": true,
12+
"skipTests": true
13+
},
14+
"@schematics/angular:class": {
15+
"skipTests": true
16+
},
17+
"@schematics/angular:directive": {
18+
"skipTests": true
19+
},
20+
"@schematics/angular:guard": {
21+
"skipTests": true
22+
},
23+
"@schematics/angular:interceptor": {
24+
"skipTests": true
25+
},
26+
"@schematics/angular:pipe": {
27+
"skipTests": true
28+
},
29+
"@schematics/angular:resolver": {
30+
"skipTests": true
31+
},
32+
"@schematics/angular:service": {
33+
"skipTests": true
34+
}
35+
},
36+
"root": "",
37+
"sourceRoot": "src",
38+
"prefix": "app",
39+
"architect": {
40+
"build": {
41+
"builder": "@angular-devkit/build-angular:application",
42+
"options": {
43+
"outputPath": "dist/angular_ng",
44+
"index": "src/index.html",
45+
"browser": "src/main.ts",
46+
"polyfills": [
47+
"zone.js"
48+
],
49+
"tsConfig": "tsconfig.app.json",
50+
"assets": [
51+
{
52+
"glob": "**/*",
53+
"input": "public"
54+
}
55+
],
56+
"styles": [
57+
"src/styles.css"
58+
],
59+
"scripts": [],
60+
"allowedCommonJsDependencies": [
61+
"@bokeh/bokehjs",
62+
"mathjax-full",
63+
"regl"
64+
]
65+
},
66+
"configurations": {
67+
"production": {
68+
"budgets": [],
69+
"outputHashing": "all"
70+
},
71+
"development": {
72+
"optimization": false,
73+
"extractLicenses": false,
74+
"sourceMap": true
75+
}
76+
},
77+
"defaultConfiguration": "production"
78+
},
79+
"serve": {
80+
"builder": "@angular-devkit/build-angular:dev-server",
81+
"configurations": {
82+
"production": {
83+
"buildTarget": "angular_ng:build:production"
84+
},
85+
"development": {
86+
"buildTarget": "angular_ng:build:development"
87+
}
88+
},
89+
"defaultConfiguration": "development"
90+
},
91+
"extract-i18n": {
92+
"builder": "@angular-devkit/build-angular:extract-i18n"
93+
}
94+
}
95+
}
96+
}
97+
}
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "angular-ng",
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+
"@angular/common": "^19.2.0",
13+
"@angular/compiler": "^19.2.0",
14+
"@angular/core": "^19.2.0",
15+
"@angular/forms": "^19.2.0",
16+
"@angular/platform-browser": "^19.2.0",
17+
"@angular/platform-browser-dynamic": "^19.2.0",
18+
"@angular/router": "^19.2.0",
19+
"@bokeh/bokehjs": "file:../../../../bokeh-bokehjs-3.8.0-dev.1.tgz",
20+
"rxjs": "~7.8.0",
21+
"tslib": "^2.3.0",
22+
"zone.js": "~0.15.0"
23+
},
24+
"devDependencies": {
25+
"@angular-devkit/build-angular": "^19.2.9",
26+
"@angular/cli": "^19.2.9",
27+
"@angular/compiler-cli": "^19.2.0",
28+
"typescript": "~5.7.2"
29+
}
30+
}
14.7 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component } from '@angular/core'
2+
import { BokehJSComponent } from './bokeh-js/bokeh-js.component';
3+
4+
@Component({
5+
selector: 'app-root',
6+
imports: [BokehJSComponent],
7+
template: `<app-bokeh-js></app-bokeh-js>`,
8+
styles: [],
9+
})
10+
11+
export class AppComponent {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2+
3+
export const appConfig: ApplicationConfig = {
4+
providers: [provideZoneChangeDetection({ eventCoalescing: true })]
5+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Component, OnInit } from '@angular/core'
2+
import * as Bokeh from "@bokeh/bokehjs";
3+
4+
function create_bokehjs_plot(): Bokeh.Plotting.Figure {
5+
// Create figure
6+
const plot = Bokeh.Plotting.figure({
7+
title: "Example BokehJS plot", height: 500, sizing_mode: "stretch_width"
8+
});
9+
10+
// Calculate x, y value of sine curve
11+
const x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
12+
const y = x.map(x => Math.sin(Math.PI*x/6));
13+
14+
// Plot circles
15+
plot.scatter(x, y, {color: "blue", size: 30, fill_alpha: 0.4});
16+
17+
return plot;
18+
}
19+
@Component({
20+
selector: 'app-bokeh-js',
21+
imports: [],
22+
template: `<div id="target"></div>`,
23+
styles: ``
24+
})
25+
26+
export class BokehJSComponent implements OnInit {
27+
ngOnInit() {
28+
console.info("BokehJS version:", Bokeh.version);
29+
Bokeh.Plotting.show(create_bokehjs_plot(), "#target");
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>AngularNg</title>
6+
<base href="/">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<link rel="icon" type="image/x-icon" href="favicon.ico">
9+
</head>
10+
<body>
11+
<app-root></app-root>
12+
</body>
13+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { bootstrapApplication } from '@angular/platform-browser';
2+
import { appConfig } from './app/app.config';
3+
import { AppComponent } from './app/app.component';
4+
5+
bootstrapApplication(AppComponent, appConfig)
6+
.catch((err) => console.error(err));
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 */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3+
{
4+
"extends": "./tsconfig.json",
5+
"compilerOptions": {
6+
"outDir": "./out-tsc/app",
7+
"types": []
8+
},
9+
"files": [
10+
"src/main.ts"
11+
],
12+
"include": [
13+
"src/**/*.d.ts"
14+
]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3+
{
4+
"compileOnSave": false,
5+
"compilerOptions": {
6+
"outDir": "./dist/out-tsc",
7+
"strict": true,
8+
"noImplicitOverride": true,
9+
"noPropertyAccessFromIndexSignature": true,
10+
"noImplicitReturns": true,
11+
"noFallthroughCasesInSwitch": true,
12+
"skipLibCheck": true,
13+
"isolatedModules": true,
14+
"esModuleInterop": true,
15+
"experimentalDecorators": true,
16+
"moduleResolution": "bundler",
17+
"importHelpers": true,
18+
"target": "ES2022",
19+
"module": "ES2022"
20+
},
21+
"angularCompilerOptions": {
22+
"enableI18nLegacyMessageIdFormat": false,
23+
"strictInjectionParameters": true,
24+
"strictInputAccessModifiers": true,
25+
"strictTemplates": true
26+
}
27+
}
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13+
14+
```js
15+
export default tseslint.config({
16+
extends: [
17+
// Remove ...tseslint.configs.recommended and replace with this
18+
...tseslint.configs.recommendedTypeChecked,
19+
// Alternatively, use this for stricter rules
20+
...tseslint.configs.strictTypeChecked,
21+
// Optionally, add this for stylistic rules
22+
...tseslint.configs.stylisticTypeChecked,
23+
],
24+
languageOptions: {
25+
// other options...
26+
parserOptions: {
27+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
28+
tsconfigRootDir: import.meta.dirname,
29+
},
30+
},
31+
})
32+
```
33+
34+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
35+
36+
```js
37+
// eslint.config.js
38+
import reactX from 'eslint-plugin-react-x'
39+
import reactDom from 'eslint-plugin-react-dom'
40+
41+
export default tseslint.config({
42+
plugins: {
43+
// Add the react-x and react-dom plugins
44+
'react-x': reactX,
45+
'react-dom': reactDom,
46+
},
47+
rules: {
48+
// other rules...
49+
// Enable its recommended typescript rules
50+
...reactX.configs['recommended-typescript'].rules,
51+
...reactDom.configs.recommended.rules,
52+
},
53+
})
54+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

0 commit comments

Comments
 (0)