Skip to content

Commit

Permalink
Update xrun (#2013)
Browse files Browse the repository at this point in the history
* fix: add  scss sample subapp v2

* fix(subappv2): resolve babel runtime dependency

* fix(subappv2): resolve babel runtime dependency

* fix(subappv2): resolve test case failure issue

* fix(subappv2): resolve test case failure issue

* chore: update changelog

* fix(CEECORE-4406): replace request with axios

* fix(snyk): replace request package with node-fetch in subapp-web

* fix(snyk): replace request package with node-fetch in subapp-web

* fix(chore): update changelog

* fix(deprecated): remove electrode-react-webapp package

* fix(peer-dependencies): added react-router-dom as peerDependencies

* fix(changelog): added change log

* fix(jsdom): downgrade jsdom to v21 to work for backward node compatibility

* fix(update): replace xclap to xrun

* fix(update): replace xclap to xrun

* fix(lint): add lint command

* fix(lint): add lint command

* fix(lint): add lint command

* fix(lint): add lint command

* fix(lint): add lint command

* fix(lint): move tslib to dev dependency

* fix(lint): move tslib to dev dependency

* fix(lint): move tslib to dev dependency

---------

Co-authored-by: Shubham sharma <[email protected]>
  • Loading branch information
shubham2811 and Shubham sharma authored May 29, 2024
1 parent 7be7ef8 commit f6e36ce
Show file tree
Hide file tree
Showing 9 changed files with 1,188 additions and 2,552 deletions.
10 changes: 10 additions & 0 deletions common/changes/@xarc/index-page/update-xrun_2024-05-28-15-25.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@xarc/index-page",
"comment": "add lint inside script",
"type": "none"
}
],
"packageName": "@xarc/index-page"
}
10 changes: 10 additions & 0 deletions common/changes/subapp-react/update-xrun_2024-05-28-15-25.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "subapp-react",
"comment": "no change",
"type": "none"
}
],
"packageName": "subapp-react"
}
3,658 changes: 1,130 additions & 2,528 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/subapp-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
"trailingComma": "none",
"arrowParens": "avoid"
}
}
}
5 changes: 5 additions & 0 deletions packages/xarc-index-page/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const { eslintRcTestTypeScript } = require("@xarc/module-dev");
module.exports = {
extends: eslintRcTestTypeScript,
parser: "@typescript-eslint/parser",
};
23 changes: 17 additions & 6 deletions packages/xarc-index-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"scripts": {
"build": "xrun user/build",
"test": "xrun xarc/test-only",
"lint": "xrun xarc/lint",
"coverage": "xrun xarc/test-cov",
"check": "xrun xarc/check",
"prepublishOnly": "xrun [[build, docs], xarc/check]",
"prepublishOnly": "xrun --serial [[build, docs], xarc/check]",
"docs": "xrun xarc/docs"
},
"repository": {
Expand Down Expand Up @@ -36,19 +37,21 @@
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@types/chai": "^4.3.16",
"@types/mocha": "^10.0.6",
"@types/node": "^20.12.11",
"@types/node": "^20.12.12",
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^3.2.12",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"@xarc/module-dev": "^5.0.0",
"@xarc/run": "^1.1.1",
"babel-eslint": "^10.1.0",
"chai": "^4.2.0",
"eslint": "^9.3.0",
"eslint": "^8.52.0",
"eslint-config-walmart": "^2.2.1",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-jsdoc": "^30.3.0",
"eslint-plugin-jsdoc": "^48.2.6",
"mocha": "^10.4.0",
"tslib": "^2.6.2",
"nyc": "^15.1.0",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0",
Expand Down Expand Up @@ -96,5 +99,13 @@
"@xarc/module-dev/config/test/setup.js"
],
"recursive": true
},
"@xarc/module-dev": {
"features": [
"eslint",
"mocha",
"typedoc",
"typescript"
]
}
}
20 changes: 11 additions & 9 deletions packages/xarc-index-page/test/fixtures/react-helmet-handler.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
"use strict";

const Helmet = require("react-helmet").Helmet;
import { Helmet } from "react-helmet";

const emptyTitleRegex = /<title[^>]*><\/title>/;

module.exports = handlerContext => {
module.exports = (handlerContext) => {
const routeOptions = handlerContext.user.routeOptions;
const iconStats = handlerContext.user.routeData.iconStats;

return {
HEAD_INITIALIZE: context => {
HEAD_INITIALIZE: (context) => {
context.user.helmet = Helmet.renderStatic();
},

PAGE_TITLE: context => {
PAGE_TITLE: (context) => {
const helmet = context.user.helmet;
const helmetTitleScript = helmet.title.toString();
const helmetTitleEmpty = helmetTitleScript.match(emptyTitleRegex);

return helmetTitleEmpty ? `<title>${routeOptions.pageTitle}</title>` : helmetTitleScript;
return helmetTitleEmpty
? `<title>${routeOptions.pageTitle}</title>`
: helmetTitleScript;
},

REACT_HELMET_SCRIPTS: context => {
REACT_HELMET_SCRIPTS: (context) => {
const scriptsFromHelmet = ["link", "style", "script", "noscript"]
.map(tagName => context.user.helmet[tagName].toString())
.map((tagName) => context.user.helmet[tagName].toString())
.join("");
return `<!--scripts from helmet-->${scriptsFromHelmet}`;
},

META_TAGS: context => {
META_TAGS: (context) => {
return context.user.helmet.meta.toString() + iconStats;
}
},
};
};
10 changes: 3 additions & 7 deletions packages/xarc-index-page/test/jsx-templates/test1.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/* @jsx createElement */
import { IndexPage, Token, Require, Literal, Component } from "../../lib/jsx";

/* eslint-disable no-unused-vars */

import { IndexPage, createElement, Token, Require, Literal, Component } from "../../lib/jsx";

const MyTest = (props, context) => {
const MyTest = (props) => {
return (
<div {...props} v={() => 50}>
<Token _id="PAGE_TITLE" />
Expand All @@ -23,7 +19,7 @@ class TestComponent1 extends Component {
}
}

function AsyncComponent(props, context, scope) {
function AsyncComponent(props, scope) {
return new Promise(resolve => {
setTimeout(() => {
scope.output.add(`${props.indent}async component ${props.key}\n`);
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-index-page/test/jsx-templates/test2.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import { IndexPage, createElement, Token, Require, Literal, Component } from "../../lib/jsx"; // eslint-disable-line

const MyTest = (props, context) => {
const MyTest = (props) => {
return (
<div {...props} v={() => 50}>
<Token _id="PAGE_TITLE" />
Expand Down

0 comments on commit f6e36ce

Please sign in to comment.