@musti007/my-lib 0.0.1

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 ADDED
@@ -0,0 +1,64 @@
1
+ # MyLib
2
+
3
+ This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
8
+
9
+ ```bash
10
+ ng generate component component-name
11
+ ```
12
+
13
+ For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
14
+
15
+ ```bash
16
+ ng generate --help
17
+ ```
18
+
19
+ ## Building
20
+
21
+ To build the library, run:
22
+
23
+ ```bash
24
+ ng build my-lib
25
+ ```
26
+
27
+ This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
28
+
29
+ ### Publishing the Library
30
+
31
+ Once the project is built, you can publish your library by following these steps:
32
+
33
+ 1. Navigate to the `dist` directory:
34
+
35
+ ```bash
36
+ cd dist/my-lib
37
+ ```
38
+
39
+ 2. Run the `npm publish` command to publish your library to the npm registry:
40
+ ```bash
41
+ npm publish
42
+ ```
43
+
44
+ ## Running unit tests
45
+
46
+ To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
47
+
48
+ ```bash
49
+ ng test
50
+ ```
51
+
52
+ ## Running end-to-end tests
53
+
54
+ For end-to-end (e2e) testing, run:
55
+
56
+ ```bash
57
+ ng e2e
58
+ ```
59
+
60
+ Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
61
+
62
+ ## Additional Resources
63
+
64
+ 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.
@@ -0,0 +1,85 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, signal, Injectable, Pipe } from '@angular/core';
3
+
4
+ class MyLib {
5
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: MyLib, deps: [], target: i0.ɵɵFactoryTarget.Component });
6
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: MyLib, isStandalone: true, selector: "lib-my-lib", ngImport: i0, template: ` <p>my-lib works!</p> `, isInline: true, styles: [""] });
7
+ }
8
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: MyLib, decorators: [{
9
+ type: Component,
10
+ args: [{ selector: 'lib-my-lib', imports: [], template: ` <p>my-lib works!</p> ` }]
11
+ }] });
12
+
13
+ class ApiService {
14
+ messageSignal = signal('Please write something in the input field to see the difference.', ...(ngDevMode ? [{ debugName: "messageSignal" }] : /* istanbul ignore next */ []));
15
+ // getter
16
+ message = this.messageSignal.asReadonly();
17
+ // update method
18
+ setMessage(newMessage) {
19
+ this.messageSignal.set(newMessage);
20
+ }
21
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: ApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
22
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: ApiService, providedIn: 'root' });
23
+ }
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: ApiService, decorators: [{
25
+ type: Injectable,
26
+ args: [{
27
+ providedIn: 'root',
28
+ }]
29
+ }] });
30
+
31
+ class CapitalizePipe {
32
+ transform(value, mode = 'title') {
33
+ if (!value)
34
+ return '';
35
+ switch (mode) {
36
+ // Each word capitalized
37
+ case 'title':
38
+ return value
39
+ .trim()
40
+ .split(/\s+/)
41
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
42
+ .join(' ');
43
+ // Only first letter of sentence
44
+ case 'sentence':
45
+ return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
46
+ // ALL CAPS
47
+ case 'upper':
48
+ return value.toUpperCase();
49
+ // all lowercase
50
+ case 'lower':
51
+ return value.toLowerCase();
52
+ default:
53
+ return value;
54
+ }
55
+ }
56
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
57
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.7", ngImport: i0, type: CapitalizePipe, isStandalone: true, name: "capitalize" });
58
+ }
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: CapitalizePipe, decorators: [{
60
+ type: Pipe,
61
+ args: [{
62
+ name: 'capitalize',
63
+ standalone: true,
64
+ }]
65
+ }] });
66
+
67
+ class MyLibComponent {
68
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: MyLibComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
69
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.7", type: MyLibComponent, isStandalone: true, selector: "app-my-lib", ngImport: i0, template: "<p>my-lib works!</p>\n", styles: [""] });
70
+ }
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.7", ngImport: i0, type: MyLibComponent, decorators: [{
72
+ type: Component,
73
+ args: [{ selector: 'app-my-lib', imports: [], template: "<p>my-lib works!</p>\n" }]
74
+ }] });
75
+
76
+ /*
77
+ * Public API Surface of my-lib
78
+ */
79
+
80
+ /**
81
+ * Generated bundle index. Do not edit.
82
+ */
83
+
84
+ export { ApiService, CapitalizePipe, MyLib, MyLibComponent };
85
+ //# sourceMappingURL=musti007-my-lib.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"musti007-my-lib.mjs","sources":["../../../projects/my-lib/src/lib/my-lib.ts","../../../projects/my-lib/src/lib/services/api.service.ts","../../../projects/my-lib/src/lib/pipes/capitalize-pipe.ts","../../../projects/my-lib/src/lib/components/my-lib/my-lib.component.ts","../../../projects/my-lib/src/lib/components/my-lib/my-lib.html","../../../projects/my-lib/src/public-api.ts","../../../projects/my-lib/src/musti007-my-lib.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'lib-my-lib',\n imports: [],\n template: ` <p>my-lib works!</p> `,\n styles: ``,\n})\nexport class MyLib {}\n","import { Injectable, signal } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class ApiService {\n private messageSignal = signal(\n 'Please write something in the input field to see the difference.',\n );\n\n // getter\n message = this.messageSignal.asReadonly();\n\n // update method\n setMessage(newMessage: string) {\n this.messageSignal.set(newMessage);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'capitalize',\n standalone: true,\n})\nexport class CapitalizePipe implements PipeTransform {\n transform(value: string, mode: 'title' | 'sentence' | 'upper' | 'lower' = 'title'): string {\n if (!value) return '';\n\n switch (mode) {\n // Each word capitalized\n case 'title':\n return value\n .trim()\n .split(/\\s+/)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n\n // Only first letter of sentence\n case 'sentence':\n return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();\n\n // ALL CAPS\n case 'upper':\n return value.toUpperCase();\n\n // all lowercase\n case 'lower':\n return value.toLowerCase();\n\n default:\n return value;\n }\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'app-my-lib',\n imports: [],\n templateUrl: './my-lib.html',\n styleUrl: './my-lib.css',\n})\nexport class MyLibComponent {}\n","<p>my-lib works!</p>\n","/*\n * Public API Surface of my-lib\n */\n\nexport * from './lib/my-lib';\nexport * from './lib/services/api.service';\nexport * from './lib/pipes/capitalize-pipe';\nexport * from './lib/components';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAQa,KAAK,CAAA;uGAAL,KAAK,EAAA,IAAA,EAAA,EAAA,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;2FDOa,cAAc,EAAA,UAAA,EAAA,CAAA;kBAN1B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,WACb,EAAE,EAAA,QAAA,EAAA,wBAAA,EAAA;;;AEJb;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@musti007/my-lib",
3
+ "description": "Just a test package",
4
+ "version": "0.0.1",
5
+ "author": "Musti",
6
+ "license": "MIT",
7
+ "main": "./dist/index.js",
8
+ "peerDependencies": {
9
+ "@angular/common": "^21.2.0",
10
+ "@angular/core": "^21.2.0"
11
+ },
12
+ "dependencies": {
13
+ "tslib": "^2.3.0"
14
+ },
15
+ "sideEffects": false,
16
+ "module": "fesm2022/musti007-my-lib.mjs",
17
+ "typings": "types/musti007-my-lib.d.ts",
18
+ "exports": {
19
+ "./package.json": {
20
+ "default": "./package.json"
21
+ },
22
+ ".": {
23
+ "types": "./types/musti007-my-lib.d.ts",
24
+ "default": "./fesm2022/musti007-my-lib.mjs"
25
+ }
26
+ },
27
+ "type": "module"
28
+ }
@@ -0,0 +1,28 @@
1
+ import * as i0 from '@angular/core';
2
+ import { PipeTransform } from '@angular/core';
3
+
4
+ declare class MyLib {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<MyLib, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<MyLib, "lib-my-lib", never, {}, {}, never, never, true, never>;
7
+ }
8
+
9
+ declare class ApiService {
10
+ private messageSignal;
11
+ message: i0.Signal<string>;
12
+ setMessage(newMessage: string): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<ApiService, never>;
14
+ static ɵprov: i0.ɵɵInjectableDeclaration<ApiService>;
15
+ }
16
+
17
+ declare class CapitalizePipe implements PipeTransform {
18
+ transform(value: string, mode?: 'title' | 'sentence' | 'upper' | 'lower'): string;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<CapitalizePipe, never>;
20
+ static ɵpipe: i0.ɵɵPipeDeclaration<CapitalizePipe, "capitalize", true>;
21
+ }
22
+
23
+ declare class MyLibComponent {
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<MyLibComponent, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<MyLibComponent, "app-my-lib", never, {}, {}, never, never, true, never>;
26
+ }
27
+
28
+ export { ApiService, CapitalizePipe, MyLib, MyLibComponent };