Skip to content

Commit 43e34c3

Browse files
committed
🚀 meta: monorepo
1 parent d6dd2e3 commit 43e34c3

File tree

99 files changed

+10005
-26397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+10005
-26397
lines changed

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"SharedArrayBuffer": "readonly"
2121
},
2222
"parserOptions": {
23-
"ecmaVersion": 11,
23+
"ecmaVersion": 2019,
24+
"extraFileExtensions": [".mjs"],
2425
"sourceType": "module",
2526
"project": "./tsconfig.json"
2627
},

.github/workflows/build-and-deploy-site.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ on:
44
branches:
55
- main
66
paths:
7-
- ".github/workflows/**"
8-
- "site/**"
9-
- "scripts/**"
7+
- "./projects/site/**"
108

119
jobs:
1210
build:
@@ -24,19 +22,17 @@ jobs:
2422
with:
2523
node-version: ${{ matrix.node-version }}
2624
registry-url: https://registry.npmjs.org/
27-
- uses: pnpm/action-setup@v1.2.1
25+
- uses: pnpm/action-setup@v2.0.0
2826
with:
29-
version: 5.13.x
27+
version: 5.18.x
3028
- name: "Install Production and Development Dependencies"
3129
run: "pnpm install"
3230
- name: "Render Content"
33-
run: "pnpm run render:content"
34-
- name: "Install Production and Development Dependencies in the site directory"
35-
run: "cd site && pnpm install"
31+
run: "pnpm run render"
3632

3733
- name: "Export a Static Build"
38-
run: "cd site && pnpm run export"
34+
run: "cd projects/site && pnpm run export"
3935
- name: "Deploy Hosting"
40-
run: "cd site && pnpm run firebase:deploy:hosting"
36+
run: "cd projects/site && pnpm run firebase:deploy:hosting"
4137
env:
4238
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Lint, check, and test every commit and PR
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
lint-check-and-test:
9+
strategy:
10+
matrix:
11+
node-version: [12, 14]
12+
os: [ubuntu-latest, windows-latest, macOS-latest]
13+
tailwindcss-version: ["^1.9.6", "^2.1.1"]
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 15
16+
steps:
17+
- uses: actions/checkout@v1
18+
- uses: actions/setup-node@v2-beta
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
registry-url: https://registry.npmjs.org/
22+
- uses: pnpm/[email protected]
23+
with:
24+
version: 5.18.x
25+
- run: pnpm install
26+
- run: cd projects/tailwindcss-theme-variants && pnpm install --save tailwindcss@${{ matrix.tailwindcss-version }}
27+
- run: pnpm run lint
28+
- run: pnpm -r run check
29+
- run: pnpm -r run test
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish to NPM every tag (i.e. new version)
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
strategy:
11+
matrix:
12+
node-version: [14]
13+
os: [ubuntu-latest]
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 15
16+
steps:
17+
- uses: actions/checkout@v1
18+
- uses: actions/setup-node@v2-beta
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
registry-url: https://registry.npmjs.org/
22+
- uses: pnpm/[email protected]
23+
with:
24+
version: 5.18.x
25+
- run: cd projects/tailwindcss-theme-variants && pnpm install
26+
- run: pnpm -r publish --no-git-checks
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish.yml

-50
This file was deleted.

.gitignore

