Skip to content

Commit

Permalink
Merge pull request #1 from liip/workflows
Browse files Browse the repository at this point in the history
Create github actions workflows
  • Loading branch information
lgollut authored Jul 4, 2023
2 parents c89fe59 + 12c81c2 commit 14a8374
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 18 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish

on:
release:
types: [published]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
18 changes: 18 additions & 0 deletions .github/workflows/push-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Validate

on:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm run format
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
- main

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm run format

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run version
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
13 changes: 12 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "independent"
"version": "independent",
"changelogPreset": "angular",
"command": {
"version": {
"allowBranch": "main",
"conventionalCommits": true,
"message": "chore: publish new version"
},
"publish": {
"registry": "https://registry.npmjs.org/"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"format:fix": "lerna run format:fix",
"test": "lerna run test",
"typecheck": "lerna run typecheck",
"version": "lerna version --create-release gitlab",
"version": "lerna version --create-release github",
"publish": "lerna publish from-git"
},
"workspaces": [
Expand Down
4 changes: 3 additions & 1 deletion packages/class-prefixer-ast-visitor/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# class-prefixer-ast-visitor

Ready to use `ESTraverse.Visitor` implementation to prefix classes and `css` selectors. Those implementation can be use along (esbuild-plugin-ast)[] and (esbuild-plugin-ast-vue)[] plugins.
Ready to use `ESTraverse.Visitor` implementation to prefix classes and `css` selectors. Those implementation can be use along [esbuild-plugin-ast](https://github.com/liip/class-prefixer/tree/main/packages/esbuild-plugin-ast) and [esbuild-plugin-ast-vue](https://github.com/liip/class-prefixer/tree/main/packages/esbuild-plugin-ast-vue) plugins.

## createVisitor

Expand Down Expand Up @@ -52,9 +52,11 @@ type TestConditions = (string | RegExp)[];
```

**`value`**

Define the actual string used to prefix classes

**`excludes`**

Strings or regular expressions to exclude certain classes from the transformation.

### container
Expand Down
10 changes: 7 additions & 3 deletions packages/class-prefixer-ast-visitor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
"version": "0.0.1",
"description": "AST visitor implementation to prefix CSS class names",
"main": "dist/index.js",
"files": [
"/dist"
],
"keywords": [
"ast",
"visitor",
"css",
"prefix",
"class",
"esbuild",
"plugin"
"selector",
"prefix"
],
"author": {
"name": "Liip",
Expand Down
2 changes: 2 additions & 0 deletions packages/class-prefixer-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ type TestConditions = (string | RegExp)[];
```

**`value`**

Define the actual string used to prefix classes

**`excludes`**

Strings or regular expressions to exclude certain classes from the transformation.

### container
Expand Down
9 changes: 9 additions & 0 deletions packages/class-prefixer-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
"version": "0.0.1",
"description": "Core utilities of the class-prefixer tools",
"main": "dist/index.js",
"files": [
"/dist"
],
"keywords": [
"css",
"class",
"selector",
"prefix"
],
"author": {
"name": "Liip",
"url": "https://www.liip.ch/"
Expand Down
12 changes: 6 additions & 6 deletions packages/esbuild-plugin-ast-vue/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# esbuild-plugin-ast

A plugin to generate an AST representation of your `.js` files. The plugin use (Acorn)[https://github.com/acornjs/acorn] to produce an `estree` compliant `AST` object. You can then apply transformations by providing a `visitor` object.
A plugin to generate an AST representation of your `.js` files. The plugin use [Acorn](https://github.com/acornjs/acorn) to produce an `estree` compliant `AST` object. You can then apply transformations by providing a `visitor` object.

## Installation

Expand Down Expand Up @@ -54,20 +54,20 @@ interface AstParserVueOptions extends AstParserOptions {

### visitor

An `ESTraverse.Visitor` object used to apply AST transformations. Check the (Estraverse documentation)[https://github.com/estools/estraverse] form more information on the available API.
An `ESTraverse.Visitor` object used to apply AST transformations. Check the [Estraverse documentation](https://github.com/estools/estraverse) form more information on the available API.

### templateVisitor

An `ESTraverse.Visitor` object used to apply AST transformations to the `JavaScript` produce by the template interpretation. Check the (Estraverse documentation)[https://github.com/estools/estraverse] form more information on the available API.
An `ESTraverse.Visitor` object used to apply AST transformations to the `JavaScript` produce by the template interpretation. Check the [Estraverse documentation](https://github.com/estools/estraverse) form more information on the available API.

### templateOptions

Template options passed to the underlying SFCCompiler. See the (`compileTemplate.ts` implementation)[https://github.com/vuejs/vue/blob/main/packages/compiler-sfc/src/compileTemplate.ts] for more details
Template options passed to the underlying SFCCompiler. See the [`compileTemplate.ts` implementation](https://github.com/vuejs/vue/blob/main/packages/compiler-sfc/src/compileTemplate.ts) for more details

### scriptOptions

Script options passed to the underlying SFCCompiler. See the (`compileScript.ts` implementation)[https://github.com/vuejs/vue/blob/main/packages/compiler-sfc/src/compileScript.ts] for more details
Script options passed to the underlying SFCCompiler. See the [`compileScript.ts` implementation](https://github.com/vuejs/vue/blob/main/packages/compiler-sfc/src/compileScript.ts) for more details

### styleOptions

Style options passed to the underlying SFCCompiler. See the (`compileStyle.ts` implementation)[https://github.com/vuejs/vue/blob/main/packages/compiler-sfc/src/compileStyle.ts] for more details
Style options passed to the underlying SFCCompiler. See the [`compileStyle.ts` implementation](https://github.com/vuejs/vue/blob/main/packages/compiler-sfc/src/compileStyle.ts) for more details
3 changes: 3 additions & 0 deletions packages/esbuild-plugin-ast-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.0.1",
"description": "Esbuild plugin to parse Vue AST",
"main": "dist/plugin.js",
"files": [
"/dist"
],
"keywords": [
"esbuild",
"plugin",
Expand Down
4 changes: 2 additions & 2 deletions packages/esbuild-plugin-ast/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# esbuild-plugin-ast

A plugin to generate an AST representation of your `.js` files. The plugin use (Acorn)[https://github.com/acornjs/acorn] to produce an `estree` compliant `AST` object. You can then apply transformations by providing a `visitor` object.
A plugin to generate an AST representation of your `.js` files. The plugin use [Acorn](https://github.com/acornjs/acorn) to produce an `estree` compliant `AST` object. You can then apply transformations by providing a `visitor` object.

## Installation

Expand Down Expand Up @@ -42,4 +42,4 @@ An array of node module dependencies on which this plugin should also operate.

### visitor

An `ESTraverse.Visitor` object used to apply AST transformation. Check the (Estraverse documentation)[https://github.com/estools/estraverse] form more information on the available API.
An `ESTraverse.Visitor` object used to apply AST transformation. Check the [Estraverse documentation](https://github.com/estools/estraverse) form more information on the available API.
9 changes: 5 additions & 4 deletions packages/esbuild-plugin-ast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"version": "0.0.1",
"description": "Esbuild plugin to parse JavaScript AST",
"main": "dist/plugin.js",
"files": [
"/dist"
],
"keywords": [
"css",
"prefix",
"class",
"esbuild",
"plugin"
"plugin",
"ast"
],
"author": {
"name": "Liip",
Expand Down
5 changes: 5 additions & 0 deletions packages/postcss-class-prefixer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ type TestConditions = (string | RegExp)[];
```

**`value`**

Define the actual string used to prefix classes

**`excludes`**

Strings or regular expressions to exclude certain classes from the transformation.

### container
Expand Down Expand Up @@ -172,10 +174,13 @@ type TestConditions = (string | RegExp)[];
```

**`value`**

Define the actual string used to containerize classes

**`excludes`**

An object of node types keys containing strings or regular expressions to exclude certain elements from containerization

**`preserveRoots`**

An object of node types keys containing strings or regular expressions specifying which elements should be kept at the root of the selector
3 changes: 3 additions & 0 deletions packages/postcss-class-prefixer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.0.1",
"description": "PostCSS plugin to automatically prefix and contain CSS class names",
"main": "dist/plugin.js",
"files": [
"/dist"
],
"keywords": [
"css",
"prefix",
Expand Down

0 comments on commit 14a8374

Please sign in to comment.