Skip to content

Commit

Permalink
changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
sjc5 committed Oct 21, 2023
1 parent 5b07737 commit e3b006e
Show file tree
Hide file tree
Showing 29 changed files with 2,054 additions and 2,434 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["hwy", "create-hwy", "@hwy-js/*"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
8 changes: 8 additions & 0 deletions .changeset/friendly-books-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"create-hwy": patch
"@hwy-js/build": patch
"hwy": patch
"@hwy-js/dev": patch
---

test
11 changes: 11 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"@hwy-js/build": "0.4.0-beta.33",
"hwy": "0.4.0-beta.33",
"create-hwy": "0.4.0-beta.33",
"@hwy-js/dev": "0.4.0-beta.33"
},
"changesets": []
}
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI
on:
push:
branches:
- "**"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- run: pnpm run lint && pnpm run build
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish
on:
workflow_run:
workflows: ["CI"]
types:
- completed
push:
branches:
- "main"

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
- uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "pnpm"

- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions CHANGESETS_DIRECTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Pre-release workflow

https://github.com/changesets/changesets/blob/main/docs/prereleases.md
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"@hono/node-server": "^1.2.0",
"highlight.js": "^11.8.0",
"hono": "^3.7.5",
"hwy": "0.4.0-beta.33"
"hwy": "workspace:*"
},
"devDependencies": {
"@hwy-js/build": "0.4.0-beta.33",
"@hwy-js/dev": "0.4.0-beta.33",
"@hwy-js/build": "workspace:*",
"@hwy-js/dev": "workspace:*",
"@types/node": "^20.8.3",
"@types/nprogress": "^0.2.1",
"htmx.org": "^1.9.6",
Expand Down
5 changes: 0 additions & 5 deletions docs/src/pages/_index.client.ts

This file was deleted.

5 changes: 1 addition & 4 deletions docs/src/pages/_index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import { ListItem, UnorderedList } from "../components/unordered-list.js";
export default function () {
return (
<>
<h1
class="text-3xl lg:text-4xl leading-snug lg:leading-normal opacity-[0.95] py-6"
id="test"
>
<h1 class="text-3xl lg:text-4xl leading-snug lg:leading-normal opacity-[0.95] py-6">
Hwy is a <Boldtalic>simple</Boldtalic>,{" "}
<Boldtalic>lightweight</Boldtalic>, and <Boldtalic>flexible</Boldtalic>{" "}
web framework, built on <Boldtalic>Hono</Boldtalic> and{" "}
Expand Down
1 change: 1 addition & 0 deletions docs/src/pages/jeff/_index.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alert("bob");
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@
"build:dev": "pnpm -r --filter @hwy-js/dev run build",
"build:create-hwy": "pnpm -r --filter create-hwy run build",
"build": "npm run build:build && npm run build:dev && npm run build:core && npm run build:create-hwy",
"lint:build": "pnpm -r --filter @hwy-js/build run lint",
"lint:core": "pnpm -r --filter hwy run lint",
"lint:dev": "pnpm -r --filter @hwy-js/dev run lint",
"lint:create-hwy": "pnpm -r --filter create-hwy run lint",
"lint": "npm-run-all --parallel lint:*",
"dev:build": "pnpm -r --filter @hwy-js/build run dev",
"dev:core": "pnpm -r --filter hwy run dev",
"dev:dev": "pnpm -r --filter @hwy-js/dev run dev",
"dev": "npm-run-all --parallel dev:*",
"publish-beta": "pnpm run build && pnpm -r publish-beta"
},
"devDependencies": {
"@changesets/cli": "^2.26.2",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3"
"prettier": "^3.0.3",
"typescript": "^5.2.2"
},
"prettier": {}
}
1 change: 1 addition & 0 deletions packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"scripts": {
"build": "rm -rf dist && tsup-node index.ts --format esm --dts",
"lint": "tsc",
"dev": "rm -rf dist && tsup-node index.ts --format esm --dts --watch --sourcemap",
"publish-beta": "npm publish --tag beta"
},
Expand Down
17 changes: 14 additions & 3 deletions packages/build/src/run-build-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ async function handle_prebuild({ is_dev }: { is_dev: boolean }) {
}
}

