Skip to content

Commit ca35036

Browse files
GuzmanPIjorgeucanoHeroDevs
authored
feat(scully): logrocket render plugin. (#680)
* feat(scully): Add logrocket render plugin. Fixes tests adds dummy app and id * feat(Scully/publish/plugins): add support for logrocket Add keys for logrocket fix issue undefined values in getMyConfig add prod option for support into scully config change web publisher for publish with logrocket * update test for logrocket * test(lib): add test for LogRocket * fix(docsWeb): fix typo UTF-8 * fix(monorepo): remove jasmine dependencies * fix snapshot * fix(test-jest): update expect import * add tslib * change test for md * change test for md * update test Co-authored-by: jorgeucano <jorgeucano@gmail.com> Co-authored-by: HeroDevs <herodevs@freddie.lan>
1 parent 36e6c37 commit ca35036

27 files changed

Lines changed: 405 additions & 198 deletions

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- run: npm install
1818
- run: npm run symlinks
1919
- run: npx nx run-many --target=build --all --prod
20-
- run: node ./dist/libs/scully/scully --project scully-docs --RSD --scan --404=baseOnly
20+
- run: node ./dist/libs/scully/scully --project scully-docs --RSD --scan --404=baseOnly --prod
2121
- uses: w9jds/firebase-action@master
2222
with:
2323
args: deploy --project scullyio --only hosting

docs/scully_es.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
title: Introducción
33
order: 110
44
lang: es
5-
slug: Introducción
5+
slug: introduccion
66
---
77

88
# Introducción (Alfa)
99

1010
## ¿Qué es Scully?
1111

12-
**Scully** el mejor generador de sitios estáticos para proyectos de Angular buscando adoptar JAMStack.
12+
**Scully** el mejor generador de sitios estáticos para proyectos de Angular buscando adoptar JAMStack.
1313

1414
### ¿Cómo funciona?
1515

@@ -43,4 +43,4 @@ Scully [Horas de Oficina](https://meet.google.com/vcm-wekz-hsx?authuser=1) todos
4343

4444
El equipo aprecia su retroalimentación y nos gustaría conocer cómo está usando Scully en convinación con otras herramientas.
4545

46-
¿Le gustaría compartir su experiencia con la comunidad? Por favor vea nuestra guía de [CONTRIBUCIÓN](../CONTRIBUTING.md).
46+
¿Le gustaría compartir su experiencia con la comunidad? Por favor vea nuestra guía de [CONTRIBUCIÓN](../CONTRIBUTING.md).

libs/plugins/logrocket/.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "extends": "../../../.eslintrc", "rules": {}, "ignorePatterns": ["!**/*"] }

libs/plugins/logrocket/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# plugins-logrocket
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `ng test plugins-logrocket` to execute the unit tests via [Jest](https://jestjs.io).
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
name: 'plugins-logrocket',
3+
preset: '../../../jest.config.js',
4+
transform: {
5+
'^.+\\.[tj]sx?$': 'ts-jest',
6+
},
7+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'],
8+
coverageDirectory: '../../../coverage/libs/plugins/logrocket',
9+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@scullyio/plugins-logrocket",
3+
"version": "0.0.1",
4+
"author": "Israel Guzman",
5+
"repository": {
6+
"type": "GIT",
7+
"url": "https://github.com/scullyio/scully/tree/main/libs/plugins/logrocket"
8+
},
9+
"license": "MIT",
10+
"dependencies": {
11+
"tslib": "^1.13.0"
12+
}
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/plugins-logrocket';
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { registerPlugin, getPluginConfig } from '@scullyio/scully';
2+
3+
export const LogRocket = 'logrocket';
4+
5+
export const logrocketPlugin = async (html: string): Promise<string> => {
6+
const logrocketConfig = getPluginConfig(LogRocket);
7+
8+
if (!logrocketConfig) {
9+
throw new Error('logrocket plugin missing configuration');
10+
}
11+
12+
const logrocketScript = `
13+
<script src="https://cdn.logrocket.io/LogRocket.min.js"></script>
14+
<script>window.LogRocket && window.LogRocket.init('${logrocketConfig['app']}/${logrocketConfig['id']}');</script>`;
15+
16+
return html.replace(/<\/head/i, `${logrocketScript}</head`);
17+
};
18+
19+
const validator = async () => [];
20+
21+
registerPlugin('render', LogRocket, logrocketPlugin, validator);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../../../tsconfig.json",
3+
"compilerOptions": {
4+
"types": ["node", "jest"]
5+
},
6+
"include": ["**/*.ts"]
7+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"outDir": "../../../dist/out-tsc",
6+
"declaration": true,
7+
"rootDir": "./src",
8+
"types": ["node"]
9+
},
10+
"exclude": ["**/*.spec.ts"],
11+
"include": ["**/*.ts"]
12+
}

0 commit comments

Comments
 (0)