Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: build working again on windows #4954

Open
wants to merge 2 commits into
base: KIT-3925
Choose a base branch
from
Open
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
197 changes: 174 additions & 23 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion packages/atomic-hosted-page/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"@types/node": "22.13.1",
"rollup": "4.34.2",
"vite": "5.4.14",
"ncp": "2.0.0"
"ncp": "2.0.0",
"rimraf": "3.0.2"
},
"engines": {
"node": "^20.9.0 || ^22.11.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/atomic-hosted-page/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"executor": "nx:run-commands",
"options": {
"commands": [
"rm -rf dist cdn",
"rimraf -rf dist cdn",
"tsc --outdir dist",
"tsc --outdir cdn --project tsconfig.cdn.json",
"node ./scripts/esbuild.js"
Expand Down
1 change: 1 addition & 0 deletions packages/atomic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"postcss-load-config": "6.0.1",
"postcss-nested": "7.0.2",
"puppeteer": "24.2.0",
"rimraf": "3.0.2",
"react": "18.3.1",
"rollup": "4.34.2",
"rollup-plugin-html": "0.2.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/atomic/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"node ./scripts/stencil-proxy.mjs",
"node ./scripts/build.mjs --config=tsconfig.lit.json",
"node ./scripts/process-css.mjs --config=tsconfig.lit.json ",
"if [ \"$DEPLOYMENT_ENVIRONMENT\" == \"CDN\" ]; then rollup -c rollup.config.js; fi",
"npm run-script -w=@coveo/release if-not-cdn -- \"rollup -c rollup.config.js\"",
"esbuild src/autoloader/index.ts --format=esm --outfile=dist/atomic/autoloader/index.esm.js",
"esbuild src/autoloader/index.ts --format=cjs --outfile=dist/atomic/autoloader/index.cjs.js"
],
Expand Down Expand Up @@ -155,7 +155,7 @@
"dependsOn": ["^build", "cached:build:stencil"],
"executor": "nx:run-commands",
"options": {
"command": "rm -f ./dist/atomic/loader/package.json",
"command": "rimraf ./dist/atomic/loader/package.json",
"cwd": "packages/atomic"
}
},
Expand Down
6 changes: 3 additions & 3 deletions packages/atomic/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import resolve from '@rollup/plugin-node-resolve';
import {readdirSync, statSync} from 'fs';
import {join, resolve as resolvePath, relative} from 'path';
import {join, resolve as resolvePath, relative, sep} from 'path';
import {generateExternalPackageMappings} from './scripts/externalPackageMappings.mjs';

const isCDN = process.env.DEPLOYMENT_ENVIRONMENT === 'CDN';
Expand Down Expand Up @@ -63,8 +63,8 @@ export default {
manualChunks: (id) => {
if (id.includes('node_modules')) {
return (
'vendor/' +
id.toString().split('node_modules/')[1].split('/')[0].toString()
`vendor${sep}` +
id.toString().split(`node_modules${sep}`)[1].split(sep)[0].toString()
);
}
},
Expand Down
16 changes: 6 additions & 10 deletions packages/atomic/scripts/stencil-proxy.mjs
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
import {cpSync, readdirSync, renameSync} from 'node:fs';
import {join} from 'node:path';
import {join, sep, resolve, relative} from 'node:path';

const srcDir = './stencil-proxy';
const distDir = './dist';
const srcDir = resolve('./stencil-proxy');
const distDir = resolve('./dist');

const files = readdirSync(srcDir, {recursive: true, withFileTypes: true});

const prefixFileWithUnderscore = (file) =>
file.split('/').slice(0, -1).join('/') + '/_' + file.split('/').pop();
file.split(sep).slice(0, -1).join(sep) + sep + '_' + file.split(sep).pop();

for (const file of files) {
if (file.isFile()) {
const filePath = join(file.parentPath, file.name)
.split('/')
.slice(1)
.join('/');
console.log(filePath);
const filePath = relative(srcDir, join(file.parentPath, file.name));
const proxyFile = join(srcDir, filePath);
const proxiedFile = join(distDir, filePath);
renameSync(proxiedFile, prefixFileWithUnderscore(proxiedFile));
cpSync(proxyFile, proxiedFile);
cpSync(proxyFile, proxiedFile, {recursive: true, overwrite: true});
}
}
11 changes: 5 additions & 6 deletions packages/headless/esbuild.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import alias from 'esbuild-plugin-alias';
import {aliasPath} from 'esbuild-plugin-alias-path';
import {umdWrapper} from 'esbuild-plugin-umd-wrapper';
import {readFileSync, writeFileSync} from 'node:fs';
import {createRequire} from 'node:module';
import path, {dirname, resolve} from 'node:path';
import {join} from 'path';
import {dirname, resolve} from 'node:path';
import {build} from '../../scripts/esbuild/build.mjs';
import {apacheLicense} from '../../scripts/license/apache.mjs';

const __dirname = dirname(new URL(import.meta.url).pathname);

const buenoJsonPath = join(__dirname, '../bueno/package.json');
const __dirname = dirname(new URL(import.meta.url).pathname).slice(
process.platform === 'win32' ? 1 : 0
);
const buenoJsonPath = resolve(__dirname, '../bueno/package.json');
const buenoJson = JSON.parse(readFileSync(buenoJsonPath, 'utf-8'));

const require = createRequire(import.meta.url);
Expand Down
4 changes: 2 additions & 2 deletions packages/samples/angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"executor": "nx:run-commands",
"options": {
"commands": [
"if [ \"$DEPLOYMENT_ENVIRONMENT\" != \"CDN\" ]; then npm run build:assets; fi",
"if [ \"$DEPLOYMENT_ENVIRONMENT\" != \"CDN\" ]; then npm run build:angular; fi"
"npm run-script -w=@coveo/release if-not-cdn -- \"npm run build:assets\"",
"npm run-script -w=@coveo/release if-not-cdn -- \"npm run build:angular\""
],
"parallel": false,
"cwd": "packages/samples/angular"
Expand Down
Loading
Loading