Skip to content

Commit

Permalink
Merge pull request #1 from NxtLvLSoftware/dev-to-dist
Browse files Browse the repository at this point in the history
Merge dev changes to dist
  • Loading branch information
JackNoordhuis authored Sep 12, 2023
2 parents ac8bfd5 + c78651c commit ccb9acf
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 75 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CI

on:
push:
branches: [dev, dist]

permissions:
contents: read

env:
GITHUB_ACTIONS: true

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
fail-fast: true
matrix:
node-version: [18]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}}-${{ matrix.node-version }}-node_modules-${{ hashFiles('package.json') }}

- name: Install dependencies
run: npm install

- name: Build alpine-typescript
run: npm run build-ci

stage:
name: Stage changes as pull request
needs: [test]
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
fail-fast: true
matrix:
node-version: [18]

if: github.ref == 'refs/heads/dev'
steps:
- run: 'echo "Staging dev changes"'
- uses: actions/checkout@v3
with:
ref: dist

- name: Reset branch
run: |
git fetch origin dev:dev
git reset --hard dev
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}}-${{ matrix.node-version }}-node_modules-${{ hashFiles('package.json') }}

- name: Install dependencies
run: npm install

- name: Build alpine-typescript
run: npm run build-ci

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.STAGE_DEPLOY_KEY }}
title: Merge dev changes to dist
branch: dev-to-dist
assignees: JackNoordhuis
67 changes: 67 additions & 0 deletions .github/workflows/pages-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Publish Pages

on:
push:
branches: [dist]

permissions:
contents: write

env:
GITHUB_ACTIONS: true

jobs:
build:
name: Generate site
runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
fail-fast: true
matrix:
node-version: [18]

steps:
- uses: actions/checkout@v4

- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}}-${{ matrix.node-version }}-node_modules-${{ hashFiles('package.json') }}

- name: Install dependencies
run: npm install

- name: Build alpine-typescript
run: npm run docs-ci

- name: Fix permissions
run: |
chmod -c -R +rX "./docs-build" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- uses: actions/upload-pages-artifact@v2
with:
name: github-pages
path: ./docs-build

publish:
name: Publish
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 5

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
23 changes: 0 additions & 23 deletions .github/workflows/publish-tsc-build.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/tsc-build.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package-lock.json
/node_modules
.github/**/node_modules
docs-build/

## Make sure tsc output isn't included in development branches
*.d.ts
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./.github/banner-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="./.github/banner-light.svg">
<img alt="Project Banner (@nxtlvlsoftware/alpine-typescript)" src="./.github/banner-light.svg" width="350" height="160" style="max-width: 100%;">
</picture>
<a href="https://nxtlvlsoftware.github.io/alpine-typescript/"><picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NxtLvLSoftware/alpine-typescript/dist/.github/banner-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/NxtLvLSoftware/alpine-typescript/dist/.github/banner-light.svg">
<img alt="Project Banner (@nxtlvlsoftware/alpine-typescript)" src="https://raw.githubusercontent.com/NxtLvLSoftware/alpine-typescript/dist/.github/.github/banner-light.svg" width="350" height="160" style="max-width: 100%;">
</picture></a>
</p>

<h1 align="center">
Expand Down Expand Up @@ -309,7 +309,7 @@ Alpine itself is very flexible with what it considers a component so this packag
limitations. The only requirement imposed is the initial state of your component must be returned by some
kind of constructor function.

See Alpine's [x-data documentation](https://alpinejs.dev/globals/alpine-data) for more information.
See Alpine's [Alpine.data() documentation](https://alpinejs.dev/globals/alpine-data) for more information.

##### Generic Types
Any function that satisfies this type requirement:
Expand Down Expand Up @@ -396,8 +396,7 @@ Guide
#### Issues
Found a problem with this project? Make sure to open an issue on
the [issue tracker](https://github.com/NxtLvLSoftware/alpine-typescript/issues)
Found a problem with this project? Make sure to open an issue on the [issue tracker](https://github.com/NxtLvLSoftware/alpine-typescript/issues)
and we'll do our best to get it sorted!
## License Information
Expand All @@ -406,7 +405,7 @@ and we'll do our best to get it sorted!
freely available to use under the terms of the
[MIT License](https://www.techtarget.com/whatis/definition/MIT-License-X11-license-or-MIT-X-license).
__A full copy of the license is available [here](../LICENSE).__
__A full copy of the license is available [here](https://github.com/NxtLvlSoftware/alpine-typescript/blob/dev/LICENSE).__
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
"files": [
"README.md",
"LICENSE",
"src/*",
"index.ts",
"src/**/*.d.ts",
"src/**/*.js",
"index.d.ts",
"index.js"
],
"scripts": {
"build": "tsc -p ./",
"dev": "tsc --watch -p ./"
"build": "tsc --inlineSources --removeComments -p ./",
"build-ci": "tsc --pretty false --inlineSourceMap --removeComments --listEmittedFiles -p ./",
"dev": "tsc --watch -p ./",
"docs": "npx typedoc --out docs-build --cacheBust index.ts",
"docs-ci": "npx typedoc --gitRemote dist --out docs-build --cacheBust index.ts"
},
"keywords": [
"alpine",
Expand All @@ -27,6 +30,7 @@
"@types/alpinejs": "^3.7.2"
},
"devDependencies": {
"typedoc": "^0.25.1",
"typescript": "^5.1.6"
}
}
11 changes: 11 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"navigationLinks": {
"GitHub": "https://github.com/NxtLvlSoftware/alpine-typescript",
"Twitter": "https://twitter.com/NxtLvlSoftware"
},
"sidebarLinks": {
"GitHub": "https://github.com/NxtLvlSoftware/alpine-typescript",
"Twitter": "https://twitter.com/NxtLvlSoftware",
"Home": "/index.html"
}
}

0 comments on commit ccb9acf

Please sign in to comment.