Skip to content

Commit

Permalink
fix: slashes in windows file paths were breaking things
Browse files Browse the repository at this point in the history
  • Loading branch information
calebjclark committed Jan 5, 2023
1 parent b0fe5eb commit 9e40001
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion databox/docpage/lib/ReplaceConfigFile.js
Expand Up @@ -18,7 +18,7 @@ module.exports = class ReplaceConfigFile {
}

tapCallback(_, normalModule) {
if (!normalModule.resource.endsWith('docpage/src/data.config.json')) return;
if (!normalModule.resource.endsWith('data.config.json')) return;
const loader = require.resolve('./dataLoader.js');
normalModule.loaders.push({
loader,
Expand Down
2 changes: 1 addition & 1 deletion databox/docpage/package.json
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build --mode production",
"build:dist": "cross-env BUILD_DIR=\"build-dist\" yarn build",
"build:dist": "cross-env BUILD_DIR=\"build-dist\" yarn build --mode production",
"lint": "vue-cli-service lint"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion databox/docpage/vue.config.js
Expand Up @@ -27,7 +27,7 @@ module.exports = {
options.compilerOptions.whitespace = 'preserve'
return options
});
if (process.env.NODE_ENV === 'production') {
if (['production', 'test'].includes(process.env.NODE_ENV)) {
config.plugin('ReplaceConfigFile').use(ReplaceConfigFile, [ ['$DATABOX_CONFIG_DATA'] ]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion databox/packager/lib/DbxFile.ts
Expand Up @@ -69,7 +69,7 @@ export default class DbxFile {

public async createOrUpdateDocpage(meta: IFetchMetaResponseData, entrypoint: string): Promise<void> {
const docpageDir = Path.join(this.workingDirectory, 'docpage');
const name = meta.name || entrypoint.match(/([^/]+)\.(js|ts)$/)[1] || 'Untitled';
const name = meta.name || entrypoint.match(/([^/\\]+)\.(js|ts)$/)[1] || 'Untitled';

const config = {
name: name.charAt(0).toUpperCase() + name.slice(1),
Expand Down
9 changes: 0 additions & 9 deletions databox/packager/test/DbxFile.test.ts
Expand Up @@ -26,12 +26,3 @@ module.exports=new Function(({output}) => {
expect(scriptContents).toBe(newScript);
await dbxFile.close();
});

test('can load docpage', async () => {
const packager = new DataboxPackager(`${__dirname}/assets/dbxTest2.js`);
await packager.build();

console.log(JSON.stringify(packager.meta, null, 2));

expect(true).toBe(true);
});
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -4,15 +4,16 @@
"description": "The internal developer environment that we use for building and running the Ulixee platform",
"scripts": {
"prepare": "husky install",
"build": "yarn && yarn tsc && cd ./build && yarn",
"build": "yarn && yarn tsc && yarn build:docpage && cd ./build && yarn",
"build:hero": "cd hero && yarn build",
"build:chromealive-extension": "cd apps/chromealive-extension && yarn build",
"build:chromealive": "cd apps/chromealive && yarn build",
"build:docpage": "yarn workspace @ulixee/databox-docpage build",
"build:all": "yarn build:hero && yarn build:chromealive && yarn build",
"build:dist": "shx rm -rf build-dist && tsc -b tsconfig.dist.json && yarn copy:dist && yarn workspace @ulixee/apps-chromealive-extension build:dist",
"copy:build": "ulx-repo-after-build && ulx-repo-adjust-paths",
"copy:dist": "ulx-repo-after-build --dist",
"tsc": "tsc -b -i tsconfig.json && yarn copy:build && yarn workspace @ulixee/databox-docpage build",
"tsc": "tsc -b -i tsconfig.json && yarn copy:build",
"tsc:hero": "cd hero && yarn tsc",
"tsc:all": "yarn tsc:hero && yarn tsc",
"watch": "yarn tsc && tsc -b -w tsconfig.json",
Expand Down

0 comments on commit 9e40001

Please sign in to comment.