Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class MockBabelNodePath {
toString() {
return this._source.slice(this.node.start, this.node.end);
}
isJSXAttribute() {
return this.node.type === 'JSXAttribute';
}
}

module.exports = MockBabelNodePath;
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ class Operation {
const matcherAST = this.parser.parseElement(this.matcherText);
this.matcherName = this._getSource(matcherAST.openingElement.name);
this.requiredAttributes = new Map();
for (const { name, value } of matcherAST.openingElement.attributes) {
for (const attr of matcherAST.openingElement.attributes) {
if (attr.type === 'JSXSpreadAttribute') {
continue;
}
const { name, value } = attr;

this.requiredAttributes.set(
this._getSource(name),
this._getSource(value)
Expand Down Expand Up @@ -70,6 +75,9 @@ class Operation {
_matchesAttributes(attributePaths) {
const matchMap = new Map(this.requiredAttributes);
for (const attr of attributePaths) {
if (!attr.isJSXAttribute()) {
continue;
}
const attributeName = attr.get('name').toString();
if (!matchMap.has(attributeName)) {
// no requirement for this attribute, ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,9 @@ exports.Checkbox = Checkbox;
var _react = require(\\"react\\");
const _excluded = [\\"classes\\", \\"fieldState\\", \\"id\\", \\"label\\", \\"message\\"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
function _getRequireWildcardCache(e) { if (\\"function\\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \\"object\\" != typeof e && \\"function\\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\\"default\\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function _interopRequireWildcard(e, t) { if (\\"function\\" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || \\"object\\" != typeof e && \\"function\\" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) \\"default\\" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
const DynamicComponent$3 = (0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('./path/to/a-third/component'))));
const DynamicBlerg$2 = (0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('./path/to/another/component'))));
const DynamicBlerg$1 = (0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('./path/to/dynamic/component'))));
Expand Down
2 changes: 1 addition & 1 deletion packages/venia-concept/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ module.exports = async env => {

// Add extension directories to the babel-loader include paths
const jsRule = config.module.rules.find(
(rule) => rule.test && rule.test.toString().includes('jsx')
rule => rule.test && rule.test.toString().includes('jsx')
);
if (jsRule && jsRule.include) {
const extensionsPath = path.resolve(__dirname, '../extensions');
Expand Down
4 changes: 2 additions & 2 deletions prod.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.16.1-alpine as build
FROM node:20-alpine as build
# working directory
WORKDIR /usr/src/app

Expand Down Expand Up @@ -35,7 +35,7 @@ ENV BABEL_KEEP_ATTRIBUTES=true
RUN yarn run build

# MULTI-STAGE BUILD
FROM node:18.16.1-alpine
FROM node:20-alpine
# working directory
WORKDIR /usr/src/app
# node:alpine comes with a configured user and group
Expand Down