Skip to content

Commit 8844669

Browse files
committed
convert to @webxdc/create-vite-plugins
1 parent 417f2d6 commit 8844669

File tree

25 files changed

+694
-87
lines changed

25 files changed

+694
-87
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
name: CI
22

33
on:
4-
pull_request:
5-
branches:
6-
- master
7-
- main
84
push:
95
branches:
10-
- master
116
- main
7+
- master
128
tags:
139
- "v*.*.*"
10+
pull_request:
11+
branches:
12+
- main
13+
- master
1414

1515
jobs:
16-
build:
16+
test:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20.x
23+
registry-url: "https://registry.npmjs.org"
2024
- run: npm install -g pnpm
21-
- run: pnpm i
25+
- run: pnpm install
2226
- run: pnpm check
23-
- run: pnpm build
24-
25-
- name: Release
26-
uses: softprops/action-gh-release@v2
27+
- name: Publish package to NPM
2728
if: startsWith(github.ref, 'refs/tags/v')
28-
with:
29-
token: ${{ secrets.GITHUB_TOKEN }}
30-
body: |
31-
Auto-generated release
32-
prerelease: ${{ contains(github.event.ref, '-beta') }}
33-
fail_on_unmatched_files: true
34-
files: ./dist-xdc/*.xdc
29+
run: npm publish --access public
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ pnpm-debug.log*
33
.pnpm-debug.log
44

55
node_modules
6-
dist
7-
dist-xdc
86

97
# Editor directories and files
108
.vscode/*

.prettierignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
dist
2-
dist-xdc
31
pnpm-lock.yaml

README.md

Lines changed: 28 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,49 @@
1-
# WebXDC Vite Template [![CI](https://github.com/webxdc/webxdc-vite/actions/workflows/ci.yml/badge.svg)](https://github.com/webxdc/webxdc-vite/actions/workflows/ci.yml) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
1+
# Webxdc Vite Template
22

3-
A minimalist Vite project template for [WebXDC](https://webxdc.org) development.
3+
[![npm package](https://img.shields.io/npm/v/@webxdc/create-vite-plugins.svg)](https://npmjs.com/package/@webxdc/create-vite-plugins)
4+
[![CI](https://github.com/webxdc/create-vite-plugins/actions/workflows/ci.yml/badge.svg)](https://github.com/webxdc/create-vite-plugins/actions/workflows/ci.yml)
5+
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
46

5-
## Features
7+
Vite project template scaffolding for [Webxdc](https://webxdc.org) development.
68

7-
- ⚡️ Fast development with [Vite](https://github.com/vitejs/vite) and [pnpm](https://pnpm.js.org/)
9+
## Scaffolding Your First Vite Project
810

9-
- 📱 Integrated [WebXDC emulator](https://github.com/webxdc/webxdc-dev) to test your WebXDC right on the browser while developing,
10-
and [Eruda](https://github.com/liriliri/eruda) to debug inside Delta Chat.
11+
With NPM:
1112

12-
- 📝 Code formatting with [Prettier](https://github.com/prettier/prettier)
13-
14-
- 📦 Automatically minify, build and release your `.xdc` file
15-
16-
- 🦕 Automatically support legacy/old browsers
17-
18-
## Usage
19-
20-
### Installing Dependencies
21-
22-
After cloning this repo, install dependecies:
23-
24-
```
25-
pnpm i
13+
```bash
14+
$ npm create @webxdc/vite-plugins@latest
2615
```
2716

28-
### Checking code format
17+
With PNPM:
2918

19+
```bash
20+
$ pnpm create @webxdc/vite-plugins
3021
```
31-
pnpm check
32-
```
33-
34-
### Testing the app in the browser
3522

36-
To test your work in your browser (with hot reloading!) while developing:
23+
With Yarn:
3724

38-
```
39-
pnpm start
40-
# Alternatively to test in a more advanced WebXDC emulator:
41-
pnpm emulator
25+
```bash
26+
$ yarn create @webxdc/vite-plugins
4227
```
4328

44-
### Building
29+
Then follow the prompts!
4530

46-
To package the WebXDC file:
31+
You can also directly specify the project name and the template you want to use via additional command line options. For example, to scaffold a Webxdc + TypeScript project, run:
4732

48-
```
49-
pnpm build
50-
```
33+
```bash
34+
# npm 7+, extra double-dash is needed:
35+
npm create @webxdc/vite-plugins@latest my-app -- --template vanilla-ts
5136

52-
To package the WebXDC with developer tools inside to debug in Delta Chat, set the `NODE_ENV`
53-
environment variable to "debug":
37+
# pnpm
38+
pnpm create @webxdc/vite-plugins my-app --template vanilla-ts
5439

40+
# yarn
41+
yarn create @webxdc/vite-plugins my-app --template vanilla-ts
5542
```
56-
NODE_ENV=debug pnpm build
57-
```
58-
59-
The resulting optimized `.xdc` file is saved in `dist-xdc/` folder.
6043

61-
### Releasing
62-
63-
To automatically build and create a new GitHub release with the `.xdc` file:
64-
65-
```
66-
git tag -a v1.0.1
67-
git push origin v1.0.1
68-
```
44+
Currently supported template presets include:
6945

70-
## Try it now!
46+
- `vanilla`
47+
- `vanilla-ts`
7148

72-
[**Create a repo from this template on GitHub**](https://github.com/webxdc/webxdc-vite/generate).
49+
You can use `.` for the project name to scaffold in the current directory.

0 commit comments

Comments
 (0)