diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1eceab9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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}} diff --git a/.github/workflows/push-request.yml b/.github/workflows/push-request.yml new file mode 100644 index 0000000..025e5aa --- /dev/null +++ b/.github/workflows/push-request.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bd349b7 --- /dev/null +++ b/.github/workflows/release.yml @@ -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}} diff --git a/lerna.json b/lerna.json index 610b798..fd13ae3 100644 --- a/lerna.json +++ b/lerna.json @@ -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/" + } + } } diff --git a/package.json b/package.json index 5aa991c..d2a551d 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/packages/class-prefixer-ast-visitor/README.md b/packages/class-prefixer-ast-visitor/README.md index 71f754f..91ebbd1 100644 --- a/packages/class-prefixer-ast-visitor/README.md +++ b/packages/class-prefixer-ast-visitor/README.md @@ -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 @@ -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 diff --git a/packages/class-prefixer-ast-visitor/package.json b/packages/class-prefixer-ast-visitor/package.json index 4a604ed..c8bfd6a 100644 --- a/packages/class-prefixer-ast-visitor/package.json +++ b/packages/class-prefixer-ast-visitor/package.json @@ -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", diff --git a/packages/class-prefixer-core/README.md b/packages/class-prefixer-core/README.md index b7e6905..a7f3142 100644 --- a/packages/class-prefixer-core/README.md +++ b/packages/class-prefixer-core/README.md @@ -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 diff --git a/packages/class-prefixer-core/package.json b/packages/class-prefixer-core/package.json index ecbbcb8..f6f33fb 100644 --- a/packages/class-prefixer-core/package.json +++ b/packages/class-prefixer-core/package.json @@ -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/" diff --git a/packages/esbuild-plugin-ast-vue/README.md b/packages/esbuild-plugin-ast-vue/README.md index c17cdf8..a640cf1 100644 --- a/packages/esbuild-plugin-ast-vue/README.md +++ b/packages/esbuild-plugin-ast-vue/README.md @@ -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 @@ -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 diff --git a/packages/esbuild-plugin-ast-vue/package.json b/packages/esbuild-plugin-ast-vue/package.json index ee9719e..cb86f94 100644 --- a/packages/esbuild-plugin-ast-vue/package.json +++ b/packages/esbuild-plugin-ast-vue/package.json @@ -3,6 +3,9 @@ "version": "0.0.1", "description": "Esbuild plugin to parse Vue AST", "main": "dist/plugin.js", + "files": [ + "/dist" + ], "keywords": [ "esbuild", "plugin", diff --git a/packages/esbuild-plugin-ast/README.md b/packages/esbuild-plugin-ast/README.md index 293b0b2..eed7062 100644 --- a/packages/esbuild-plugin-ast/README.md +++ b/packages/esbuild-plugin-ast/README.md @@ -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 @@ -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. diff --git a/packages/esbuild-plugin-ast/package.json b/packages/esbuild-plugin-ast/package.json index 0b8651d..0709dd6 100644 --- a/packages/esbuild-plugin-ast/package.json +++ b/packages/esbuild-plugin-ast/package.json @@ -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", diff --git a/packages/postcss-class-prefixer/README.md b/packages/postcss-class-prefixer/README.md index 4ee6425..7073120 100644 --- a/packages/postcss-class-prefixer/README.md +++ b/packages/postcss-class-prefixer/README.md @@ -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 @@ -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 diff --git a/packages/postcss-class-prefixer/package.json b/packages/postcss-class-prefixer/package.json index 8edb233..2800af9 100644 --- a/packages/postcss-class-prefixer/package.json +++ b/packages/postcss-class-prefixer/package.json @@ -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",