+3-8
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
firebase-debug.log
66
/.history/
77
/node_modules/
8-
__sapper__/
9-
/site/src/node_modules/@sapper/
10-
/site/src/rendered-content/
11-
/site/static/global.css
12-
/site/static/global.css.map
8+
/projects/site/node_modules/
9+
/projects/tailwindcss-theme-variants/node_modules/
10+
/projects/tests/node_modules/
1311
pnpm-debug.log
14-
15-
/*.js
16-
/*.d.ts

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2020 Navith
1+
Copyright 2021 Navith
22

33
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:
44

lint-content.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { readdir } from "fs/promises";
2+
import vfile from "to-vfile";
3+
import report from "vfile-reporter";
4+
import unified from "unified";
5+
import parse from "remark-parse";
6+
import stringify from "remark-stringify";
7+
import remark2retext from "remark-retext";
8+
import english from "retext-english";
9+
import passive from "retext-passive";
10+
import readability from "retext-readability";
11+
12+
const source = "./content";
13+
14+
const analyzer = unified()
15+
.use(parse)
16+
.use(
17+
remark2retext,
18+
unified()
19+
.use(english)
20+
.use(passive)
21+
.use(readability, {
22+
age: 20,
23+
threshold: 4 / 7,
24+
}),
25+
)
26+
.use(stringify);
27+
28+
const main = async () => {
29+
const files = await readdir(source);
30+
31+
let errored = false;
32+
await Promise.all(files.map(async (path) => {
33+
const content = await vfile.read(`${source}/${path}`);
34+
35+
analyzer.process(content, (error, file) => {
36+
if (error) {
37+
console.error(report(error));
38+
errored = true;
39+
} else {
40+
console.log(report(file));
41+
}
42+
});
43+
}));
44+
45+
if (errored) process.exit(1);
46+
};
47+
48+
main();

package.json

+15-101
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"name": "tailwindcss-theme-variants",
3-
"version": "1.11.0-beta.1",
2+
"name": "tailwindcss-theme-variants-workspace-root",
3+
"private": true,
4+
"version": "0.0.0",
45
"description": "Media-query- or JavaScript-based theme variants with fallback for Tailwind CSS",
56
"keywords": [
67
"plugin",
@@ -18,116 +19,29 @@
1819
},
1920
"bugs": "https://github.com/JakeNavith/tailwindcss-theme-variants/issues",
2021
"homepage": "https://github.com/JakeNavith/tailwindcss-theme-variants",
21-
"files": [
22-
"index.js",
23-
"index.d.ts",
24-
"media-queries.js",
25-
"media-queries.d.ts",
26-
"selectors.js",
27-
"selectors.d.ts",
28-
"supports.js",
29-
"supports.d.ts",
30-
"utilities.js",
31-
"utilities.d.ts",
32-
"variants.js",
33-
"variants.d.ts",
34-
"preset-light-and-dark.js",
35-
"preset-recommended.js"
36-
],
37-
"type": "commonjs",
38-
"types": "index.d.ts",
39-
"exports": {
40-
".": {
41-
"require": "./index.js",
42-
"node": "./index.js",
43-
"default": "./index.js"
44-
},
45-
"./media-queries": {
46-
"require": "./media-queries.js",
47-
"node": "./media-queries.js",
48-
"default": "./media-queries.js"
49-
},
50-
"./selectors": {
51-
"require": "./selectors.js",
52-
"node": "./selectors.js",
53-
"default": "./selectors.js"
54-
},
55-
"./supports": {
56-
"require": "./supports.js",
57-
"node": "./supports.js",
58-
"default": "./supports.js"
59-
},
60-
"./utilities": {
61-
"require": "./utilities.js",
62-
"node": "./utilities.js",
63-
"default": "./utilities.js"
64-
},
65-
"./variants": {
66-
"require": "./variants.js",
67-
"node": "./variants.js",
68-
"default": "./variants.js"
69-
},
70-
"./presets/dark-mode": {
71-
"require": "./preset-light-and-dark.js",
72-
"node": "./preset-light-and-dark.js",
73-
"default": "./preset-light-and-dark.js"
74-
},
75-
"./presets/recommended": {
76-
"require": "./preset-recommended.js",
77-
"node": "./preset-recommended.js",
78-
"default": "./preset-recommended.js"
79-
}
80-
},
22+
"type": "module",
8123
"scripts": {
82-
"eslint:fix": "eslint --fix ./src/**/*.ts ./scripts/**/*.cjs ./scripts/**/*.ts ./tests/**/*.ts",
83-
"retext": "ts-node scripts/lint-content.ts",
84-
"lint": "run-p retext eslint:fix",
85-
"test": "cross-env TS_NODE_FILES=true mocha --require ts-node/register 'tests/index.ts'",
86-
"render:content": "ts-node scripts/render-content.ts",
87-
"render:readme": "ts-node scripts/render-readme.ts",
88-
"render": "run-p render:content render:readme",
89-
"build:js": "node scripts/esbuild.cjs",
90-
"build:dts": "tsc --project tsconfig-src.json",
91-
"prepare": "run-p build:js build:dts"
92-
},
93-
"dependencies": {
94-
"lodash": "^4.17.20",
95-
"postcss-selector-parser": "^6.0.4"
24+
"eslint": "eslint ./projects/**/*.cjs ./projects/**/*.js ./projects/**/*.mjs ./projects/**/*.ts ./*.js",
25+
"format": "npm run eslint -- --fix",
26+
"retext": "node lint-content.js",
27+
"lint": "run-p eslint retext",
28+
"render": "node render.js"
9629
},
9730
"devDependencies": {
98-
"@navith/tailwindcss-plugin-author-types": "^1.8.1-0.1",
99-
"@types/assert": "^1.5.4",
100-
"@types/lodash": "^4.14.168",
101-
"@types/mocha": "^8.2.0",
102-
"@types/node": "^14.14.22",
103-
"@types/sinon": "^9.0.10",
104-
"@typescript-eslint/eslint-plugin": "^4.14.2",
105-
"@typescript-eslint/parser": "^4.14.2",
106-
"cross-env": "^7.0.3",
107-
"esbuild": "^0.8.39",
108-
"eslint": "^7.19.0",
109-
"eslint-config-airbnb-base": "^14.2.1",
110-
"eslint-plugin-import": "^2.22.1",
31+
"@typescript-eslint/eslint-plugin": "^4.22.0",
32+
"@typescript-eslint/parser": "^4.22.0",
33+
"eslint": "^7.24.0",
11134
"markdown-toc": "^1.2.0",
112-
"mocha": "^8.2.1",
11335
"npm-run-all": "^4.1.5",
114-
"postcss": "^8.2.4",
36+
"postcss": "^8.2.10",
11537
"remark-parse": "^9.0.0",
11638
"remark-retext": "^4.0.0",
11739
"remark-stringify": "^9.0.1",
118-
"retext": "^7.0.1",
11940
"retext-english": "^3.0.4",
12041
"retext-passive": "^3.0.0",
12142
"retext-readability": "^6.0.0",
122-
"sinon": "^9.2.4",
123-
"source-map": "^0.7.3",
12443
"to-vfile": "^6.1.0",
125-
"ts-node": "^9.1.1",
126-
"typescript": "^4.1.3",
127-
"unified": "^9.2.0",
44+
"unified": "^9.2.1",
12845
"vfile-reporter": "^6.0.2"
129-
},
130-
"peerDependencies": {
131-
"tailwindcss": "^1.9.6 || ^2.0.1"
13246
}
133-
}
47+
}

0 commit comments

Comments
 (0)