Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
feat!: refactor templates, remove js and update dependencies (#48)
Browse files Browse the repository at this point in the history
* refactor generator

* fix: format

* Update nodejs.yml

* update scripts

* Update generator-template.test.js

* chore: add changeset

* chore: enable changeset

* Update pnpm-lock.yaml

* Update changesets.yml

* Update generator-template.test.js
  • Loading branch information
juanpicado authored Jun 7, 2022
1 parent b6e32ac commit 9e00210
Show file tree
Hide file tree
Showing 66 changed files with 9,113 additions and 10,316 deletions.
14 changes: 14 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
[
"@babel/env",
{
"targets": {
"node": 12
}
}
],
"@babel/typescript"
],
"ignore": ["**/*.d.ts"]
}
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/master/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@1.7.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
6 changes: 6 additions & 0 deletions .changeset/early-ads-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"generator-verdaccio-plugin": major
---

feat: refactor templates, remove js and update dependencies

8 changes: 8 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mode": "pre",
"tag": "next",
"initialVersions": {
"generator-verdaccio-plugin": "3.0.1"
},
"changesets": []
}
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
generators/app/*.js
coverage/
coverage/
build/*
22 changes: 0 additions & 22 deletions .eslintrc

This file was deleted.

96 changes: 96 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
module.exports = {
'extends': [
'eslint:recommended',
'google',
'plugin:jest/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
'plugins': ['prettier', 'import'],
'env': {
'es6': true,
'node': true,
'jest': true,
},
'parserOptions': {
'allowImportExportEverywhere': true,
'sourceType': 'module',
'ecmaVersion': 11,
'ecmaFeatures': {
'impliedStrict': true,
},
},
'settings': {
'import/resolver': {
'node': {
'extensions': ['.js', '.ts'],
},
},
},
'parser': '@typescript-eslint/parser',
'rules': {
'jest/no-export': 0,
'jest/no-test-callback': 0,
'jest/expect-expect': 0,
'jest/no-try-expect': 0,
'jest/no-done-callback': 'off',
'jest/no-conditional-expect': 'off',
// rules to fix
'jest/no-identical-title': ['warn'],
'jest/no-disabled-tests': ['warn'],
'jest/no-commented-out-tests': ['warn'],
'curly': ['error', 'all'],
'keyword-spacing': 'off',
'no-tabs': 'off',
'no-useless-escape': 'off',
'padded-blocks': 'off',
'require-jsdoc': 'off',
'valid-jsdoc': 'off',
'eol-last': 'error',
'no-irregular-whitespace': 'error',
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
'no-trailing-spaces': 'error',
'camelcase': 'off',
'guard-for-in': 'error',
'new-cap': 'error',
// disabled in favor of @typescript-eslint/no-unused-vars
'no-unused-vars': 'off',
'max-len': ['error', 110],
'no-console': ['error', {allow: ['warn']}],
'no-constant-condition': 'error',
'no-debugger': 'error',
'no-empty': 'error',
'no-fallthrough': 'error',
'no-invalid-this': 'error',
'no-new-require': 'error',
'no-undef': 'error',
'no-unreachable': 'error',
'no-var': 'error',
'one-var': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'handle-callback-err': 0,
'prefer-const': 0,
// typescript
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-this-alias': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/array-type': ['error'],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/indent': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
// rules to fix
'prefer-promise-reject-errors': ['warn'],

'@typescript-eslint/prefer-optional-chain': ['warn'],
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-unused-vars': ['error'],
},
};
63 changes: 63 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Changesets

on:
schedule:
- cron: '0 0 * * *'

push:
branches:
- master

env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store

jobs:
# Update package versions from changesets.
version:
timeout-minutes: 14
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.repository == 'verdaccio/verdaccio'
steps:
- name: checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}

- name: install pnpm
run: npm i pnpm@6.32.15 -g
env:
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}

- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: setup pnpm config registry
run: pnpm config set registry https://registry.npmjs.org

- name: install dependencies
run: pnpm install
env:
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
- name: build
run: pnpm build

- name: create versions
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: 'chore: update versions'
title: 'chore: update versions'
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.REGISTRY_AUTH_TOKEN }}
NPM_CONFIG_REGISTRY: https://registry.npmjs.org
26 changes: 17 additions & 9 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x]
node-version: [12, 14, 16, 17, 18]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
yarn install
yarn lint
yarn build
yarn test
- name: Install pnpm
run: npm i pnpm@6.32.15 -g
- uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
- name: install
run: pnpm install
- name: lint
run: pnpm run lint
- name: build
run: pnpm build
- name: test
run: pnpm test
env:
CI: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ coverage
generators/app/*.js
yarn-error.log
.idea/*
/build/*
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
lib
build/*
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
# Verdaccio plugin generator

**DEPRECATED** Repository unmaintained, please don't use it anymore. It will be archived soon.
[![NPM version][npm-image]][npm-url]
[![Dependency Status][daviddm-image]][daviddm-url]
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=verdaccio/generator-verdaccio-plugin)](https://dependabot.com)
[![DevDependencies](https://david-dm.org/verdaccio/generator-verdaccio-plugin/master/dev-status.svg)](https://david-dm.org/verdaccio/generator-verdaccio-plugin/master?type=dev)
[![License](https://img.shields.io/github/license/verdaccio/generator-verdaccio-plugin)](./LICENSE)

[![Backers](https://opencollective.com/verdaccio/tiers/backer/badge.svg?label=Backer&color=brightgreen)](https://opencollective.com/verdaccio)
[![Stackshare](https://img.shields.io/badge/Follow%20on-StackShare-blue.svg?logo=stackshare&style=flat)](https://stackshare.io/verdaccio)
[![Discord](https://img.shields.io/discord/388674437219745793?logo=discord)](http://chat.verdaccio.org/)
[![Twitter followers](https://img.shields.io/twitter/follow/verdaccio_npm.svg?style=social&label=Follow)](https://twitter.com/verdaccio_npm)

Verdaccio plugin generator based in [Yeoman](http://yeoman.io) aims to help to scaffold plugins development

### Maintainers

* [Anix](https://github.com/anikethsaha)
* [Juan Picado](https://github.com/juanpicado)

## Installation

First, install [Yeoman](http://yeoman.io) and generator-verdaccio-plugin using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

```bash
npm install -g yo
npm install -g generator-verdaccio-plugin
```

Then generate your new project:

```bash
yo verdaccio-plugin
```

## Plugin Types Supported

- Authentication
- Storage
- Middleware


## License

MIT © [Juan Picado <@jotadeveloper>]()

[npm-image]: https://badge.fury.io/js/generator-verdaccio-plugin.svg
[npm-url]: https://npmjs.org/package/generator-verdaccio-plugin
[daviddm-image]: https://david-dm.org/verdaccio/generator-verdaccio-plugin.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/verdaccio/generator-verdaccio-plugin
Loading

0 comments on commit 9e00210

Please sign in to comment.