Skip to content

Commit

Permalink
chore: update version
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca committed Mar 25, 2024
1 parent 98c9e20 commit 91fd850
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 8 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "brisa-monorepo",
"version": "0.0.37",
"version": "0.0.38",
"packageManager": "bun@1.0.33",
"description": "The next-gen web framework.",
"license": "MIT",
Expand Down Expand Up @@ -28,7 +28,8 @@
"format": "bunx prettier@3.1.1 --write .",
"docs:dev": "bun run --cwd packages/docs dev",
"docs:build": "bun run --cwd packages/docs build",
"docs:preview": "bun run --cwd packages/docs preview"
"docs:preview": "bun run --cwd packages/docs preview",
"update-version": "bun run scripts/update-brisa-version.ts"
},
"engines": {
"bun": ">= 1.0.33",
Expand Down
2 changes: 1 addition & 1 deletion packages/brisa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"module": "./out/core/index.js",
"main": "./out/core/index.js",
"types": "./out/core/index.d.ts",
"version": "0.0.37",
"version": "0.0.38",
"description": "The next-gen web framework.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-brisa/create-brisa.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rl.question("Enter project name: ", (PROJECT_NAME) => {
fs.mkdirSync(PROJECT_NAME);
process.chdir(PROJECT_NAME);

const BRISA_VERSION = "0.0.37";
const BRISA_VERSION = "0.0.38";

console.log("\n🛠️ Installing brisa...\n");

Expand Down
2 changes: 1 addition & 1 deletion packages/create-brisa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-brisa",
"version": "0.0.37",
"version": "0.0.38",
"license": "MIT",
"type": "module",
"scripts": {
Expand Down
61 changes: 61 additions & 0 deletions scripts/update-brisa-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import fs from "node:fs";
import { join } from "node:path";
import packageJSON from "../package.json";
import brisaPackageJSON from "../packages/brisa/package.json";
import createBrisaPackageJSON from "../packages/create-brisa/package.json";

const currentVersion = packageJSON.version;
const version = prompt(
`Introduce the new version of Brisa (now ${currentVersion}): `,
);

if (
!version ||
currentVersion === version ||
!Bun.semver.satisfies(version, ">= 0.0.0") ||
[currentVersion, version].sort(Bun.semver.order)[0] !== currentVersion
) {
console.error("Invalid version, must be greater than the current one.");
process.exit(1);
}

// Root monorepo package.json
packageJSON.version = version;
fs.writeFileSync(
join(import.meta.dir, "..", "package.json"),
JSON.stringify(packageJSON, null, 2),
);

// Brisa package.json
brisaPackageJSON.version = version;
fs.writeFileSync(
join(import.meta.dir, "..", "packages", "brisa", "package.json"),
JSON.stringify(brisaPackageJSON, null, 2),
);

// Create Brisa package.json
createBrisaPackageJSON.version = version;
fs.writeFileSync(
join(import.meta.dir, "..", "packages", "create-brisa", "package.json"),
JSON.stringify(createBrisaPackageJSON, null, 2),
);

// Update Brisa CLI version
const createBrisaCLIPath = join(
import.meta.dir,
"..",
"packages",
"create-brisa",
"create-brisa.cjs",
);
const createBrisaCLI = fs
.readFileSync(createBrisaCLIPath)
.toString()
.replace(
`BRISA_VERSION = "${currentVersion}";`,
`BRISA_VERSION = "${version}";`,
);

fs.writeFileSync(createBrisaCLIPath, createBrisaCLI);

console.log("Version updated successfully!");
24 changes: 21 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
{
"exclude": ["node_modules"],
"compilerOptions": {
"baseUrl": "./packages/brisa/src"
}
"lib": ["ESNext"],
"module": "esnext",
"baseUrl": ".",
"target": "esnext",
"moduleResolution": "bundler",
"moduleDetection": "force",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noFallthroughCasesInSwitch": true,
"noEmit": true,
"composite": true,
"strict": true,
"downlevelIteration": true,
"skipLibCheck": true,
"jsx": "react-jsx",
"jsxImportSource": "brisa",
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true
},
"exclude": ["node_modules"]
}

0 comments on commit 91fd850

Please sign in to comment.