create-analog 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/package.json +1 -1
- package/template-angular-v15/package.json +3 -2
- package/template-angular-v15/src/app/pages/index.page.ts +62 -0
- package/template-angular-v15/src/main.providers.ts +6 -0
- package/template-angular-v15/src/main.server.ts +2 -1
- package/template-angular-v15/src/main.ts +2 -1
- package/template-angular-v15/tsconfig.app.json +5 -1
package/README.md
CHANGED
|
@@ -26,24 +26,25 @@ You can also directly specify the project name and the template you want to use
|
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
28
|
# npm 6.x
|
|
29
|
-
npm create analog@latest my-angular-app --template angular-
|
|
29
|
+
npm create analog@latest my-angular-app --template angular-v15
|
|
30
30
|
|
|
31
31
|
# npm 7+, extra double-dash is needed:
|
|
32
|
-
npm create analog@latest my-angular-app -- --template angular-
|
|
32
|
+
npm create analog@latest my-angular-app -- --template angular-v15
|
|
33
33
|
|
|
34
34
|
# yarn
|
|
35
|
-
yarn create analog my-angular-app --template angular-
|
|
35
|
+
yarn create analog my-angular-app --template angular-v15
|
|
36
36
|
|
|
37
37
|
# pnpm
|
|
38
|
-
pnpm create analog my-angular-app --template angular-
|
|
38
|
+
pnpm create analog my-angular-app --template angular-v15
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Currently supported template presets include:
|
|
42
42
|
|
|
43
|
+
- `angular-v15`
|
|
43
44
|
- `angular-v14`
|
|
44
45
|
|
|
45
46
|
You can use `.` for the project name to scaffold in the current directory.
|
|
46
47
|
|
|
47
48
|
## Credits
|
|
48
49
|
|
|
49
|
-
This project is inspired by `create-vite`.
|
|
50
|
+
This project is inspired by `create-vite`.
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@angular/platform-browser-dynamic": "^15.0.0",
|
|
25
25
|
"@angular/platform-server": "^15.0.0",
|
|
26
26
|
"@angular/router": "^15.0.0",
|
|
27
|
-
"@nrwl/angular": "
|
|
27
|
+
"@nrwl/angular": "^15.7.0",
|
|
28
28
|
"rxjs": "~7.5.6",
|
|
29
29
|
"tslib": "^2.4.0",
|
|
30
30
|
"zone.js": "~0.11.8"
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"@angular-devkit/build-angular": "^15.0.0",
|
|
35
35
|
"@angular/cli": "~15.0.0",
|
|
36
36
|
"@angular/compiler-cli": "^15.0.0",
|
|
37
|
-
"@nrwl/vite": "
|
|
37
|
+
"@nrwl/vite": "^15.7.0",
|
|
38
|
+
"nx": "^15.7.0",
|
|
38
39
|
"jsdom": "^20.0.0",
|
|
39
40
|
"typescript": "~4.8.4",
|
|
40
41
|
"vite": "^4.0.3",
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-home',
|
|
5
|
+
standalone: true,
|
|
6
|
+
template: `
|
|
7
|
+
<div>
|
|
8
|
+
<a href="https://vitejs.dev" target="_blank">
|
|
9
|
+
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://angular.io/" target="_blank">
|
|
12
|
+
<img
|
|
13
|
+
alt="Angular Logo"
|
|
14
|
+
class="logo angular"
|
|
15
|
+
src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg=="
|
|
16
|
+
/>
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<h1>Vite + Angular</h1>
|
|
21
|
+
|
|
22
|
+
<div class="card">
|
|
23
|
+
<button type="button" (click)="increment()">Count {{ count }}</button>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<p>
|
|
27
|
+
Check out
|
|
28
|
+
<a href="https://github.com/analogjs/analog#readme" target="_blank"
|
|
29
|
+
>Analog</a
|
|
30
|
+
>, the fullstack meta-framework for Angular powered by Vite!
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<p class="read-the-docs">
|
|
34
|
+
Click on the Vite and Angular logos to learn more.
|
|
35
|
+
</p>
|
|
36
|
+
`,
|
|
37
|
+
styles: [
|
|
38
|
+
`
|
|
39
|
+
.logo {
|
|
40
|
+
height: 6em;
|
|
41
|
+
padding: 1.5em;
|
|
42
|
+
will-change: filter;
|
|
43
|
+
}
|
|
44
|
+
.logo:hover {
|
|
45
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
46
|
+
}
|
|
47
|
+
.logo.angular:hover {
|
|
48
|
+
filter: drop-shadow(0 0 2em #42b883aa);
|
|
49
|
+
}
|
|
50
|
+
.read-the-docs {
|
|
51
|
+
color: #888;
|
|
52
|
+
}
|
|
53
|
+
`,
|
|
54
|
+
],
|
|
55
|
+
})
|
|
56
|
+
export default class HomeComponent {
|
|
57
|
+
count = 0;
|
|
58
|
+
|
|
59
|
+
increment() {
|
|
60
|
+
this.count++;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -5,6 +5,7 @@ import { provideFileRouter } from '@analogjs/router';
|
|
|
5
5
|
import { withEnabledBlockingInitialNavigation } from '@angular/router';
|
|
6
6
|
|
|
7
7
|
import { AppComponent } from './app/app.component';
|
|
8
|
+
import { mainProviders } from './main.providers';
|
|
8
9
|
|
|
9
10
|
if (import.meta.env.PROD) {
|
|
10
11
|
enableProdMode();
|
|
@@ -15,7 +16,7 @@ export default async function render(url: string, document: string) {
|
|
|
15
16
|
appId: 'analog-app',
|
|
16
17
|
document,
|
|
17
18
|
url,
|
|
18
|
-
providers: [provideFileRouter(withEnabledBlockingInitialNavigation())],
|
|
19
|
+
providers: [provideFileRouter(withEnabledBlockingInitialNavigation()), ...mainProviders],
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
return html;
|
|
@@ -3,7 +3,8 @@ import { bootstrapApplication } from '@angular/platform-browser';
|
|
|
3
3
|
import { provideFileRouter } from '@analogjs/router';
|
|
4
4
|
|
|
5
5
|
import { AppComponent } from './app/app.component';
|
|
6
|
+
import { mainProviders } from './main.providers';
|
|
6
7
|
|
|
7
8
|
bootstrapApplication(AppComponent, {
|
|
8
|
-
providers: [provideFileRouter()],
|
|
9
|
+
providers: [provideFileRouter(), ...mainProviders],
|
|
9
10
|
});
|