diff --git a/angular.json b/angular.json index efd40b0..e514631 100644 --- a/angular.json +++ b/angular.json @@ -89,6 +89,39 @@ } } } + }, + "flow": { + "projectType": "library", + "root": "projects/flow", + "sourceRoot": "projects/flow/src", + "prefix": "lib", + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "options": { + "project": "projects/flow/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "projects/flow/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "projects/flow/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "tsConfig": "projects/flow/tsconfig.spec.json", + "polyfills": [ + "zone.js", + "zone.js/testing" + ] + } + } + } } }, "cli": { diff --git a/package.json b/package.json index 03843aa..59b711d 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "autoprefixer": "^10.4.15", "jest": "^29.7.0", "jest-preset-angular": "^13.1.2", + "ng-packagr": "^17.0.0", "postcss": "^8.4.28", "tailwindcss": "^3.3.3", "typescript": "~5.2.2" @@ -38,6 +39,9 @@ "preset": "jest-preset-angular", "setupFilesAfterEnv": [ "/setup-jest.ts" - ] + ], + "moduleNameMapper": { + "^flow": "/projects/flow/src/public-api.ts" + } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4e65497..c93300e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,7 +42,7 @@ dependencies: devDependencies: '@angular-devkit/build-angular': specifier: ^17.0.0 - version: 17.0.0(@angular/compiler-cli@17.0.2)(jest@29.7.0)(tailwindcss@3.3.3)(typescript@5.2.2) + version: 17.0.0(@angular/compiler-cli@17.0.2)(jest@29.7.0)(ng-packagr@17.0.0)(tailwindcss@3.3.3)(typescript@5.2.2) '@angular/cli': specifier: ~17.0.0 version: 17.0.0 @@ -61,6 +61,9 @@ devDependencies: jest-preset-angular: specifier: ^13.1.2 version: 13.1.2(@angular-devkit/build-angular@17.0.0)(@angular/compiler-cli@17.0.2)(@angular/core@17.0.2)(@angular/platform-browser-dynamic@17.0.2)(@babel/core@7.22.9)(jest@29.7.0)(typescript@5.2.2) + ng-packagr: + specifier: ^17.0.0 + version: 17.0.0(@angular/compiler-cli@17.0.2)(tailwindcss@3.3.3)(tslib@2.6.2)(typescript@5.2.2) postcss: specifier: ^8.4.28 version: 8.4.31 @@ -96,7 +99,7 @@ packages: - chokidar dev: true - /@angular-devkit/build-angular@17.0.0(@angular/compiler-cli@17.0.2)(jest@29.7.0)(tailwindcss@3.3.3)(typescript@5.2.2): + /@angular-devkit/build-angular@17.0.0(@angular/compiler-cli@17.0.2)(jest@29.7.0)(ng-packagr@17.0.0)(tailwindcss@3.3.3)(typescript@5.2.2): resolution: {integrity: sha512-hkV8k4moAnUquac2Dz5XPd5izDDgEF82NeUkSwizcTaqlJqYOdmWASMsXyVBzdrTmDtFKQiphfA96i7eo5MlvA==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} peerDependencies: @@ -173,6 +176,7 @@ packages: magic-string: 0.30.5 mini-css-extract-plugin: 2.7.6(webpack@5.89.0) mrmime: 1.0.1 + ng-packagr: 17.0.0(@angular/compiler-cli@17.0.2)(tailwindcss@3.3.3)(tslib@2.6.2)(typescript@5.2.2) open: 8.4.2 ora: 5.4.1 parse5-html-rewriting-stream: 7.0.0 @@ -2637,6 +2641,148 @@ packages: dev: true optional: true + /@rollup/plugin-json@6.0.1(rollup@4.4.1): + resolution: {integrity: sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.5(rollup@4.4.1) + rollup: 4.4.1 + dev: true + + /@rollup/plugin-node-resolve@15.2.3(rollup@4.4.1): + resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.5(rollup@4.4.1) + '@types/resolve': 1.20.2 + deepmerge: 4.3.1 + is-builtin-module: 3.2.1 + is-module: 1.0.0 + resolve: 1.22.8 + rollup: 4.4.1 + dev: true + + /@rollup/pluginutils@5.0.5(rollup@4.4.1): + resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.2 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 4.4.1 + dev: true + + /@rollup/rollup-android-arm-eabi@4.4.1: + resolution: {integrity: sha512-Ss4suS/sd+6xLRu+MLCkED2mUrAyqHmmvZB+zpzZ9Znn9S8wCkTQCJaQ8P8aHofnvG5L16u9MVnJjCqioPErwQ==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm64@4.4.1: + resolution: {integrity: sha512-sRSkGTvGsARwWd7TzC8LKRf8FiPn7257vd/edzmvG4RIr9x68KBN0/Ek48CkuUJ5Pj/Dp9vKWv6PEupjKWjTYA==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-arm64@4.4.1: + resolution: {integrity: sha512-nz0AiGrrXyaWpsmBXUGOBiRDU0wyfSXbFuF98pPvIO8O6auQsPG6riWsfQqmCCC5FNd8zKQ4JhgugRNAkBJ8mQ==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-x64@4.4.1: + resolution: {integrity: sha512-Ogqvf4/Ve/faMaiPRvzsJEqajbqs00LO+8vtrPBVvLgdw4wBg6ZDXdkDAZO+4MLnrc8mhGV6VJAzYScZdPLtJg==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf@4.4.1: + resolution: {integrity: sha512-9zc2tqlr6HfO+hx9+wktUlWTRdje7Ub15iJqKcqg5uJZ+iKqmd2CMxlgPpXi7+bU7bjfDIuvCvnGk7wewFEhCg==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-gnu@4.4.1: + resolution: {integrity: sha512-phLb1fN3rq2o1j1v+nKxXUTSJnAhzhU0hLrl7Qzb0fLpwkGMHDem+o6d+ZI8+/BlTXfMU4kVWGvy6g9k/B8L6Q==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-musl@4.4.1: + resolution: {integrity: sha512-M2sDtw4tf57VPSjbTAN/lz1doWUqO2CbQuX3L9K6GWIR5uw9j+ROKCvvUNBY8WUbMxwaoc8mH9HmmBKsLht7+w==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.4.1: + resolution: {integrity: sha512-mHIlRLX+hx+30cD6c4BaBOsSqdnCE4ok7/KDvjHYAHoSuveoMMxIisZFvcLhUnyZcPBXDGZTuBoalcuh43UfQQ==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-musl@4.4.1: + resolution: {integrity: sha512-tB+RZuDi3zxFx7vDrjTNGVLu2KNyzYv+UY8jz7e4TMEoAj7iEt8Qk6xVu6mo3pgjnsHj6jnq3uuRsHp97DLwOA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-arm64-msvc@4.4.1: + resolution: {integrity: sha512-Hdn39PzOQowK/HZzYpCuZdJC91PE6EaGbTe2VCA9oq2u18evkisQfws0Smh9QQGNNRa/T7MOuGNQoLeXhhE3PQ==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-ia32-msvc@4.4.1: + resolution: {integrity: sha512-tLpKb1Elm9fM8c5w3nl4N1eLTP4bCqTYw9tqUBxX8/hsxqHO3dxc2qPbZ9PNkdK4tg4iLEYn0pOUnVByRd2CbA==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-x64-msvc@4.4.1: + resolution: {integrity: sha512-eAhItDX9yQtZVM3yvXS/VR3qPqcnXvnLyx1pLXl4JzyNMBNO3KC986t/iAg2zcMzpAp9JSvxB5VZGnBiNoA98w==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@schematics/angular@17.0.0: resolution: {integrity: sha512-9jKU5x/WzaBsfSkUowK1X74FqtMXa6+A60XgW4ACO8i6fwKfPeS+tIrAieeYOX80/njBh7I5CvcpHmWA2SbcXQ==} engines: {node: ^18.13.0 || >=20.9.0, npm: ^6.11.0 || ^7.5.6 || >=8.0.0, yarn: '>= 1.13.0'} @@ -2893,6 +3039,10 @@ packages: resolution: {integrity: sha512-xrO9OoVPqFuYyR/loIHjnbvvyRZREYKLjxV4+dY6v3FQR3stQ9ZxIGkaclF7YhI9hfjpuTbu14hZEy94qKLtOA==} dev: true + /@types/resolve@1.20.2: + resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + dev: true + /@types/retry@0.12.0: resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} dev: true @@ -3636,6 +3786,11 @@ packages: ieee754: 1.2.1 dev: true + /builtin-modules@3.3.0: + resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} + engines: {node: '>=6'} + dev: true + /builtins@5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: @@ -3860,6 +4015,11 @@ packages: delayed-stream: 1.0.0 dev: true + /commander@11.1.0: + resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} + engines: {node: '>=16'} + dev: true + /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: true @@ -3873,6 +4033,10 @@ packages: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} dev: true + /commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + dev: true + /compressible@2.0.18: resolution: {integrity: sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==} engines: {node: '>= 0.6'} @@ -4103,6 +4267,10 @@ packages: cssom: 0.3.8 dev: true + /cuint@0.2.2: + resolution: {integrity: sha512-d4ZVpCW31eWwCMe1YT3ur7mUDnTXbgwyzaL320DrcRT45rfjYxkt5QWLrmOJ+/UEAI2+fQgKe/fCjR8l4TpRgw==} + dev: true + /data-urls@3.0.2: resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} engines: {node: '>=12'} @@ -4211,6 +4379,11 @@ packages: engines: {node: '>= 0.8'} dev: true + /dependency-graph@0.11.0: + resolution: {integrity: sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==} + engines: {node: '>= 0.6.0'} + dev: true + /destroy@1.0.4: resolution: {integrity: sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==} dev: true @@ -4576,6 +4749,10 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + dev: true + /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -4765,6 +4942,15 @@ packages: - supports-color dev: true + /find-cache-dir@3.3.2: + resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} + engines: {node: '>=8'} + dependencies: + commondir: 1.0.1 + make-dir: 3.1.0 + pkg-dir: 4.2.0 + dev: true + /find-cache-dir@4.0.0: resolution: {integrity: sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==} engines: {node: '>=14.16'} @@ -5273,6 +5459,12 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: true + /injection-js@2.4.0: + resolution: {integrity: sha512-6jiJt0tCAo9zjHbcwLiPL+IuNe9SQ6a9g0PEzafThW3fOQi0mrmiJGBJvDD6tmhPh8cQHIQtCOrJuBfQME4kPA==} + dependencies: + tslib: 2.6.2 + dev: true + /inquirer@9.2.11: resolution: {integrity: sha512-B2LafrnnhbRzCWfAdOXisUzL89Kg8cVJlYmhqoi3flSiV/TveO+nsXwgKr9h9PIo+J1hz7nBSk6gegRIMBBf7g==} engines: {node: '>=14.18.0'} @@ -5319,6 +5511,13 @@ packages: binary-extensions: 2.2.0 dev: true + /is-builtin-module@3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + dependencies: + builtin-modules: 3.3.0 + dev: true + /is-core-module@2.13.0: resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} dependencies: @@ -5362,6 +5561,10 @@ packages: resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==} dev: true + /is-module@1.0.0: + resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} + dev: true + /is-number-like@1.0.8: resolution: {integrity: sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==} dependencies: @@ -5764,7 +5967,7 @@ packages: jest: ^29.0.0 typescript: '>=4.4' dependencies: - '@angular-devkit/build-angular': 17.0.0(@angular/compiler-cli@17.0.2)(jest@29.7.0)(tailwindcss@3.3.3)(typescript@5.2.2) + '@angular-devkit/build-angular': 17.0.0(@angular/compiler-cli@17.0.2)(jest@29.7.0)(ng-packagr@17.0.0)(tailwindcss@3.3.3)(typescript@5.2.2) '@angular/compiler-cli': 17.0.2(@angular/compiler@17.0.2)(typescript@5.2.2) '@angular/core': 17.0.2(rxjs@7.8.1)(zone.js@0.14.2) '@angular/platform-browser-dynamic': 17.0.2(@angular/common@17.0.2)(@angular/compiler@17.0.2)(@angular/core@17.0.2)(@angular/platform-browser@17.0.2) @@ -5774,10 +5977,10 @@ packages: jest-environment-jsdom: 29.7.0 jest-util: 29.7.0 pretty-format: 29.7.0 - ts-jest: 29.1.1(@babel/core@7.22.9)(esbuild@0.18.17)(jest@29.7.0)(typescript@5.2.2) + ts-jest: 29.1.1(@babel/core@7.22.9)(esbuild@0.19.5)(jest@29.7.0)(typescript@5.2.2) typescript: 5.2.2 optionalDependencies: - esbuild: 0.18.17 + esbuild: 0.19.5 transitivePeerDependencies: - '@babel/core' - '@jest/types' @@ -6294,6 +6497,13 @@ packages: dev: true optional: true + /make-dir@3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.1 + dev: true + /make-dir@4.0.0: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} @@ -6391,6 +6601,12 @@ packages: hasBin: true dev: true + /mime@2.5.2: + resolution: {integrity: sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==} + engines: {node: '>=4.0.0'} + hasBin: true + dev: true + /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -6410,6 +6626,12 @@ packages: resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} dev: true + /minimatch@3.0.8: + resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} + dependencies: + brace-expansion: 1.1.11 + dev: true + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -6575,6 +6797,53 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true + /ng-packagr@17.0.0(@angular/compiler-cli@17.0.2)(tailwindcss@3.3.3)(tslib@2.6.2)(typescript@5.2.2): + resolution: {integrity: sha512-nNE4RkuyjDY3SFWCdFGhO/atvi81M1lrU99qdec0unQQTpgwlSpxpk7fwxlDSyIL5kJOBAUa+BJrctx1MA928Q==} + engines: {node: ^18.13.0 || >=20.9.0} + hasBin: true + peerDependencies: + '@angular/compiler-cli': ^17.0.0 || ^17.0.0-next.0 + tailwindcss: ^2.0.0 || ^3.0.0 + tslib: ^2.3.0 + typescript: '>=5.2 <5.3' + peerDependenciesMeta: + tailwindcss: + optional: true + dependencies: + '@angular/compiler-cli': 17.0.2(@angular/compiler@17.0.2)(typescript@5.2.2) + '@rollup/plugin-json': 6.0.1(rollup@4.4.1) + '@rollup/plugin-node-resolve': 15.2.3(rollup@4.4.1) + ajv: 8.12.0 + ansi-colors: 4.1.3 + autoprefixer: 10.4.16(postcss@8.4.31) + browserslist: 4.22.1 + cacache: 18.0.0 + chokidar: 3.5.3 + commander: 11.1.0 + convert-source-map: 2.0.0 + dependency-graph: 0.11.0 + esbuild-wasm: 0.19.5 + fast-glob: 3.3.1 + find-cache-dir: 3.3.2 + injection-js: 2.4.0 + jsonc-parser: 3.2.0 + less: 4.2.0 + ora: 5.4.1 + piscina: 4.1.0 + postcss: 8.4.31 + postcss-url: 10.1.3(postcss@8.4.31) + rollup: 4.4.1 + rxjs: 7.8.1 + sass: 1.69.5 + tailwindcss: 3.3.3 + tslib: 2.6.2 + typescript: 5.2.2 + optionalDependencies: + esbuild: 0.19.5 + transitivePeerDependencies: + - supports-color + dev: true + /nice-napi@1.0.2: resolution: {integrity: sha512-px/KnJAJZf5RuBGcfD+Sp2pAKq0ytz8j+1NehvgIGFkvtvFrDM3T8E4x/JJODXK9WZow8RRGrbA9QQ3hs+pDhA==} os: ['!win32'] @@ -7178,6 +7447,19 @@ packages: util-deprecate: 1.0.2 dev: true + /postcss-url@10.1.3(postcss@8.4.31): + resolution: {integrity: sha512-FUzyxfI5l2tKmXdYc6VTu3TWZsInayEKPbiyW+P6vmmIrrb4I6CGX0BFoewgYHLK+oIL5FECEK02REYRpBvUCw==} + engines: {node: '>=10'} + peerDependencies: + postcss: ^8.0.0 + dependencies: + make-dir: 3.1.0 + mime: 2.5.2 + minimatch: 3.0.8 + postcss: 8.4.31 + xxhashjs: 0.2.2 + dev: true + /postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: true @@ -7510,6 +7792,26 @@ packages: fsevents: 2.3.3 dev: true + /rollup@4.4.1: + resolution: {integrity: sha512-idZzrUpWSblPJX66i+GzrpjKE3vbYrlWirUHteoAbjKReZwa0cohAErOYA5efoMmNCdvG9yrJS+w9Kl6csaH4w==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.4.1 + '@rollup/rollup-android-arm64': 4.4.1 + '@rollup/rollup-darwin-arm64': 4.4.1 + '@rollup/rollup-darwin-x64': 4.4.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.4.1 + '@rollup/rollup-linux-arm64-gnu': 4.4.1 + '@rollup/rollup-linux-arm64-musl': 4.4.1 + '@rollup/rollup-linux-x64-gnu': 4.4.1 + '@rollup/rollup-linux-x64-musl': 4.4.1 + '@rollup/rollup-win32-arm64-msvc': 4.4.1 + '@rollup/rollup-win32-ia32-msvc': 4.4.1 + '@rollup/rollup-win32-x64-msvc': 4.4.1 + fsevents: 2.3.3 + dev: true + /run-async@3.0.0: resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} engines: {node: '>=0.12.0'} @@ -8306,7 +8608,7 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest@29.1.1(@babel/core@7.22.9)(esbuild@0.18.17)(jest@29.7.0)(typescript@5.2.2): + /ts-jest@29.1.1(@babel/core@7.22.9)(esbuild@0.19.5)(jest@29.7.0)(typescript@5.2.2): resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -8329,7 +8631,7 @@ packages: dependencies: '@babel/core': 7.22.9 bs-logger: 0.2.6 - esbuild: 0.18.17 + esbuild: 0.19.5 fast-json-stable-stringify: 2.1.0 jest: 29.7.0 jest-util: 29.7.0 @@ -8875,6 +9177,12 @@ packages: engines: {node: '>=0.4.0'} dev: true + /xxhashjs@0.2.2: + resolution: {integrity: sha512-AkTuIuVTET12tpsVIQo+ZU6f/qDmKuRUcjaqR+OIvm+aCBsZ95i7UVY5WJ9TMsSaZ0DA2WxoZ4acu0sPH+OKAw==} + dependencies: + cuint: 0.2.2 + dev: true + /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} diff --git a/projects/flow/README.md b/projects/flow/README.md new file mode 100644 index 0000000..f26ddfe --- /dev/null +++ b/projects/flow/README.md @@ -0,0 +1,24 @@ +# Flow + +This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.0. + +## Code scaffolding + +Run `ng generate component component-name --project flow` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project flow`. +> Note: Don't forget to add `--project flow` or else it will be added to the default project in your `angular.json` file. + +## Build + +Run `ng build flow` to build the project. The build artifacts will be stored in the `dist/` directory. + +## Publishing + +After building your library with `ng build flow`, go to the dist folder `cd dist/flow` and run `npm publish`. + +## Running unit tests + +Run `ng test flow` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. diff --git a/projects/flow/ng-package.json b/projects/flow/ng-package.json new file mode 100644 index 0000000..059aca8 --- /dev/null +++ b/projects/flow/ng-package.json @@ -0,0 +1,7 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/flow", + "lib": { + "entryFile": "src/public-api.ts" + } +} \ No newline at end of file diff --git a/projects/flow/package.json b/projects/flow/package.json new file mode 100644 index 0000000..912dad5 --- /dev/null +++ b/projects/flow/package.json @@ -0,0 +1,12 @@ +{ + "name": "flow", + "version": "0.0.1", + "peerDependencies": { + "@angular/common": "^17.0.0", + "@angular/core": "^17.0.0" + }, + "dependencies": { + "tslib": "^2.3.0" + }, + "sideEffects": false +} diff --git a/src/app/flow/arrangements.spec.ts b/projects/flow/src/lib/arrangements.spec.ts similarity index 96% rename from src/app/flow/arrangements.spec.ts rename to projects/flow/src/lib/arrangements.spec.ts index a860703..22a3a0f 100644 --- a/src/app/flow/arrangements.spec.ts +++ b/projects/flow/src/lib/arrangements.spec.ts @@ -1,5 +1,5 @@ import { Arrangements } from './arrangements'; -import { ChildInfo } from './connections'; +import { ChildInfo } from './flow-interface'; export const FLOW_LIST = [ { x: 40, y: 40, id: '1', deps: [] }, diff --git a/src/app/flow/arrangements.ts b/projects/flow/src/lib/arrangements.ts similarity index 97% rename from src/app/flow/arrangements.ts rename to projects/flow/src/lib/arrangements.ts index 059a3f4..ce0ff0b 100644 --- a/src/app/flow/arrangements.ts +++ b/projects/flow/src/lib/arrangements.ts @@ -1,5 +1,4 @@ -import { FlowOptions } from './flow-interface'; -import { ChildInfo } from './connections'; +import { FlowOptions, ChildInfo } from './flow-interface'; export class Arrangements { constructor( diff --git a/src/app/flow/connections.spec.ts b/projects/flow/src/lib/connections.spec.ts similarity index 96% rename from src/app/flow/connections.spec.ts rename to projects/flow/src/lib/connections.spec.ts index 6bbe288..20835d6 100644 --- a/src/app/flow/connections.spec.ts +++ b/projects/flow/src/lib/connections.spec.ts @@ -1,5 +1,5 @@ -import { FlowOptions } from './flow-interface'; -import { ChildInfo, Connections } from './connections'; +import { FlowOptions, ChildInfo } from './flow-interface'; +import { Connections } from './connections'; describe('Connections', () => { let connections: Connections; diff --git a/src/app/flow/connections.ts b/projects/flow/src/lib/connections.ts similarity index 96% rename from src/app/flow/connections.ts rename to projects/flow/src/lib/connections.ts index d831512..52111ef 100644 --- a/src/app/flow/connections.ts +++ b/projects/flow/src/lib/connections.ts @@ -1,4 +1,4 @@ -import { FlowOptions } from './flow-interface'; +import { ChildInfo, FlowOptions } from './flow-interface'; import { FlowChildComponent } from './flow-child.component'; export class Connections { @@ -163,10 +163,3 @@ export class Connections { }); } } - -export interface ChildInfo { - position: FlowOptions; - dots?: DOMRect[]; - el?: HTMLElement; - elRect: DOMRect; -} diff --git a/src/app/flow/fit-to-window.spec.ts b/projects/flow/src/lib/fit-to-window.spec.ts similarity index 100% rename from src/app/flow/fit-to-window.spec.ts rename to projects/flow/src/lib/fit-to-window.spec.ts diff --git a/src/app/flow/fit-to-window.ts b/projects/flow/src/lib/fit-to-window.ts similarity index 98% rename from src/app/flow/fit-to-window.ts rename to projects/flow/src/lib/fit-to-window.ts index 1353f19..abf87fe 100644 --- a/src/app/flow/fit-to-window.ts +++ b/projects/flow/src/lib/fit-to-window.ts @@ -1,4 +1,4 @@ -import { ChildInfo } from './connections'; +import { ChildInfo } from './flow-interface'; export class FitToWindow { cRect: CPosition; diff --git a/src/app/flow/flow-child.component.spec.ts b/projects/flow/src/lib/flow-child.component.spec.ts similarity index 100% rename from src/app/flow/flow-child.component.spec.ts rename to projects/flow/src/lib/flow-child.component.spec.ts diff --git a/src/app/flow/flow-child.component.ts b/projects/flow/src/lib/flow-child.component.ts similarity index 100% rename from src/app/flow/flow-child.component.ts rename to projects/flow/src/lib/flow-child.component.ts diff --git a/projects/flow/src/lib/flow-interface.ts b/projects/flow/src/lib/flow-interface.ts new file mode 100644 index 0000000..d4cd0a1 --- /dev/null +++ b/projects/flow/src/lib/flow-interface.ts @@ -0,0 +1,13 @@ +export interface ChildInfo { + position: FlowOptions; + dots?: DOMRect[]; + el?: HTMLElement; + elRect: DOMRect; +} + +export interface FlowOptions { + x: number; + y: number; + id: string; + deps: string[]; +} diff --git a/src/app/flow/flow.component.spec.ts b/projects/flow/src/lib/flow.component.spec.ts similarity index 100% rename from src/app/flow/flow.component.spec.ts rename to projects/flow/src/lib/flow.component.spec.ts diff --git a/src/app/flow/flow.component.ts b/projects/flow/src/lib/flow.component.ts similarity index 99% rename from src/app/flow/flow.component.ts rename to projects/flow/src/lib/flow.component.ts index 9d33e31..0458d4d 100644 --- a/src/app/flow/flow.component.ts +++ b/projects/flow/src/lib/flow.component.ts @@ -12,10 +12,10 @@ import { } from '@angular/core'; import { startWith } from 'rxjs'; import { Arrangements } from './arrangements'; -import { ChildInfo, Connections } from './connections'; +import { Connections } from './connections'; import { FlowChildComponent } from './flow-child.component'; import { FlowService } from './flow.service'; -import { FlowOptions } from './flow-interface'; +import { FlowOptions, ChildInfo } from './flow-interface'; import { SvgHandler } from './svg'; import { FitToWindow } from './fit-to-window'; diff --git a/src/app/flow/flow.service.spec.ts b/projects/flow/src/lib/flow.service.spec.ts similarity index 100% rename from src/app/flow/flow.service.spec.ts rename to projects/flow/src/lib/flow.service.spec.ts diff --git a/src/app/flow/flow.service.ts b/projects/flow/src/lib/flow.service.ts similarity index 100% rename from src/app/flow/flow.service.ts rename to projects/flow/src/lib/flow.service.ts diff --git a/src/app/flow/svg.spec.ts b/projects/flow/src/lib/svg.spec.ts similarity index 100% rename from src/app/flow/svg.spec.ts rename to projects/flow/src/lib/svg.spec.ts diff --git a/src/app/flow/svg.ts b/projects/flow/src/lib/svg.ts similarity index 100% rename from src/app/flow/svg.ts rename to projects/flow/src/lib/svg.ts diff --git a/projects/flow/src/public-api.ts b/projects/flow/src/public-api.ts new file mode 100644 index 0000000..7ab20f0 --- /dev/null +++ b/projects/flow/src/public-api.ts @@ -0,0 +1,8 @@ +/* + * Public API Surface of flow + */ + +export * from './lib/flow.service'; +export * from './lib/flow.component'; +export * from './lib/flow-child.component'; +export * from './lib/flow-interface'; diff --git a/projects/flow/tsconfig.lib.json b/projects/flow/tsconfig.lib.json new file mode 100644 index 0000000..543fd47 --- /dev/null +++ b/projects/flow/tsconfig.lib.json @@ -0,0 +1,14 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/lib", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": [ + "**/*.spec.ts" + ] +} diff --git a/projects/flow/tsconfig.lib.prod.json b/projects/flow/tsconfig.lib.prod.json new file mode 100644 index 0000000..06de549 --- /dev/null +++ b/projects/flow/tsconfig.lib.prod.json @@ -0,0 +1,10 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, + "angularCompilerOptions": { + "compilationMode": "partial" + } +} diff --git a/projects/flow/tsconfig.spec.json b/projects/flow/tsconfig.spec.json new file mode 100644 index 0000000..ce7048b --- /dev/null +++ b/projects/flow/tsconfig.spec.json @@ -0,0 +1,14 @@ +/* To learn more about this file see: https://angular.io/config/tsconfig. */ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "types": [ + "jasmine" + ] + }, + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 5edd0cd..12572fb 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,10 +1,8 @@ -import { Component, ViewChild, inject } from '@angular/core'; +import { Component, ViewChild } from '@angular/core'; import { NgForOf } from '@angular/common'; import { RouterOutlet } from '@angular/router'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; -import { FlowChildComponent } from './flow/flow-child.component'; -import { FlowComponent } from './flow/flow.component'; -import { FlowOptions } from './flow/flow-interface'; +import { FlowComponent, FlowChildComponent, FlowOptions } from 'flow'; @Component({ selector: 'app-root', diff --git a/src/app/flow/flow-interface.ts b/src/app/flow/flow-interface.ts deleted file mode 100644 index d716769..0000000 --- a/src/app/flow/flow-interface.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface FlowOptions { - x: number; - y: number; - id: string; - deps: string[]; -} diff --git a/tsconfig.json b/tsconfig.json index 2dbf880..6b68070 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,9 @@ "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitOverride": true, + "paths": { + "flow": ["./projects/flow/src/public-api.ts"] + }, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true,