Skip to content

Commit

Permalink
Merge branch 'update-deps' of https://github.com/aiao-io/aiao into up…
Browse files Browse the repository at this point in the history
…date-deps
  • Loading branch information
Jimmysh committed Dec 6, 2021
2 parents ce1fd55 + ba718e4 commit 4a7454d
Show file tree
Hide file tree
Showing 28 changed files with 1,976 additions and 2,673 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ orbs:
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:14-browsers
- image: circleci/node:16-browsers
environment:
NODE_OPTIONS: --max_old_space_size=4000

withDatabase: &withDatabase
working_directory: ~/repo
docker:
- image: circleci/node:14-browsers
- image: circleci/node:16-browsers
environment:
NODE_OPTIONS: --max_old_space_size=4000
- image: circleci/postgres:12-alpine-postgis
Expand Down Expand Up @@ -152,20 +152,20 @@ format_check: &format_check
# lint
lint: &lint
name: Lint
command: ./node_modules/.bin/nx workspace-lint && yarn affected:lint ${AFFECTED_ARGS} --skip-nx-cache
command: ./node_modules/.bin/nx workspace-lint && yarn affected:lint ${AFFECTED_ARGS}

affected_test: &affected_test
name: Afected test
command: yarn affected:test ${AFFECTED_ARGS} --ci --code-coverage --skip-nx-cache
command: yarn affected:test ${AFFECTED_ARGS} --ci --code-coverage --maxParallel=1

affected_build: &affected_build
name: Affected build
command: yarn affected:build ${AFFECTED_ARGS} --configuration production --skip-nx-cache
command: yarn affected:build ${AFFECTED_ARGS} --configuration production

# e2e
affected_e2e: &affected_e2e
name: Affected e2e
command: yarn affected:e2e ${AFFECTED_ARGS} --configuration production -- --headless --skip-nx-cache
command: yarn affected:e2e ${AFFECTED_ARGS} --configuration production -- --headless

update_deploy: &update_deploy
name: Update Deploy
Expand Down
4 changes: 4 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
# yarn lockfile v1

registry "https://registry.yarnpkg.com"

