Skip to content

Commit

Permalink
Fix packaging & development for diagram client
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Nov 11, 2023
1 parent 1867a92 commit 92f9527
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 25 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
"wollok": "./build/src/index.js"
},
"pkg": {
"scripts": "build/src/**/*.js",
"scripts": "build/**/*.js",
"targets": [
"node18-linux-x64",
"node18-macos-x64",
"node18-macos-arm64",
"node18-win-x64"
],
"assets": [
"public/**/*"
"./build/public/**/*"
],
"outputPath": "dist"
},
Expand Down
2 changes: 0 additions & 2 deletions src/commands/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ export async function initializeClient(options: Options, repl: Interface, interp
socket.emit('updateDiagram', getDataDiagram(interpreter))
})

console.info('PATTTTTTTTTTHHHHHHHHHHH', publicPath('diagram'), options.port)

app.use(
cors({ allowedHeaders: '*' }),
express.static(publicPath('diagram'), { maxAge: '1d' }),
Expand Down
21 changes: 2 additions & 19 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,25 +103,8 @@ export const problemDescription = (problem: Problem): string => {
// RESOURCES
// ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════


// NONONONONONO


// HAY QUE VER ESTO...



export const publicPath = (...paths: string[]): string => {
console.info('donde estoy', path.join(__dirname))
return path.join(__dirname, '..', 'public', ...paths)
}

// no va el '..' extra... hay que corregir el build





export const publicPath = (...paths: string[]): string =>
path.join(__dirname, '..', 'public', ...paths)

export const readPackageProperties = (pathProject: string): any | undefined => {
const packagePath = path.join(pathProject, 'package.json')
Expand Down
1 change: 0 additions & 1 deletion test/diagram.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { diagramAssertions } from './assertions'
use(diagramAssertions)
should()


const projectPath = join('examples', 'diagram-examples')
const simpleFile = join(projectPath, 'fish.wlk')
const fileWithImports = join(projectPath, 'using-imports', 'base.wlk')
Expand Down
1 change: 0 additions & 1 deletion test/dynamicDiagramClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ describe('dynamic diagram client', () => {
const { enabled, app } = await initializeClient(options, repl, interpreter)
expect(enabled).to.be.true
const result = await chai.request(app).get('/index.html')
console.info('result', result)
expect(result).to.have.status(200)
})

Expand Down

0 comments on commit 92f9527

Please sign in to comment.