Skip to content

Commit

Permalink
Merge branch 'master' into KIT-3708
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprudhomme authored Nov 11, 2024
2 parents 4d9a057 + b52d936 commit 52b2e19
Show file tree
Hide file tree
Showing 5 changed files with 245 additions and 7 deletions.
226 changes: 226 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/quantic/babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"plugins": ["@babel/plugin-transform-async-to-generator"]
}
11 changes: 7 additions & 4 deletions packages/quantic/copy-static-resources.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const {promisify} = require('util');
const ncp = promisify(require('ncp'));
const mkdir = promisify(require('fs').mkdir);
const rm = promisify(require('fs').rm);

const copy = async (source, dest) => {
try {
Expand Down Expand Up @@ -69,26 +70,28 @@ const copyHeadless = async () => {
{recursive: true}
);
await copy(
'../../node_modules/@coveo/headless/dist/quantic/headless.js',
'.tmp/quantic-compiled/headless.js',
'./force-app/main/default/staticresources/coveoheadless/headless.js'
);
await copy(
'../../node_modules/@coveo/headless/dist/quantic/case-assist/headless.js',
'.tmp/quantic-compiled/case-assist/headless.js',
'./force-app/main/default/staticresources/coveoheadless/case-assist/headless.js'
);
await copy(
'../../node_modules/@coveo/headless/dist/quantic/insight/headless.js',
'.tmp/quantic-compiled/insight/headless.js',
'./force-app/main/default/staticresources/coveoheadless/insight/headless.js'
);
await copy(
'../../node_modules/@coveo/headless/dist/quantic/recommendation/headless.js',
'.tmp/quantic-compiled/recommendation/headless.js',
'./force-app/main/default/staticresources/coveoheadless/recommendation/headless.js'
);
await copy(
'../../node_modules/@coveo/headless/dist/definitions',
'./force-app/main/default/staticresources/coveoheadless/definitions'
);

await rm('.tmp', {recursive: true});

console.info('Headless copied.');
};

Expand Down
7 changes: 5 additions & 2 deletions packages/quantic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"url": "git+https://github.com/coveo/ui-kit.git"
},
"scripts": {
"test": "npm run build:staticresources && npm run lint:check:tests && npm run validate:types && npm run test:unit",
"test": "npm run babel:headless && npm run build:staticresources && npm run lint:check:tests && npm run validate:types && npm run test:unit",
"lint:check:tests": "eslint force-app/main/default/lwc/ --format junit -o reports/eslint.xml",
"lint:fix": "npm run lint:fix:js",
"lint:fix:js": "eslint --fix force-app/main/default/lwc/ && eslint --fix force-app/examples/main/lwc/ && prettier \"force-app/{,**}/*.js\" --write",
Expand Down Expand Up @@ -42,7 +42,8 @@
"publish:bump": "npm run-script -w=@coveo/release bump",
"promote:npm:latest": "npm run-script -w=@coveo/release promote-npm-prod",
"preinstall": "node scripts/npm/check-sfdx-project.js",
"postinstall": "node scripts/npm/setup-quantic.js"
"postinstall": "node scripts/npm/setup-quantic.js",
"babel:headless": "babel ../../node_modules/@coveo/headless/dist/quantic --out-dir .tmp/quantic-compiled --extensions .js --minified"
},
"dependencies": {
"@coveo/bueno": "1.0.5",
Expand All @@ -54,6 +55,8 @@
"node": "^20.9.0 || ^22.11.0"
},
"devDependencies": {
"@babel/cli": "7.25.6",
"@babel/plugin-transform-async-to-generator": "7.24.7",
"@ckeditor/jsdoc-plugins": "39.9.1",
"@coveo/relay-event-types": "12.0.1",
"@coveo/release": "1.0.0",
Expand Down
5 changes: 4 additions & 1 deletion packages/quantic/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
],
"executor": "nx:run-commands",
"options": {
"commands": ["npm run build:staticresources", "npm run build:doc"],
"commands": [
"npm run babel:headless && npm run build:staticresources",
"npm run build:doc"
],
"parallel": true,
"cwd": "packages/quantic"
}
Expand Down

0 comments on commit 52b2e19

Please sign in to comment.