Skip to content

Commit

Permalink
fix: ace code editor integration (#4863)
Browse files Browse the repository at this point in the history
  • Loading branch information
romainseb authored Aug 31, 2023
1 parent a6ac16f commit d465adb
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 67 deletions.
16 changes: 16 additions & 0 deletions .changeset/tame-birds-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@talend/scripts-config-cdn': patch
'@talend/module-to-cdn': patch
'@talend/react-forms': patch
---

fix: ace code editor

Issue1: 404 on react-ace min in dev mode.
The copy of the assets during the build is not able to support different forlders and this is the case for react-ace.
The getUMD point to the production version (becaue of babel) but we are in dev so this make a 404.
Fix: point to prod for both versions

Issue 2: function f is not defined (trace in ace-build).
Fix: pin ace-builds in react-forms because there is a bug in the latest version

2 changes: 1 addition & 1 deletion fork/module-to-cdn/modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@
"production": "/dist/react-ace.min.js"
},
">= 9.4.0": {
"development": "/dist/react-ace.js/main.js",
"development": "/dist/react-ace.min.js/main.js",
"production": "/dist/react-ace.min.js/main.js"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@talend/design-system": "^7.10.0",
"@talend/design-tokens": "^2.7.3",
"@talend/utils": "^2.5.1",
"ace-builds": "^1.10.1",
"ace-builds": "1.10.1",
"ajv": "^6.12.6",
"classnames": "^2.3.2",
"json-logic-js": "^2.0.2",
Expand Down
5 changes: 4 additions & 1 deletion tools/scripts-config-cdn/cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ function addToCopyConfig(info, config) {
}
let to = path.relative(
process.cwd(),
path.resolve(`cdn/${info.name}/${info.version}${info.path}`, '../'),
path.resolve(
`cdn/${info.name}/${info.version}${info.path}`,
info.path.endsWith('/') ? '' : '../',
),
);
if (!to.endsWith('/')) {
to += '/';
Expand Down
Loading

0 comments on commit d465adb

Please sign in to comment.