Skip to content

Commit

Permalink
chore: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyingchun committed May 29, 2024
1 parent eecdcb8 commit 033a699
Show file tree
Hide file tree
Showing 24 changed files with 4,644 additions and 3,505 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-phones-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperse/tailwind-layer": patch
---

bump version
27 changes: 0 additions & 27 deletions .eslintrc.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,5 @@ dist
.pnp.*


tailwindcss-extend.cjs
tailwindcss-extend.cjs
.netrc
3 changes: 0 additions & 3 deletions .netrc

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierignore

This file was deleted.

6 changes: 4 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
"recommendations": [
"dbaeumer.vscode-eslint"
]
}
40 changes: 19 additions & 21 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"type": "node",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
"name": "Debug Test File",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"test-unit"
],
"skipFiles": [
"<node_internals>/**",
"**/node_modules/**"
],
"args": [
"${relativeFile}"
],
"env": {}
}
]
}
}
25 changes: 16 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.preferences.importModuleSpecifier": "relative",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": false
"source.fixAll": "explicit",
"source.organizeImports": "never"
},
"files.associations": {
"*.css": "tailwindcss"
},
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
],
// Disable vscode formatting for js,jsx,ts,tsx files
// to allow dbaeumer.vscode-eslint to format them
"[javascript]": {
"editor.formatOnSave": false
}
}
},
"eslint.experimental.useFlatConfig": true,
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
}
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.2.cjs

This file was deleted.

894 changes: 894 additions & 0 deletions .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# tailwind-layer
# @hyperse/tailwind-layer

Compile your tailwindcss components into tailwind plugins and enjoy full IntelliSense autocompletion!

## Usage

1. yarn add @hyperse-io/layer
1. yarn add @hyperse/tailwind-layer

2. packages.json

Expand Down Expand Up @@ -33,7 +33,7 @@ export default config;
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "keen-slider/keen-slider.min.css";
@import 'keen-slider/keen-slider.min.css';

