@uxland/project-tools
v2.1.2
Published
UXLand project tools such as configs and lint
Downloads
99
Readme
UXL Project Tools
Installation
npm i @uxland/project-tools
Usage
Build tools
rollup
const buildConfig = require("@uxland/project-tools/build/rollup.config");
const pkg = require("./package.json");
const config = buildConfig(pkg);
module.exports = config;
TSConfig
{
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib",
"composite": true
},
"extends": "@uxland/project-tools/build/tsconfig.json",
"include": ["src/**/*.ts"]
}
Documentation tools
const baseConfig = require('@uxland/project-tools/documentation/jsdoc.config');
module.exports = { ...baseConfig, opts: { ...baseConfig.opts, template: <templatePath> } };
Fuse
devServer
const { fuse } = require("<node_modules>/@uxland/project-tools/fuse/start");
const pkg = require("./package.json");
fuse("demo/index.ts", "../styles/styles.scss", "demo/index.html", true, {
APP_VERSION: pkg.version,
}).runDev();
productionBuild
const { fuse } = require("<node_modules>/@uxland/project-tools/fuse/start");
const pkg = require("./package.json");
fuse("demo/index.ts", "../styles/styles.scss", "demo/index.html", true, {
APP_VERSION: pkg.version,
}).runProd({
uglify: false,
target: "browser",
bundles: {
app: "app.$hash.js",
vendor: "vendor.$hash.js",
},
});
Lint tools
Use provided configurations to use lint in your project
{
"husky": {
"hooks": {
"pre-commit": "lint-staged -c node_modules/@uxland/project-tools/lint/lint-staged.config.js",
"commit-msg": "commitlint --config node_modules/@uxland/project-tools/lint/commitlint.config.js -E HUSKY_GIT_PARAMS"
}
}
}
Testing tools
const config = require("@uxland/project-tools/test/jest.config");
const pack = require("./package");
module.exports = { ...config, name: pack.name, displayName: pack.name };