Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Nov 29, 2023
0 parents commit c53ff28
Show file tree
Hide file tree
Showing 23 changed files with 5,693 additions and 0 deletions.
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/main/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/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
33 changes: 33 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,json,html,css,scss,sass}]
charset = utf-8

# 4 space indentation
[*.{js,html,css,scss,sass}]
indent_style = space
indent_size = 4

# 2 space indentation
[*.{json,yml,yaml}]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
indent_size = 4

# Allow trailing whitespaces in markdown for new line statements
[*.{md,markdown}]
trim_trailing_whitespace = false
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
.changeset
node_modules
/dist
/types
/node_modules
CHANGELOG.md
LICENSE.md

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@chialab/eslint-config"
}
41 changes: 41 additions & 0 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Lint and Test
on:
workflow_call:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install

- name: Run build script
run: yarn build

lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install

- name: Lint
run: yarn lint
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Main
on:
workflow_dispatch:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
lint-test:
uses: ./.github/workflows/lint_test.yml
secrets: inherit

release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 10
needs:
- lint-test
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
cache: yarn

- name: Install project dependencies
run: yarn install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Pull Request
on:
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-test:
uses: ./.github/workflows/lint_test.yml
secrets: inherit
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.pnp.*
.yarn/*
/node_modules
/types
/dist
tsconfig.tsbuildinfo
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
.changeset
node_modules
/dist
/types
/node_modules
CHANGELOG.md
LICENSE.md

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
33 changes: 33 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"editor.formatOnSave": true,
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Chialab

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
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Plasma

Generate Custom Elements wrappers for Angular, React, Svelte and Vue.

## Installation

```
npm i -D @chialab/plasma
```

## Usage

Run plasma in the current directory. It will autodetect closest `package.json` to use for wrappers generation.

```
npm run plasma
```

### Options

```
npm run plasma --help
Usage: plasma [options] <input>
Generate Custom Elements wrappers for Angular, React, Svelte and Vue.
Arguments:
input Package.json path
Options:
-V, --version output the version number
-o, --outdir <outdir> Output directory
-y, --yes Convert all candidates to all available frameworks
-h, --help display help for command
```

---

## License

**Plasma** is released under the [MIT](https://github.com/chialab/plasma/blob/main/LICENSE) license.
61 changes: 61 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "@chialab/plasma",
"version": "0.1.0",
"description": "Generate Custom Elements wrappers for Angular, React, Svelte and Vue.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": "./bin/cli.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"files": [
"dist",
"types",
"README.md",
"LICENSE"
],
"keywords": [
"dna",
"web-components",
"angular",
"react",
"svelte",
"vue"
],
"author": "Chialab <[email protected]> (https://www.chialab.it)",
"repository": {
"type": "git",
"url": "https://github.com/chialab/plasma"
},
"license": "MIT",
"scripts": {
"clear": "rimraf 'dist' 'types' 'tsconfig.tsbuildinfo'",
"build": "yarn clear && tsc -b && esbuild src/index.ts src/cli.ts --outdir=dist --bundle --platform=node --format=cjs",
"lint": "prettier --check . && eslint .",
"prepack": "yarn build && publint"
},
"dependencies": {
"type-fest": "^4.8.2"
},
"devDependencies": {
"@changesets/cli": "^2.22.0",
"@chialab/eslint-config": "^4.0.0",
"@chialab/prettier-config": "^1.2.0",
"@types/prompts": "^2.4.9",
"chalk": "^5.3.0",
"commander": "^11.1.0",
"custom-elements-manifest": "^2.0.0",
"esbuild": "^0.19.8",
"eslint": "^8.0.0",
"listr2": "^7.0.2",
"prettier": "^3.0.0",
"prompts": "^2.4.0",
"publint": "^0.2.5",
"rimraf": "^5.0.0",
"typescript": "^5.0.0"
}
}
7 changes: 7 additions & 0 deletions prettier.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-env node */

const config = require('@chialab/prettier-config');

module.exports = {
...config,
};
Loading

0 comments on commit c53ff28

Please sign in to comment.