From 008a5812f39623dbbca58039f4319a8b84bd0942 Mon Sep 17 00:00:00 2001 From: Andrew Pareles Date: Mon, 11 Nov 2024 03:10:17 -0800 Subject: [PATCH] build should work now --- package-lock.json | 59 +++++++++++++++++-- package.json | 2 +- .../contrib/void/browser/react/build.js | 3 + .../contrib/void/browser/react/tsup.config.js | 3 +- .../contrib/void/browser/registerSidebar.ts | 2 +- 5 files changed, 62 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index ab343062..48f41e95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -153,7 +153,7 @@ "rcedit": "^1.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "rimraf": "^2.2.8", + "rimraf": "^2.7.1", "scope-tailwind": "^1.0.1", "sinon": "^12.0.1", "sinon-test": "^3.1.3", @@ -10595,6 +10595,20 @@ "node": ">=0.4.0" } }, + "node_modules/gulp-eslint/node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/gulp-eslint/node_modules/semver": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", @@ -18095,11 +18109,12 @@ } }, "node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "deprecated": "Rimraf versions prior to v4 are no longer supported", "dev": true, + "license": "ISC", "dependencies": { "glob": "^7.1.3" }, @@ -20239,6 +20254,42 @@ "node": ">=6.0.0" } }, + "node_modules/temp/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/temp/node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/terser": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.0.tgz", diff --git a/package.json b/package.json index a1246ce5..1cb61dfc 100644 --- a/package.json +++ b/package.json @@ -215,7 +215,7 @@ "rcedit": "^1.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "rimraf": "^2.2.8", + "rimraf": "^2.7.1", "scope-tailwind": "^1.0.1", "sinon": "^12.0.1", "sinon-test": "^3.1.3", diff --git a/src/vs/workbench/contrib/void/browser/react/build.js b/src/vs/workbench/contrib/void/browser/react/build.js index 84f2233d..1a1924b1 100755 --- a/src/vs/workbench/contrib/void/browser/react/build.js +++ b/src/vs/workbench/contrib/void/browser/react/build.js @@ -1,5 +1,8 @@ import { execSync } from 'child_process'; +// clear out dirs +execSync('npx rimraf out/ && npx rimraf src2/') + // tsup to build all react to out/ execSync('npx scope-tailwind ./src -o src2/ -s void-scope -c styles.css') diff --git a/src/vs/workbench/contrib/void/browser/react/tsup.config.js b/src/vs/workbench/contrib/void/browser/react/tsup.config.js index b084a8d5..484ded1c 100644 --- a/src/vs/workbench/contrib/void/browser/react/tsup.config.js +++ b/src/vs/workbench/contrib/void/browser/react/tsup.config.js @@ -12,6 +12,7 @@ export default defineConfig({ clean: true, platform: 'browser', target: 'esnext', + injectStyle: true, // bundle css into the output file outExtension: () => ({ js: '.js' }), // default behavior is to take local files and make them internal (bundle them) and take imports like 'react' and leave them external (don't bundle them), we want the opposite in many ways noExternal: ['react', 'react-dom'], // noExternal means we should take these things and make them not external (bundle them into the output file) @@ -22,6 +23,6 @@ export default defineConfig({ ], treeshake: true, esbuildOptions(options) { - options.outbase = 'out' // This tells esbuild to use src2 as the base for output paths + options.outbase = 'src2' // tries copying the folder hierarchy starting at src2 } }) diff --git a/src/vs/workbench/contrib/void/browser/registerSidebar.ts b/src/vs/workbench/contrib/void/browser/registerSidebar.ts index 2154754e..da764b5d 100644 --- a/src/vs/workbench/contrib/void/browser/registerSidebar.ts +++ b/src/vs/workbench/contrib/void/browser/registerSidebar.ts @@ -39,7 +39,7 @@ import { IHoverService } from '../../../../platform/hover/browser/hover.js'; // import { IVoidConfigService } from './registerSettings.js'; // import { IEditorService } from '../../../services/editor/common/editorService.js'; -import mountFn from './react/out/Sidebar.js'; +import mountFn from './react/out/sidebar-tsx/Sidebar.js'; import './react/out/styles.css'; import { IVoidConfigStateService } from './registerConfig.js';