link-duplicates true
ignore-optional true
ignore-platform true
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import { HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'
import { Inject, Injectable, Optional } from '@angular/core';

import type { Logger } from '@nestjs/common';
import type { FastifyRequest } from 'fastify';

@Injectable()
export class UniversalInterceptorService implements HttpInterceptor {
constructor(
@Optional() @Inject('serverUrl') protected serverUrl: string,
@Optional() @Inject('Logger') protected logger: Logger
@Optional() @Inject('UNIVERSAL_SERVER_URL_TOKEN') protected serverUrl: string,
@Optional() @Inject('UNIVERSAL_SERVER_LOGGER_TOKEN') protected logger: Logger,
@Optional() @Inject('UNIVERSAL_SERVER_REQUEST_TOKEN') protected request: FastifyRequest
) {
logger.log(serverUrl, 'UniversalInterceptorService');
console.log('req.headers', request.headers);
console.log('serverUrl', serverUrl);
}

intercept(req: HttpRequest<any>, next: HttpHandler) {
Expand Down
2 changes: 1 addition & 1 deletion libs/color/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "cd ../../ && yarn build color"
},
"peerDependencies": {
"@aiao/util": "^1.0.1"
"@aiao/util": "^1.0.2"
},
"devDependencies": {
"@aiao/util": "^1.0.2"
Expand Down
2 changes: 1 addition & 1 deletion libs/date/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "cd ../../ && yarn build date --prod"
},
"peerDependencies": {
"@aiao/util": "^1.0.1"
"@aiao/util": "^1.0.2"
},
"dependencies": {
"tslib": "^2.0.0"
Expand Down
4 changes: 2 additions & 2 deletions libs/elements-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"@angular/common": "^12.2.9",
"@angular/core": "^12.2.9",
"@angular/forms": "^12.2.9",
"rxjs": "~6.5.5"
"rxjs": "~7.4.0"
},
"devDependencies": {
"@aiao/elements": "^0.7.2",
"@aiao/elements": "^0.7.4",
"@aiao/elements-cdk": "^0.1.6"
}
}
5 changes: 3 additions & 2 deletions libs/elements-cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"peerDependencies": {
"@angular/core": "^12.2.9",
"@angular/forms": "^12.2.9",
"rxjs": "~6.5.5"
}
"rxjs": "~7.4.0"
},
"devDependencies": {}
}
2 changes: 1 addition & 1 deletion libs/elements-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "cd ../../ && yarn build elements-react --prod"
},
"peerDependencies": {
"@aiao/elements": "^0.7.2"
"@aiao/elements": "^0.7.4"
},
"devDependencies": {
"@aiao/elements": "^0.7.4"
Expand Down
9 changes: 8 additions & 1 deletion libs/elements-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"name": "@aiao/elements-vue",
"version": "0.0.2"
"version": "0.0.2",
"peerDependencies": {
"@aiao/elements": "^0.7.4",
"vue": "^3.2.11"
},
"devDependencies": {
"@aiao/elements": "^0.7.4"
}
}
12 changes: 6 additions & 6 deletions libs/elements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
"tslib": "^2.0.0"
},
"devDependencies": {
"@aiao/elements-cdk": "^0.1.5",
"@aiao/elements-cdk": "^0.1.6",
"@aiao/image-storage": "^0.1.4",
"@aiao/url": "^0.0.6",
"@aiao/url": "^0.0.7",
"@aiao/util": "^1.0.2"
},
"peerDependencies": {
"@aiao/elements-cdk": "^0.1.5",
"@aiao/image-storage": "^0.1.3",
"@aiao/url": "^0.0.6",
"@aiao/util": "^1.0.1",
"@aiao/elements-cdk": "^0.1.6",
"@aiao/image-storage": "^0.1.4",
"@aiao/url": "^0.0.7",
"@aiao/util": "^1.0.2",
"lodash": "^4.17.15"
}
}
4 changes: 3 additions & 1 deletion libs/image-storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
},
"dependencies": {
"tslib": "^2.0.0"
}
},
"peerDependencies": {},
"devDependencies": {}
}
2 changes: 1 addition & 1 deletion libs/lazy-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"build": "cd ../../ && yarn build lazy-component --prod"
},
"peerDependencies": {
"@aiao/lazy-module": "^1.4.2",
"@aiao/lazy-module": "^1.4.3",
"@angular/core": "^12.2.9"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions libs/lazy-element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"build": "cd ../../ && yarn build lazy-element --prod"
},
"peerDependencies": {
"@aiao/lazy-module": "^1.4.2",
"@aiao/lazy-module": "^1.4.3",
"@angular/core": "^12.2.9",
"@angular/elements": "^12.2.9",
"rxjs": "~6.5.5"
"rxjs": "~7.4.0"
},
"devDependencies": {
"@aiao/lazy-module": "^1.4.3"
Expand Down
3 changes: 2 additions & 1 deletion libs/lazy-module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
},
"dependencies": {
"tslib": "^2.0.0"
}
},
"devDependencies": {}
}
4 changes: 3 additions & 1 deletion libs/leancloud-hash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@
},
"dependencies": {
"tslib": "^2.0.0"
}
},
"peerDependencies": {},
"devDependencies": {}
}
10 changes: 4 additions & 6 deletions libs/nest-angular-universal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aiao/nest-angular-universal",
"version": "0.2.1",
"version": "0.2.2",
"description": "angular universal for nest",
"homepage": "https://github.com/aiao-io/aiao",
"author": "Jimmy<hero63418@gmail.com>",
Expand All @@ -26,15 +26,13 @@
"tslib": "^2.0.0"
},
"peerDependencies": {
"@aiao/universal-fastify-engine": "^1.0.2",
"@aiao/universal-fastify-engine": "^1.2.2",
"@nestjs/common": "^8.0.4",
"@nestjs/core": "^8.0.4",
"@nguniversal/common": "^12.0.0",
"fastify": "^3.22.0",
"fastify-static": "^4.0.0",
"reflect-metadata": "^0.1.13"
"fastify-static": "^4.0.0"
},
"devDependencies": {
"@aiao/universal-fastify-engine": "^1.1.1"
"@aiao/universal-fastify-engine": "^1.2.2"
}
}
3 changes: 1 addition & 2 deletions libs/nest-typeorm-plus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
"build": "cd ../../ && yarn build nest-typeorm-plus --prod"
},
"peerDependencies": {
"@aiao/typeorm-plus": "^0.1.3",
"@aiao/typeorm-plus": "^0.2.0",
"@nestjs/common": "^8.0.4",
"@nestjs/typeorm": "^8.0.1",
"lodash": "^4.17.15",
"typeorm": "^0.2.22"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion libs/random/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "cd ../../ && yarn build random --prod"
},
"peerDependencies": {
"@aiao/util": "^1.0.1"
"@aiao/util": "^1.0.2"
},
"dependencies": {
"tslib": "^2.0.0"
Expand Down
5 changes: 3 additions & 2 deletions libs/stencil-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"@angular-devkit/architect": "^12.0.0",
"@angular-devkit/core": "^12.0.0",
"@angular-devkit/schematics": "^12.0.0",
"rxjs": "~6.5.5"
}
"rxjs": "~7.4.0"
},
"devDependencies": {}
}
3 changes: 2 additions & 1 deletion libs/typeorm-plus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
},
"dependencies": {
"tslib": "^2.0.0"
}
},
"devDependencies": {}
}
6 changes: 4 additions & 2 deletions libs/universal-fastify-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aiao/universal-fastify-engine",
"version": "1.1.1",
"version": "1.2.3",
"description": " universal fastify engine",
"homepage": "https://github.com/aiao-io/aiao",
"author": "Jimmy<hero63418@gmail.com>",
Expand All @@ -25,11 +25,13 @@
},
"peerDependencies": {
"@angular/core": "^12.2.9",
"@nestjs/common": "^8.0.4",
"@nguniversal/common": "^12.0.0",
"fastify": "^3.22.0",
"fastify-plugin": "^3.0.0"
},
"dependencies": {
"tslib": "^2.0.0"
}
},
"devDependencies": {}
}
10 changes: 8 additions & 2 deletions libs/universal-fastify-engine/src/lib/get-document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ export function getDocument(path: string): string | undefined {
if (templateCacheMap.has(path)) {
return templateCacheMap.get(path);
}
const indexOriginal = join(path, 'index.original.html');
const index = join(path, 'index.html');

// path 支持路径和直接 html
let indexOriginal = path;
let index = path;
if (!path.endsWith('.html')) {
indexOriginal = join(path, 'index.original.html');
index = join(path, 'index.html');
}

let file!: string;
if (existsSync(indexOriginal)) {
Expand Down
3 changes: 3 additions & 0 deletions libs/universal-fastify-engine/src/lib/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ declare module 'fastify' {
renderAngular: (opts?: RenderOptions) => Promise<string>;
}
}
export const SERVER_URL_TOKEN = 'UNIVERSAL_SERVER_URL_TOKEN';
export const SERVER_LOGGER_TOKEN = 'UNIVERSAL_SERVER_LOGGER_TOKEN';
export const SERVER_REQUEST_TOKEN = 'UNIVERSAL_SERVER_REQUEST_TOKEN';
20 changes: 15 additions & 5 deletions libs/universal-fastify-engine/src/lib/render-angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import { Logger } from '@nestjs/common';
import { CommonEngine, RenderOptions as NgRenderOptions } from '@nguniversal/common/engine';

import { getDocument } from './get-document';
import { NgSetupOptions, RenderOptions } from './interface';
import {
NgSetupOptions,
RenderOptions,
SERVER_LOGGER_TOKEN,
SERVER_REQUEST_TOKEN,
SERVER_URL_TOKEN
} from './interface';

const findOpts = (url: string, options: NgSetupOptions[]) => {
const back = options[0];
Expand All @@ -15,7 +21,7 @@ const findOpts = (url: string, options: NgSetupOptions[]) => {
return back;
};

const engineMap = new Map<any, any>();
const engineMap = new Map<any, CommonEngine>();

export const renderAngular = (
setupOptions: NgSetupOptions | NgSetupOptions[],
Expand All @@ -31,7 +37,7 @@ export const renderAngular = (
}

const { bootstrap, outputPath, document, documentFilePath, providers: defaultProviders } = needOpts;
let engine: CommonEngine = engineMap.get(bootstrap);
let engine = engineMap.get(bootstrap);
if (!engine) {
engine = new CommonEngine(bootstrap);
engineMap.set(bootstrap, engine);
Expand All @@ -55,12 +61,16 @@ export const renderAngular = (
providers: [
...providers,
{
provide: 'serverUrl',
provide: SERVER_URL_TOKEN,
useValue: serverUrl
},
{
provide: 'Logger',
provide: SERVER_LOGGER_TOKEN,
useValue: Logger
},
{
provide: SERVER_REQUEST_TOKEN,
useValue: request
}
]
};
Expand Down
2 changes: 1 addition & 1 deletion libs/url/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "cd ../../ && yarn build url --prod"
},
"peerDependencies": {
"@aiao/util": "^1.0.1"
"@aiao/util": "^1.0.2"
},
"dependencies": {
"tslib": "^2.0.0"
Expand Down
3 changes: 2 additions & 1 deletion libs/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
},
"dependencies": {
"tslib": "^2.0.0"
}
},
"devDependencies": {}
}
Loading

0 comments on commit 4a7454d

Please sign in to comment.