Skip to content

Commit

Permalink
refactor: rename folder brisa to core
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca committed Sep 29, 2023
1 parent 7eb53cd commit 46e074f
Show file tree
Hide file tree
Showing 27 changed files with 24 additions and 25 deletions.
Binary file modified bun.lockb
Binary file not shown.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "brisa",
"module": "./out/brisa/index.js",
"main": "./out/brisa/index.js",
"types": "./out/brisa/index.d.ts",
"module": "./out/core/index.js",
"main": "./out/core/index.js",
"types": "./out/core/index.d.ts",
"version": "0.1.0-alpha.4",
"description": "lightweight and flexible front-end library based on Bun.js for modern web apps",
"license": "MIT",
Expand All @@ -23,8 +23,8 @@
],
"exports": {
".": {
"import": "./out/brisa/index.js",
"require": "./out/brisa/index.js"
"import": "./out/core/index.js",
"require": "./out/core/index.js"
},
"./jsx-runtime": {
"import": "./jsx-runtime/index.js",
Expand All @@ -40,8 +40,8 @@
}
},
"scripts": {
"build": "bun run clean && bun run build:jsx-runtime && bun run build:jsx-dev-runtime && bun run build:brisa",
"build:brisa": "bun build --minify --target=bun --outdir=out/brisa src/brisa/index.ts && bun run build:cli && cp src/types/index.d.ts out/brisa/index.d.ts",
"build": "bun run clean && bun run build:jsx-runtime && bun run build:jsx-dev-runtime && bun run build:core",
"build:core": "bun build --minify --target=bun --outdir=out/core src/core/index.ts && bun run build:cli && cp src/types/index.d.ts out/core/index.d.ts",
"build:cli": "NODE_ENV=production bun build --minify --target=bun --outdir=out/cli src/cli/build.ts src/cli/serve.tsx && NODE_ENV=development bun build --minify --target=bun --outdir=out/cli/dev src/cli/serve.tsx",
"build:jsx-runtime": "bun build --minify --target=bun --outdir=jsx-runtime src/jsx-runtime/index.ts && cp src/types/index.d.ts jsx-runtime/index.d.ts",
"build:jsx-dev-runtime": "bun build --minify --target=bun --outdir=jsx-dev-runtime src/jsx-runtime/index.ts && cp src/types/index.d.ts jsx-dev-runtime/index.d.ts",
Expand All @@ -57,7 +57,7 @@
"devDependencies": {
"@happy-dom/global-registrator": "12.0.1",
"bun-types": "1.0.2",
"brisa": "0.0.1"
"brisa": "0.1.0-alpha.4"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
2 changes: 1 addition & 1 deletion src/cli/dev-live-reload.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import dangerHTML from "../brisa/danger-html";
import dangerHTML from "../core/danger-html";

const LIVE_RELOAD_WEBSOCKET_PATH = "__brisa_live_reload__";
const LIVE_RELOAD_COMMAND = "reload";
Expand Down
2 changes: 1 addition & 1 deletion src/cli/serve.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from "node:path";

import LoadLayout from "../utils/load-layout";
import getRouteMatcher from "../utils/get-route-matcher";
import { RequestContext, renderToReadableStream } from "../brisa";
import { RequestContext, renderToReadableStream } from "../core";
import { LiveReloadScript } from "./dev-live-reload";
import { MatchedRoute, ServerWebSocket } from "bun";
import importFileIfExists from "../utils/import-file-if-exists";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/utils/adapt-router-to-page-translations/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, it, beforeEach, afterEach } from "bun:test";
import path from "node:path";
import adaptRouterToPageTranslations from ".";
import getRouteMatcher from "../get-route-matcher";
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import getConstants from "../../constants";

const PAGES_DIR = path.join(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/adapt-router-to-page-translations/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import { I18nConfig, RouterType, Translations } from "../../types";
import routeMatchPathname from "../route-match-pathname";
import substituteI18nRouteValues from "../substitute-i18n-route-values";
Expand Down
2 changes: 1 addition & 1 deletion src/utils/generate-href-lang/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect, mock, afterEach } from "bun:test";
import generateHrefLang from ".";
import getConstants from "../../constants";
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import { MatchedRoute } from "bun";

const warn = console.warn.bind(console);
Expand Down
7 changes: 3 additions & 4 deletions src/utils/generate-href-lang/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import getConstants from "../../constants";
import substituteI18nRouteValues from "../substitute-i18n-route-values";

Expand All @@ -21,9 +21,8 @@ export default function generateHrefLang(request: RequestContext) {

const url = getURLInAnotherLang(domain, lang, request);
const urlWithoutTrailingSlash = url.toString().replace(/\/$/, "");
const finalUrl = `${urlWithoutTrailingSlash}${
CONFIG.trailingSlash ? "/" : ""
}`;
const finalUrl = `${urlWithoutTrailingSlash}${CONFIG.trailingSlash ? "/" : ""
}`;

return `<link rel="alternate" hreflang="${lang}" href="${finalUrl}" />`;
})
Expand Down
2 changes: 1 addition & 1 deletion src/utils/get-locale-from-request/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect, beforeEach, afterEach } from "bun:test";
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import getLocaleFromRequest from ".";

describe("utils", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/handle-i18n/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { afterEach, beforeEach, describe, expect, it } from "bun:test";
import path from "node:path";
import handleI18n from ".";
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";

const rootDir = path.join(import.meta.dir, "..", "..", "__fixtures__");
const pagesDir = path.join(rootDir, "pages");
Expand Down
2 changes: 1 addition & 1 deletion src/utils/handle-i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import getLocaleFromRequest from "../get-locale-from-request";
import getRouteMatcher from "../get-route-matcher";
import getConstants from "../../constants";
Expand Down
2 changes: 1 addition & 1 deletion src/utils/load-layout/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect, afterEach } from "bun:test";
import LoadLayout from ".";
import path from "node:path";
import { RequestContext, renderToReadableStream } from "../../brisa";
import { RequestContext, renderToReadableStream } from "../../core";
import streamToText from "../../__fixtures__/stream-to-text";
import getImportableFilepath from "../get-importable-filepath";
import getRootDir from "../get-root-dir";
Expand Down
2 changes: 1 addition & 1 deletion src/utils/redirect-trailing-slash/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect, afterEach } from "bun:test";
import redirectTrailingSlash from ".";
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";

describe("utils", () => {
describe("redirectTrailingSlash", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/redirect-trailing-slash/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import getConstants from "../../constants";

export default function redirectTrailingSlash(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/render-attributes/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect, afterEach } from "bun:test";
import renderAttributes from ".";
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import getConstants from "../../constants";

describe("utils", () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/render-attributes/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RequestContext } from "../../brisa";
import { RequestContext } from "../../core";
import getConstants from "../../constants";
import { I18nConfig, Props, Translations } from "../../types";
import routeMatchPathname from "../route-match-pathname";
Expand Down

0 comments on commit 46e074f

Please sign in to comment.