* {
scroll-behavior: smooth;
Expand Down
11 changes: 11 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { base, defineConfig } from '@hyperse/eslint-config-hyperse';

export default defineConfig([
// ...typescript
...base,
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
]);
20 changes: 6 additions & 14 deletions lint-staged.common.cjs → lint-staged.common.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require('path');
const escape = require('shell-quote').quote;
import path from 'path';
import { quote } from 'shell-quote';

const isWin = process.platform === 'win32';

Expand Down Expand Up @@ -30,7 +30,7 @@ const eslintGlobalRulesForFix = [
* Lint-staged command for running eslint in packages or apps.
* @param {{cwd: string, files: string[], fix: boolean, fixType?: ('problem'|'suggestion'|'layout'|'directive')[], cache: boolean, rules?: string[], maxWarnings?: number}} params
*/
const getEslintFixCmd = ({
export const getEslintFixCmd = ({
cwd,
files,
rules,
Expand All @@ -54,7 +54,7 @@ const getEslintFixCmd = ({
fix ? '--fix' : '',
cliFixType.length > 0 ? `--fix-type ${cliFixType.join(',')}` : '',
maxWarnings !== undefined ? `--max-warnings=${maxWarnings}` : '',
cliRules.length > 0 ? `--rule ${cliRules.join('--rule ')}` : '',
cliRules.length > 0 ? `--rule ${cliRules.join(' --rule ')}` : '',
files
// makes output cleaner by removing absolute paths from filenames
.map((f) => `"./${path.relative(cwd, f)}"`)
Expand All @@ -74,15 +74,7 @@ const getEslintFixCmd = ({
* @param {string[]} filenames
* @returns {string} Return concatenated and escaped filenames
*/
const concatFilesForPrettier = (filenames) =>
export const concatFilesForPrettier = (filenames) =>
filenames
.map((filename) => `"${isWin ? filename : escape([filename])}"`)
.map((filename) => `"${isWin ? filename : quote([filename])}"`)
.join(' ');

const concatFilesForStylelint = concatFilesForPrettier;

module.exports = {
concatFilesForPrettier,
concatFilesForStylelint,
getEslintFixCmd,
};
20 changes: 18 additions & 2 deletions lint-staged.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
/**
* This is the base lint-staged rules config and just includes prettier by default.
* A good practice is to override this base configuration in each package and/or application
* where we are able to add customization depending on the nature of the project (eslint...).
*/

import { concatFilesForPrettier } from './lint-staged.common.cjs';
import {
concatFilesForPrettier,
getEslintFixCmd,
} from './lint-staged.common.mjs';

/**
* @type {Record<string, (filenames: string[]) => string | string[] | Promise<string | string[]>>}
*/
const rules = {
'**/*.{js,jsx,ts,tsx,mjs,cjs}': (filenames) => {
return getEslintFixCmd({
cwd: dirname(fileURLToPath(import.meta.url)),
fix: true,
cache: true,
// when autofixing staged-files a good tip is to disable react-hooks/exhaustive-deps, cause
// a change here can potentially break things without proper visibility.
rules: [],
maxWarnings: 25,
files: filenames,
});
},
'**/*.{json,md,mdx,css,html,yml,yaml,scss,ts,js,tsx,jsx,mjs}': (
filenames
) => {
Expand Down
45 changes: 20 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@hyperse-io/tailwind-layer",
"name": "@hyperse/tailwind-layer",
"version": "1.0.3",
"description": "Compile your tailwindcss components into tailwind plugins and enjoy full autocompletion!",
"repository": {
Expand All @@ -25,7 +25,7 @@
],
"scripts": {
"build": "tsup",
"lint": "eslint --cache --ext \".js,.ts,.tsx\" --report-unused-disable-directives --report-unused-disable-directives src",
"lint": "eslint .",
"lint-fix": "yarn lint --fix",
"test": "run-s test:unit",
"test:unit": "vitest run",
Expand All @@ -41,42 +41,37 @@
}
},
"dependencies": {
"chokidar": "^3.5.3",
"glob": "^10.3.10",
"chokidar": "^3.6.0",
"glob": "^10.4.1",
"postcss-js": "^4.0.1",
"sade": "^1.8.1"
},
"devDependencies": {
"@armit/eslint-config-bases": "0.1.4",
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@commitlint/cli": "18.6.0",
"@commitlint/config-conventional": "18.6.1",
"@types/node": "^20.10.4",
"@types/postcss-js": "^4",
"@changesets/cli": "2.27.3",
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@hyperse/eslint-config-hyperse": "^1.0.4",
"@types/node": "^20.12.12",
"@types/postcss-js": "^4.0.4",
"@types/shell-quote": "1.7.5",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"commitizen": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.1",
"husky": "9.0.10",
"eslint": "^9.3.0",
"husky": "9.0.11",
"is-ci": "3.0.1",
"lint-staged": "15.2.2",
"lint-staged": "15.2.5",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.32",
"prettier": "^3.1.0",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"shell-quote": "1.8.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"vite": "^5.0.6",
"vitest": "^1.0.2"
"tsup": "^8.0.2",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vitest": "^1.6.0"
},
"peerDependencies": {
"postcss": "^8.4.21",
"prettier": "^3.1.0",
"tailwindcss": "^3.0.0"
},
"engines": {
Expand All @@ -85,5 +80,5 @@
"publishConfig": {
"access": "public"
},
"packageManager": "yarn@4.0.2"
"packageManager": "yarn@4.2.2"
}
24 changes: 0 additions & 24 deletions prettier.config.cjs

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './tailwind-layer-plugin.js';
export * from './bundle.js';
export * from './main.js';
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chokidar from 'chokidar';
import sade from 'sade';
import { version, name } from '../package.json';
import { bundle } from './tailwind-layer-plugin.js';
import { name, version } from '../package.json';
import { bundle } from './bundle.js';

export const cmdMain = () => {
return sade(name, true)
Expand Down
2 changes: 1 addition & 1 deletion tests/tailwind.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync, readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'path';
import { bundle } from '../src/tailwind-layer-plugin.js';
import { bundle } from '../src/bundle.js';

const getDirname = (url: string, ...paths: string[]) => {
return join(dirname(fileURLToPath(url)), ...paths);
Expand Down
Loading

0 comments on commit 033a699

Please sign in to comment.