wally-ui 1.0.4 → 1.0.6

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.
Files changed (38) hide show
  1. package/dist/cli.js +10 -9
  2. package/dist/cli.js.map +1 -1
  3. package/package.json +2 -2
  4. package/playground/showcase/.editorconfig +17 -0
  5. package/playground/showcase/.postcssrc.json +5 -0
  6. package/playground/showcase/.vscode/extensions.json +4 -0
  7. package/playground/showcase/.vscode/launch.json +20 -0
  8. package/playground/showcase/.vscode/tasks.json +42 -0
  9. package/playground/showcase/README.md +59 -0
  10. package/playground/showcase/angular.json +100 -0
  11. package/playground/showcase/package-lock.json +10671 -0
  12. package/playground/showcase/package.json +55 -0
  13. package/playground/showcase/public/favicon.ico +0 -0
  14. package/playground/showcase/src/app/app.config.server.ts +12 -0
  15. package/playground/showcase/src/app/app.config.ts +13 -0
  16. package/playground/showcase/src/app/app.css +0 -0
  17. package/playground/showcase/src/app/app.html +1 -0
  18. package/playground/showcase/src/app/app.routes.server.ts +12 -0
  19. package/playground/showcase/src/app/app.routes.ts +8 -0
  20. package/playground/showcase/src/app/app.spec.ts +23 -0
  21. package/playground/showcase/src/app/app.ts +12 -0
  22. package/playground/showcase/src/app/components/button/button.html +14 -0
  23. package/playground/showcase/src/app/components/button/button.spec.ts +23 -0
  24. package/playground/showcase/src/app/components/button/button.ts +10 -0
  25. package/playground/showcase/src/app/pages/home/home.css +0 -0
  26. package/playground/showcase/src/app/pages/home/home.html +4 -0
  27. package/playground/showcase/src/app/pages/home/home.spec.ts +23 -0
  28. package/playground/showcase/src/app/pages/home/home.ts +14 -0
  29. package/playground/showcase/src/index.html +27 -0
  30. package/playground/showcase/src/main.server.ts +8 -0
  31. package/playground/showcase/src/main.ts +6 -0
  32. package/playground/showcase/src/server.ts +68 -0
  33. package/playground/showcase/src/styles.css +6 -0
  34. package/playground/showcase/tsconfig.app.json +17 -0
  35. package/playground/showcase/tsconfig.json +34 -0
  36. package/playground/showcase/tsconfig.spec.json +14 -0
  37. package/templates/button/button.component.html +0 -16
  38. package/templates/button/button.component.ts +0 -18
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "showcase",
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
+ "test": "ng test",
10
+ "serve:ssr:showcase": "node dist/showcase/server/server.mjs"
11
+ },
12
+ "prettier": {
13
+ "overrides": [
14
+ {
15
+ "files": "*.html",
16
+ "options": {
17
+ "parser": "angular"
18
+ }
19
+ }
20
+ ]
21
+ },
22
+ "private": true,
23
+ "dependencies": {
24
+ "@angular/common": "^20.0.0",
25
+ "@angular/compiler": "^20.0.0",
26
+ "@angular/core": "^20.0.0",
27
+ "@angular/forms": "^20.0.0",
28
+ "@angular/platform-browser": "^20.0.0",
29
+ "@angular/platform-server": "^20.0.0",
30
+ "@angular/router": "^20.0.0",
31
+ "@angular/ssr": "^20.0.5",
32
+ "@tailwindcss/postcss": "^4.1.13",
33
+ "express": "^5.1.0",
34
+ "postcss": "^8.5.6",
35
+ "rxjs": "~7.8.0",
36
+ "tailwindcss": "^4.1.13",
37
+ "tslib": "^2.3.0",
38
+ "zone.js": "~0.15.0"
39
+ },
40
+ "devDependencies": {
41
+ "@angular/build": "^20.0.5",
42
+ "@angular/cli": "^20.0.5",
43
+ "@angular/compiler-cli": "^20.0.0",
44
+ "@types/express": "^5.0.1",
45
+ "@types/jasmine": "~5.1.0",
46
+ "@types/node": "^20.17.19",
47
+ "jasmine-core": "~5.7.0",
48
+ "karma": "~6.4.0",
49
+ "karma-chrome-launcher": "~3.2.0",
50
+ "karma-coverage": "~2.2.0",
51
+ "karma-jasmine": "~5.1.0",
52
+ "karma-jasmine-html-reporter": "~2.1.0",
53
+ "typescript": "~5.8.2"
54
+ }
55
+ }
@@ -0,0 +1,12 @@
1
+ import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2
+ import { provideServerRendering, withRoutes } from '@angular/ssr';
3
+ import { appConfig } from './app.config';
4
+ import { serverRoutes } from './app.routes.server';
5
+
6
+ const serverConfig: ApplicationConfig = {
7
+ providers: [
8
+ provideServerRendering(withRoutes(serverRoutes))
9
+ ]
10
+ };
11
+
12
+ export const config = mergeApplicationConfig(appConfig, serverConfig);
@@ -0,0 +1,13 @@
1
+ import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
2
+ import { provideRouter } from '@angular/router';
3
+
4
+ import { routes } from './app.routes';
5
+ import { provideClientHydration, withEventReplay } from '@angular/platform-browser';
6
+
7
+ export const appConfig: ApplicationConfig = {
8
+ providers: [
9
+ provideBrowserGlobalErrorListeners(),
10
+ provideZoneChangeDetection({ eventCoalescing: true }),
11
+ provideRouter(routes), provideClientHydration(withEventReplay())
12
+ ]
13
+ };
File without changes
@@ -0,0 +1 @@
1
+ <router-outlet />
@@ -0,0 +1,12 @@
1
+ import { RenderMode, ServerRoute } from '@angular/ssr';
2
+
3
+ export const serverRoutes: ServerRoute[] = [
4
+ {
5
+ path: '',
6
+ renderMode: RenderMode.Prerender
7
+ },
8
+ {
9
+ path: '**',
10
+ renderMode: RenderMode.Prerender
11
+ }
12
+ ];
@@ -0,0 +1,8 @@
1
+ import { Routes } from '@angular/router';
2
+
3
+ export const routes: Routes = [
4
+ {
5
+ path: '',
6
+ loadComponent: () => import('./pages/home/home').then(m => m.Home)
7
+ }
8
+ ];
@@ -0,0 +1,23 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+ import { App } from './app';
3
+
4
+ describe('App', () => {
5
+ beforeEach(async () => {
6
+ await TestBed.configureTestingModule({
7
+ imports: [App],
8
+ }).compileComponents();
9
+ });
10
+
11
+ it('should create the app', () => {
12
+ const fixture = TestBed.createComponent(App);
13
+ const app = fixture.componentInstance;
14
+ expect(app).toBeTruthy();
15
+ });
16
+
17
+ it('should render title', () => {
18
+ const fixture = TestBed.createComponent(App);
19
+ fixture.detectChanges();
20
+ const compiled = fixture.nativeElement as HTMLElement;
21
+ expect(compiled.querySelector('h1')?.textContent).toContain('Hello, showcase');
22
+ });
23
+ });
@@ -0,0 +1,12 @@
1
+ import { Component } from '@angular/core';
2
+ import { RouterOutlet } from '@angular/router';
3
+
4
+ @Component({
5
+ selector: 'app-root',
6
+ imports: [RouterOutlet],
7
+ templateUrl: './app.html',
8
+ styleUrl: './app.css'
9
+ })
10
+ export class App {
11
+ protected title = 'showcase';
12
+ }
@@ -0,0 +1,14 @@
1
+ <button class="
2
+ w-full
3
+ bg-[#0a0a0a]
4
+ dark:bg-white
5
+ p-2.5
6
+ rounded-md
7
+ ">
8
+ <span class="
9
+ text-white
10
+ dark:text-[#0a0a0a]
11
+ ">
12
+ {{ buttonText() }}
13
+ </span>
14
+ </button>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { Button } from './button';
4
+
5
+ describe('Button', () => {
6
+ let component: Button;
7
+ let fixture: ComponentFixture<Button>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [Button]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(Button);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,10 @@
1
+ import { Component, input, InputSignal } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'wally-button',
5
+ imports: [],
6
+ templateUrl: './button.html',
7
+ })
8
+ export class Button {
9
+ buttonText: InputSignal<string> = input<string>('Add your button text here');
10
+ }
@@ -0,0 +1,4 @@
1
+ <p>home works!</p>
2
+ <div class="p-4">
3
+ <wally-button></wally-button>
4
+ </div>
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { Home } from './home';
4
+
5
+ describe('Home', () => {
6
+ let component: Home;
7
+ let fixture: ComponentFixture<Home>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [Home]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(Home);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,14 @@
1
+ import { Component } from '@angular/core';
2
+ import { Button } from '../../components/button/button';
3
+
4
+ @Component({
5
+ selector: 'wally-home',
6
+ imports: [
7
+ Button
8
+ ],
9
+ templateUrl: './home.html',
10
+ styleUrl: './home.css'
11
+ })
12
+ export class Home {
13
+
14
+ }
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+ <title>Showcase</title>
7
+ <base href="/">
8
+
9
+ <script>
10
+ // Baseado na documentação oficial do Tailwind 4
11
+ document.documentElement.classList.toggle(
12
+ "dark",
13
+ localStorage.theme === "dark" ||
14
+ (!("theme" in localStorage) &&
15
+ window.matchMedia("(prefers-color-scheme: dark)").matches)
16
+ );
17
+ </script>
18
+
19
+ <meta name="viewport" content="width=device-width, initial-scale=1">
20
+ <link rel="icon" type="image/x-icon" href="favicon.ico">
21
+ </head>
22
+
23
+ <body class="bg-white dark:bg-[#0a0a0a]">
24
+ <app-root></app-root>
25
+ </body>
26
+
27
+ </html>
@@ -0,0 +1,8 @@
1
+ import { bootstrapApplication, BootstrapContext } from '@angular/platform-browser';
2
+
3
+ import { config } from './app/app.config.server';
4
+ import { App } from './app/app';
5
+
6
+ const bootstrap = (context: BootstrapContext) => bootstrapApplication(App, config, context);
7
+
8
+ export default bootstrap;
@@ -0,0 +1,6 @@
1
+ import { bootstrapApplication } from '@angular/platform-browser';
2
+ import { appConfig } from './app/app.config';
3
+ import { App } from './app/app';
4
+
5
+ bootstrapApplication(App, appConfig)
6
+ .catch((err) => console.error(err));
@@ -0,0 +1,68 @@
1
+ import {
2
+ AngularNodeAppEngine,
3
+ createNodeRequestHandler,
4
+ isMainModule,
5
+ writeResponseToNodeResponse,
6
+ } from '@angular/ssr/node';
7
+ import express from 'express';
8
+ import { join } from 'node:path';
9
+
10
+ const browserDistFolder = join(import.meta.dirname, '../browser');
11
+
12
+ const app = express();
13
+ const angularApp = new AngularNodeAppEngine();
14
+
15
+ /**
16
+ * Example Express Rest API endpoints can be defined here.
17
+ * Uncomment and define endpoints as necessary.
18
+ *
19
+ * Example:
20
+ * ```ts
21
+ * app.get('/api/{*splat}', (req, res) => {
22
+ * // Handle API request
23
+ * });
24
+ * ```
25
+ */
26
+
27
+ /**
28
+ * Serve static files from /browser
29
+ */
30
+ app.use(
31
+ express.static(browserDistFolder, {
32
+ maxAge: '1y',
33
+ index: false,
34
+ redirect: false,
35
+ }),
36
+ );
37
+
38
+ /**
39
+ * Handle all other requests by rendering the Angular application.
40
+ */
41
+ app.use((req, res, next) => {
42
+ angularApp
43
+ .handle(req)
44
+ .then((response) =>
45
+ response ? writeResponseToNodeResponse(response, res) : next(),
46
+ )
47
+ .catch(next);
48
+ });
49
+
50
+ /**
51
+ * Start the server if this module is the main entry point.
52
+ * The server listens on the port defined by the `PORT` environment variable, or defaults to 4000.
53
+ */
54
+ if (isMainModule(import.meta.url)) {
55
+ const port = process.env['PORT'] || 4000;
56
+ app.listen(port, (error) => {
57
+ if (error) {
58
+ throw error;
59
+ }
60
+
61
+ console.log(`Node Express server listening on http://localhost:${port}`);
62
+ });
63
+ }
64
+
65
+ /**
66
+ * Request handler used by the Angular CLI (for dev-server and during build) or Firebase Cloud Functions.
67
+ */
68
+ export const reqHandler = createNodeRequestHandler(app);
@@ -0,0 +1,6 @@
1
+ /* You can add global styles to this file, and also import other style files */
2
+ @import "tailwindcss";
3
+
4
+ @custom-variant dark (&:where(.dark, .dark *));
5
+
6
+ @custom-variant dark-data (&:where([data-theme=dark], [data-theme=dark] *));
@@ -0,0 +1,17 @@
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
+ "node"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.ts"
13
+ ],
14
+ "exclude": [
15
+ "src/**/*.spec.ts"
16
+ ]
17
+ }
@@ -0,0 +1,34 @@
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
+ "strict": true,
7
+ "noImplicitOverride": true,
8
+ "noPropertyAccessFromIndexSignature": true,
9
+ "noImplicitReturns": true,
10
+ "noFallthroughCasesInSwitch": true,
11
+ "skipLibCheck": true,
12
+ "isolatedModules": true,
13
+ "experimentalDecorators": true,
14
+ "importHelpers": true,
15
+ "target": "ES2022",
16
+ "module": "preserve"
17
+ },
18
+ "angularCompilerOptions": {
19
+ "enableI18nLegacyMessageIdFormat": false,
20
+ "strictInjectionParameters": true,
21
+ "strictInputAccessModifiers": true,
22
+ "typeCheckHostBindings": true,
23
+ "strictTemplates": true
24
+ },
25
+ "files": [],
26
+ "references": [
27
+ {
28
+ "path": "./tsconfig.app.json"
29
+ },
30
+ {
31
+ "path": "./tsconfig.spec.json"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,14 @@
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/spec",
7
+ "types": [
8
+ "jasmine"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.ts"
13
+ ]
14
+ }
@@ -1,16 +0,0 @@
1
- <div class="max-w-md mx-auto bg-white rounded-xl shadow-md p-6">
2
- <h2 class="text-2xl font-bold text-gray-900 mb-4 text-center">
3
- {{ title() }}
4
- </h2>
5
-
6
- <button (click)="onClick()"
7
- class="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-6 rounded-lg transition-colors">
8
- Clique em mim!
9
- </button>
10
-
11
- <div class="mt-4 text-center">
12
- <span class="text-lg font-semibold text-blue-600">
13
- Cliques: {{ clickCount() }}
14
- </span>
15
- </div>
16
- </div>
@@ -1,18 +0,0 @@
1
- import { Component, signal } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
-
4
- @Component({
5
- selector: 'app-button',
6
- standalone: true,
7
- imports: [CommonModule],
8
- templateUrl: './button.component.html'
9
- })
10
- export class ButtonComponent {
11
- title = signal('Button Component');
12
- clickCount = signal(0);
13
-
14
- onClick() {
15
- this.clickCount.update(count => count + 1);
16
- console.log(`${this.title()} clicado ${this.clickCount()} vezes`);
17
- }
18
- }