A CLI tool and API for compiling and optimizing specifications. The tool processes spec files, handles dataset optimizations, and provides a configurable way to manage different compile and optimization tasks.
Until the PR on base
mosaic
repo merges,npm install
pulls@uwdata/*
straight from themosaic-publish
branch of the Mosaic repo usinggitpkg
.
This tool is designed to be used via npx
or can be installed globally.
npx @uwdata/publish ./path/to/spec.yaml -o most
To install the CLI tool globally:
npm install -g @uwdata/publish
Now you can run the tool from anywhere:
mosaic-publish ./path/to/spec.yaml -o most
The functionality of mosaic-publish can also be accessed programmatically via its API. For example:
import { MosaicPublisher } from '@uwdata/publish';
import fs from 'fs';
const publisher = new MosaicPublisher({
spec: fs.readFileSync('./path/to/spec.yaml', 'utf8'),
outputPath: './path/to/output/directory'
});
publisher.publish()
.then(() => {
console.log('Specification compiled and optimized successfully.');
})
.catch(err => {
console.error('Error during publish:', err);
});