let is_first_run = true;

async function runBuildTasks({ log, isDev }: { isDev: boolean; log?: string }) {
hwyLog(`New build initiated${log ? ` (${log})` : ""}`);

Expand All @@ -68,9 +70,18 @@ async function runBuildTasks({ log, isDev }: { isDev: boolean; log?: string }) {

const standard_tasks_p0 = performance.now();

await fs.promises.mkdir(path.join(process.cwd(), "dist"), {
recursive: true,
});
const dist_path = path.join(process.cwd(), "dist");

if (is_first_run) {
is_first_run = false;

if (fs.existsSync(dist_path)) {
hwyLog("Removing old dist folder...");
fs.rmSync(dist_path, { recursive: true, force: true });
}
}

await fs.promises.mkdir(dist_path, { recursive: true });

// needs to happen once first pre-css bundling
await generate_public_file_map();
Expand Down
4 changes: 2 additions & 2 deletions packages/build/src/walk-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function walk_pages() {
endsInSplat: boolean;
endsInDynamic: boolean;
hasSiblingClientFile: boolean;
filename: string;
fileRefFromPagesDirWithJsExt: string;
}[] = [];

for await (const entry of readdirp(path.resolve("./src/pages"))) {
Expand Down Expand Up @@ -127,7 +127,7 @@ async function walk_pages() {
endsInSplat: segments[segments.length - 1].isSplat,
endsInDynamic: segments[segments.length - 1].isDynamic,
hasSiblingClientFile: has_sibling_client_file,
filename: _path + ".js",
fileRefFromPagesDirWithJsExt: _path + ".js",
});
}

Expand Down
1 change: 1 addition & 0 deletions packages/build/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"noImplicitAny": true,
"skipLibCheck": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
},
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"scripts": {
"build": "rm -rf dist && tsup-node index.ts --format esm --dts",
"lint": "tsc",
"dev": "rm -rf dist && tsup-node index.ts --format esm --dts --watch --sourcemap",
"publish-beta": "npm publish --tag beta"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/components/client-entry-script.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ function ClientScripts({

{activePathData.matchingPaths
?.filter((x) => {
if (x.hasSiblingClientFile) {
console.log("hasSiblingClientFile", x);
}
return x.hasSiblingClientFile;
})
.map((x) => {
return (
<script
key={x.path}
src={getPublicUrl("dist/pages/" + x.filename)}
src={getPublicUrl("dist/pages/" + x.fileRefFromPagesDirWithJsExt)}
{...{ [pageStrategy]: true }}
/>
);
Expand Down
1 change: 1 addition & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"noImplicitAny": true,
"skipLibCheck": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/create-hwy/__common/pages/__auth/login.page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DataFunctionArgs, PageProps } from "hwy";
import type { DataFunctionArgs, PageProps } from "hwy";
import { extractSimpleFormData } from "../../utils/extract-simple-form-data.js";

export async function action({ c }: DataFunctionArgs) {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-hwy/__common/pages/about.page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PageProps } from "hwy";
import type { PageProps } from "hwy";

export default async function ({ outlet }: PageProps) {
return (
Expand Down
1 change: 1 addition & 0 deletions packages/create-hwy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
],
"scripts": {
"build": "rm -rf dist && tsup-node index.ts --format esm",
"lint": "tsc",
"create-hwy": "pnpm run build && node dist/index.js",
"publish-beta": "npm publish --tag beta"
},
Expand Down
1 change: 1 addition & 0 deletions packages/create-hwy/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"noImplicitAny": true,
"skipLibCheck": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
},
Expand Down
1 change: 1 addition & 0 deletions packages/dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"scripts": {
"build": "rm -rf dist && tsup-node index.ts --format esm --dts",
"lint": "tsc",
"dev": "rm -rf dist && tsup-node index.ts --format esm --dts --watch --sourcemap",
"publish-beta": "npm publish --tag beta"
},
Expand Down
1 change: 1 addition & 0 deletions packages/dev/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"noImplicitAny": true,
"skipLibCheck": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
},
Expand Down
Loading

0 comments on commit e3b006e

Please sign in to comment.