Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and rename AppState #75

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ jobs:
test:
name: Test ${{ matrix.os }}
needs: [variables, lint, format]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: true
env:
APP_ENV: test
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Udibo React App

[![release](https://img.shields.io/badge/release-0.18.0-success)](https://github.com/udibo/react_app/releases/tag/0.18.0)
[![deno doc](https://doc.deno.land/badge.svg)](https://deno.land/x/udibo_react_app@0.18.0)
[![release](https://img.shields.io/badge/release-0.19.0-success)](https://github.com/udibo/react_app/releases/tag/0.19.0)
[![deno doc](https://doc.deno.land/badge.svg)](https://deno.land/x/udibo_react_app@0.19.0)
[![CI/CD](https://github.com/udibo/react_app/actions/workflows/main.yml/badge.svg)](https://github.com/udibo/react_app/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/udibo/react_app/branch/main/graph/badge.svg?token=G5XCR01X8E)](https://codecov.io/gh/udibo/react_app)
[![license](https://img.shields.io/github/license/udibo/react_app)](https://github.com/udibo/react_app/blob/main/LICENSE)
Expand Down Expand Up @@ -31,13 +31,13 @@ Apps are created using [React Router](https://reactrouter.com),

This module has 2 entry points.

- [mod.tsx](https://deno.land/x/udibo_react_app@0.18.0/mod.tsx): For use in code
- [mod.tsx](https://deno.land/x/udibo_react_app@0.19.0/mod.tsx): For use in code
that will be used both on the server and in the browser.
- [server.tsx](https://deno.land/x/udibo_react_app@0.18.0/server.tsx): For use
- [server.tsx](https://deno.land/x/udibo_react_app@0.19.0/server.tsx): For use
in code that will only be used on the server.

You can look at the [examples](#examples) and
[deno docs](https://deno.land/x/udibo_react_app@0.18.0) to learn more about
[deno docs](https://deno.land/x/udibo_react_app@0.19.0) to learn more about
usage.

### Examples
Expand Down
30 changes: 15 additions & 15 deletions build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { walk } from "std/fs/walk.ts";
import { ensureDir } from "std/fs/ensure_dir.ts";
import * as path from "std/path/mod.ts";
import * as path from "std/path/posix/mod.ts";
import * as esbuild from "x/esbuild/mod.js";
import { denoPlugins } from "x/esbuild_deno_loader/mod.ts";

Expand Down Expand Up @@ -118,7 +118,7 @@ function routeFileData(routeId: number, relativePath: string, route: Route) {
lazyImportLine(
routeId,
relativePath,
path.posix.join(relativePath, routeId === 0 ? "" : "../", file.react),
path.join(relativePath, routeId === 0 ? "" : "../", file.react),
),
);
routeText += `, element: <$${routeId} /> }`;
Expand All @@ -130,13 +130,13 @@ function routeFileData(routeId: number, relativePath: string, route: Route) {
lazyImportLine(
routeId,
relativePath,
path.posix.join(relativePath, main.react),
path.join(relativePath, main.react),
),
);
} else {
importLines.push(
`import * as $${routeId++} from "./${
path.posix.join(relativePath, main.react)
path.join(relativePath, main.react)
}";`,
`let $${routeId};`,
`if (($${routeId - 1} as RouteFile).ErrorFallback) {`,
Expand Down Expand Up @@ -166,8 +166,8 @@ function routeFileData(routeId: number, relativePath: string, route: Route) {
importLines.push(
lazyImportLine(
routeId,
path.posix.join(relativePath, "index"),
path.posix.join(relativePath, index.react),
path.join(relativePath, "index"),
path.join(relativePath, index.react),
),
);
childRouteTexts.push(`{ index: true, element: <$${routeId} /> }`);
Expand All @@ -188,7 +188,7 @@ function routeFileData(routeId: number, relativePath: string, route: Route) {
nextRouteId,
} = routeFileData(
routeId,
path.posix.join(relativePath, childRoute.name),
path.join(relativePath, childRoute.name),
childRoute,
);
importLines.push(...childImportLines);
Expand All @@ -203,7 +203,7 @@ function routeFileData(routeId: number, relativePath: string, route: Route) {
nextRouteId,
} = routeFileData(
routeId,
path.posix.join(relativePath, notFoundRoute.name),
path.join(relativePath, notFoundRoute.name),
notFoundRoute,
);
importLines.push(...childImportLines);
Expand Down Expand Up @@ -256,7 +256,7 @@ function routerFileData(
importLines.push(
...routeImportLines(
routeId,
path.posix.join(relativePath, routeId > 0 ? "../" : "", file.react),
path.join(relativePath, routeId > 0 ? "../" : "", file.react),
),
);
fileText.push(`react:$${routeId}`);
Expand All @@ -267,7 +267,7 @@ function routerFileData(
importLines.push(
routerImportLine(
routeId,
path.posix.join(relativePath, routeId > 0 ? "../" : "", file.oak),
path.join(relativePath, routeId > 0 ? "../" : "", file.oak),
),
);
fileText.push(`oak:$${routeId}`);
Expand All @@ -284,7 +284,7 @@ function routerFileData(
importLines.push(
...routeImportLines(
routeId,
path.posix.join(relativePath, main.react),
path.join(relativePath, main.react),
),
);
fileText.push(`react:$${routeId}`);
Expand All @@ -295,7 +295,7 @@ function routerFileData(
importLines.push(
routerImportLine(
routeId,
path.posix.join(relativePath, main.oak),
path.join(relativePath, main.oak),
),
);
fileText.push(`oak:$${routeId}`);
Expand All @@ -313,7 +313,7 @@ function routerFileData(
importLines.push(
...routeImportLines(
routeId,
path.posix.join(relativePath, index.react),
path.join(relativePath, index.react),
),
);
fileText.push(`react:$${routeId}`);
Expand All @@ -324,7 +324,7 @@ function routerFileData(
importLines.push(
routerImportLine(
routeId,
path.posix.join(relativePath, index.oak),
path.join(relativePath, index.oak),
),
);
fileText.push(`oak:$${routeId}`);
Expand All @@ -346,7 +346,7 @@ function routerFileData(
nextRouteId,
} = routerFileData(
routeId,
path.posix.join(relativePath, name),
path.join(relativePath, name),
childRoute,
);
importLines.push(...childImportLines);
Expand Down
Loading