Skip to content

Commit

Permalink
build: use yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
DSergiu committed Apr 11, 2024
1 parent 389ae33 commit 1c5ac1d
Show file tree
Hide file tree
Showing 12 changed files with 5,886 additions and 8,298 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
name: CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
name: 'Build - Test - [Publish]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.13'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn test
node-version-file: '.nvmrc'
cache: 'pnpm'
- run: pnpm setup
- run: pnpm build
- run: pnpm test
- run: cp README.md packages/vanilla-hcaptcha
- name: 'Publish'
if: contains('refs/heads/master', github.ref)
run: lerna publish -y from-package
run: pnpm --filter=@hcaptcha/vanilla-hcaptcha publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
MIT License

Copyright (c) 2024 hCaptcha

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
A Vanilla Web Component wrapper for [hCaptcha](https://docs.hcaptcha.com/).
It allows for easy integration with hCaptcha in many modern web frameworks.

<img width="300px" src="https://assets-global.website-files.com/5c73e7ea3f8bb2a85d2781db/5c73e7ea3f8bb23b4c278261_hcaptcha-logo-landscape.svg" alt="hCaptcha logo" title="hCaptcha logo" />
<img width="300px" src="https://www.hcaptcha.com/hosted-assets/3u1Osx9BvMjYSHbCn6ECWNM27toZY1eqxXveJVL4mMNGUtMZu2Yc6GAid43jA_TmZApJ6djyh0iqvu-YNhOB9hGmvfdy4M_Fr1Y61EZQ-j1oIjD1MF0k1dN99xXVRKV0EpBi03o3AMgo_p4Lk3A49jwtvuitT9AAAAAAAAAAAAAAAAA/64da82f6bf67de1b12789030/64da82f6bf67de1b1278903b_Asset%208.svg" alt="hCaptcha logo" title="hCaptcha logo" />

**0** dependencies. **<1kb** gzipped. Integrates well with Vue.JS, React, Preact, Angular, etc.

Expand All @@ -15,13 +15,17 @@ Use your favorite package manager:
yarn add vanilla-hcaptcha
```

```bash
pnpm add vanilla-hcaptcha
```

```bash
npm install vanilla-hcaptcha
```

Or via cdn:
```html
<script src="https://cdn.jsdelivr.net/npm/vanilla-hcaptcha"></script>
<script src="https://cdn.jsdelivr.net/npm/hCaptcha/vanilla-hcaptcha"></script>
```

## Usage
Expand Down Expand Up @@ -126,7 +130,7 @@ mainstream web frameworks such as: React, Preact, Vue.js, Angular, Stencil.js, e
<html ng-app="angularjsApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanilla-hcaptcha"></script>
<script src="https://cdn.jsdelivr.net/npm/@hcaptcha/vanilla-hcaptcha"></script>
<script>
angular.module('angularjsApp', [])
Expand Down Expand Up @@ -160,7 +164,7 @@ mainstream web frameworks such as: React, Preact, Vue.js, Angular, Stencil.js, e

```html
<script src="https://cdn.jsdelivr.net/npm/vanilla-hcaptcha"></script>
<script src="https://cdn.jsdelivr.net/npm/@hcaptcha/vanilla-hcaptcha"></script>
<h-captcha id="signupCaptcha"
site-key="781559eb-513a-4bae-8d29-d4af340e3624"
Expand Down Expand Up @@ -241,11 +245,11 @@ The following methods allow for programmatic control, necessary only in case of

## Commands

* `yarn build`
* `pnpm build`
> Build a production version of the component.

* `yarn dev`
* `pnpm dev`
> Build dev version with hot reload.

* `yarn test`
* `pnpm test`
> Runs unit tests.
2 changes: 1 addition & 1 deletion examples/cdn/angularjs.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Demo hCaptcha Web Component - Angular</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>

<!-- <script src="https://cdn.jsdelivr.net/npm/vanilla-hcaptcha" async defer></script>-->
<!-- <script src="https://cdn.jsdelivr.net/npm/@hcaptcha/vanilla-hcaptcha" async defer></script>-->
<script src="/node_modules/vanilla-hcaptcha/dist/index.min.js"></script>

<script>
Expand Down
2 changes: 1 addition & 1 deletion examples/cdn/vanilla.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<div>Open the console!</div>

<!-- <script src="https://cdn.jsdelivr.net/npm/vanilla-hcaptcha" async defer></script>-->
<!-- <script src="https://cdn.jsdelivr.net/npm/@hcaptcha/vanilla-hcaptcha" async defer></script>-->
<script src="/node_modules/vanilla-hcaptcha/dist/index.min.js"></script>

<h-captcha id="signupCaptcha"
Expand Down
2 changes: 1 addition & 1 deletion examples/cdn/vue.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Demo hCaptcha Web Component - Vue 2</title>
<script src="https://unpkg.com/[email protected]"></script>

<!-- <script src="https://cdn.jsdelivr.net/npm/vanilla-hcaptcha"></script>-->
<!-- <script src="https://cdn.jsdelivr.net/npm/@hcaptcha/vanilla-hcaptcha"></script>-->
<script src="/node_modules/vanilla-hcaptcha/dist/index.min.js"></script>
</head>
<body>
Expand Down
10 changes: 0 additions & 10 deletions lerna.json

This file was deleted.

16 changes: 5 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,20 @@
"name": "vanilla-hcaptcha",
"description": "Vanilla Web Component for hCaptcha. 0 dependencies. <1kb gzipped.",
"version": "1.0.2",
"workspaces": {
"packages": [
"packages/*",
"examples/*"
],
"nohoist": [ "**/vanilla-hcaptcha" ]
},
"author": {
"name": "Sergiu Danalachi <[email protected]>",
"url": "https://github.com/DSergiu"
},
"packageManager": "[email protected]",
"private": true,
"license": "MIT",
"scripts": {
"dev": "lerna run dev --stream",
"build": "lerna run build --stream",
"test": "lerna run test --stream"
"setup": "pnpm install --frozen-lockfile --prefer-offline",
"dev": "pnpm -r --stream run dev",
"build": "pnpm -r --stream run build",
"test": "pnpm --r -stream run test"
},
"devDependencies": {
"lerna": "^4.0.0",
"serve": "^13.0.2"
}
}
21 changes: 14 additions & 7 deletions packages/vanilla-hcaptcha/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
{
"name": "vanilla-hcaptcha",
"name": "@hcaptcha/vanilla-hcaptcha",
"description": "Vanilla Web Component for hCaptcha. 0 dependencies. <1kb gzipped.",
"version": "1.0.2",
"main": "dist/index.min.js",
"types": "dist/hcaptcha.d.ts",
"author": {
"name": "Sergiu Danalachi <[email protected]>",
"url": "https://github.com/DSergiu"
"author": "hCaptcha team and contributors",
"homepage": "https://github.com/hCaptcha/vanilla-hcaptcha",
"organization": "hCaptcha",
"license": "MIT",
"private": false,
"publishConfig": {
"registry":"https://registry.npmjs.org",
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/hCaptcha/vanilla-hcaptcha.git",
"web": "https://github.com/hCaptcha/vanilla-hcaptcha"
},
"files": [
"dist",
"src",
"demo.html"
],
"homepage": "https://github.com/DSergiu/vanilla-hcaptcha",
"private": false,
"license": "MIT",
"scripts": {
"dev": "rollup -c -w",
"build": "rollup -c",
Expand Down
Loading

0 comments on commit 1c5ac1d

Please sign in to comment.