Compare commits

...

4 commits

Author SHA1 Message Date
Cog Bot
f571f2e663 chore(version): v0.1.1 2025-02-14 19:46:00 +00:00
e80fa615dc fix: build binary of core
All checks were successful
Publish package / build_and_publish (push) Successful in 26s
2025-02-14 16:45:25 -03:00
93da2ccbad chore(version): @mini-strap/core-v0.1.1
All checks were successful
Publish package / build_and_publish (push) Successful in 23s
2025-02-14 15:54:46 -03:00
812e55e13a chore: update build script
All checks were successful
Publish package / build_and_publish (push) Successful in 29s
2025-02-14 15:47:57 -03:00
6 changed files with 128 additions and 7 deletions

View file

@ -35,10 +35,11 @@ jobs:
run: "bun install"
- name: Bump version and publish
uses: https://github.com/eshepelyuk/cocogitto-diya@v1
uses: https://github.com/cocogitto/cocogitto-action@v3.10
env:
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_TOKEN_FORGEJO }}
with:
release: true
check-latest-tag-only: true
git-user: 'Cog Bot'
git-user-email: 'cog@alecodes.page'

View file

@ -2,6 +2,15 @@
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
- - -
## v0.1.1 - 2025-02-14
### Package updates
- @mini-strap/core bumped to @mini-strap/core-v0.1.2
### Global changes
#### Miscellaneous Chores
- update build script - (812e55e) - aleidk
- - -
## v0.1.0 - 2024-12-30
### Package updates
- @mini-strap/core bumped to @mini-strap/core-v0.1.0

View file

@ -8,16 +8,13 @@ branch_whitelist = []
skip_ci = "[skip ci]"
skip_untracked = false
pre_bump_hooks = []
post_bump_hooks = [
"git push",
"git push origin {{version_tag}}",
]
post_bump_hooks = ["git push", "git push origin {{version_tag}}"]
pre_package_bump_hooks = [
"echo 'bump package {{package}} to {{version}}'",
"sed -E -i 's/(\"version\":) \"[0-9.]{5}\"/\\1 \"{{version}}\"/gi' package.json",
"bun run ci:publish",
]
post_package_bump_hooks = []
post_package_bump_hooks = ["git push", "git push origin {{version_tag}}"]
[git_hooks]

View file

@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
- - -
## @mini-strap/core-v0.1.2 - 2025-02-14
#### Bug Fixes
- build binary of core - (e80fa61) - aleidk
- - -
## @mini-strap/core-v0.1.1 - 2025-02-14
#### Miscellaneous Chores
- update build script - (812e55e) - aleidk
- - -
## @mini-strap/core-v0.1.0 - 2024-12-30
#### Bug Fixes
- **(core)** update old css variables names - (9c6d935) - aleidk

99
packages/core/build.ts Normal file
View file

@ -0,0 +1,99 @@
#!/usr/bin/env bun
import type { BuildConfig, BunPlugin, PluginBuilder } from "bun";
import { parseArgs } from "node:util";
import type { FileImporter } from "sass";
const { values, positionals } = parseArgs({
args: Bun.argv,
options: {
production: {
type: "boolean",
short: "p",
default: true,
},
filter: {
type: "string",
short: "f",
default: "all",
},
},
strict: true,
allowPositionals: true,
});
const outdir = positionals.at(2);
if (!outdir) {
throw new Error("No outdir provided!");
}
const nodeModuleImporter: FileImporter<"async"> = {
findFileUrl(url) {
if (url.startsWith("@")) {
return new URL(import.meta.resolve(url));
}
return null;
},
};
const sassPlugin: BunPlugin = {
name: "Sass Loader",
async setup(build: PluginBuilder) {
const sass = await import("sass");
build.onLoad({ filter: /\.scss$/ }, async ({ path }) => {
// read and compile it with the sass compiler
const result = await sass.compileAsync(path, {
importers: [nodeModuleImporter],
});
return {
loader: "css",
contents: result.css,
};
});
},
};
const assets: BuildConfig[] = [];
const filter = values.filter ?? "all";
if (["all", "sass"].includes(filter)) {
assets.push({
entrypoints: ["./src/style.scss"],
outdir: `${outdir}/css`,
naming: "[name].css",
plugins: [sassPlugin],
minify: values.production,
// On by default in Bun v1.2+
html: true,
experimentalCss: true,
});
}
// if (["all", "js", "ts"].includes(filter)) {
// assets.push({
// entrypoints: ["./js/index.ts"],
// outdir: `${outdir}/js`,
// target: "browser",
// splitting: values.production,
// minify: values.production,
// });
// }
await Promise.all(
assets.map(async (item) => {
const result = await Bun.build(item);
if (!result.success) {
throw new AggregateError(result.logs, "Build failed");
}
return result;
}),
);
console.log(`${Bun.color("#a6da95", "ansi")}Assets succesfully build!\x1b[0m`);

View file

@ -1,11 +1,14 @@
{
"name": "@mini-strap/core",
"version": "0.1.0",
"version": "0.1.2",
"type": "module",
"exports": {
".": "./src/style.scss",
"./mixins": "./src/_mixins.scss"
},
"bin": {
"@mini-strap/core": "build.ts"
},
"scripts": {
"build": "bun sass --style compressed src/style.scss dist/style.css",
"ci:publish": "bun run build && bun publish --production --frozen-lockfile --silent"