Skip to content

Commit

Permalink
Merge pull request #1 from greasify/dev
Browse files Browse the repository at this point in the history
feat: dev
  • Loading branch information
crashmax-dev authored Sep 9, 2024
2 parents 7b2c64d + 2054ad9 commit 8205807
Show file tree
Hide file tree
Showing 107 changed files with 5,654 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: NPM Publish

on:
push:
branches:
- master

permissions:
id-token: write

jobs:
cache-and-install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install pnpm
uses: pnpm/action-setup@v4
id: pnpm-install
with:
version: 9
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm build

- name: Publish packages
shell: bash
run: |
echo "//registry.npmjs.org/:_authToken="${{ secrets.NPM_TOKEN }}"" > ~/.npmrc
pnpm publish --access public
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
1 change: 1 addition & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@crashmax/prettier-config')
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
# create-greasify
## Scaffolding your first userscript project

```sh
npm create greasify
```

```sh
yarn create greasify
```

```sh
pnpm create greasify
```

## The supported template presets are

| TypeScript | JavaScript |
| ----------------------------------- | ----------------------------- |
| [vanilla-ts](/templates/vanilla-ts) | [vanilla](/templates/vanilla) |
| [reatom-ts](/templates/reatom-ts) | [reatom](/templates/reatom) |
| [solid-ts](/templates/solid-ts) | [solid](/templates/solid) |
| [preact-ts](/templates/preact-ts) | [preact](/templates/preact) |
47 changes: 47 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "create-greasify",
"description": "Create a greasify userscript project.",
"version": "0.0.0",
"type": "module",
"bin": {
"create-greasify": "./dist/bin.js"
},
"files": [
"dist",
"templates",
"!templates/*/node_modules",
"!templates/*/dist"
],
"keywords": [
"cli",
"create",
"vite",
"userscript",
"templates"
],
"scripts": {
"start": "pnpm build && node dist/bin.js",
"dev": "tsup --watch",
"build": "tsup",
"build:templates": "pnpm build && pnpm -r --filter=./templates/* run build",
"format": "prettier --write src",
"format:templates": "pnpm -r --filter=./templates/* run format",
"type-check": "tsc --noEmit",
"create-greasify": "pnpm build && node dist/bin.js"
},
"devDependencies": {
"@crashmax/prettier-config": "5.0.2",
"@crashmax/tsconfig": "2.2.0",
"@octokit/types": "13.5.0",
"@types/minimist": "1.2.5",
"@types/node": "20.10.4",
"@types/prompts": "2.4.9",
"tsup": "8.2.4",
"typescript": "5.5.4"
},
"dependencies": {
"kolorist": "1.8.0",
"minimist": "1.2.8",
"prompts": "2.4.2"
}
}
Loading

0 comments on commit 8205807

Please sign in to comment.