Skip to content

Commit 60d53bd

Browse files
authored
misc: Adds initial css data & scripts pkg, updates deps & readme, and cleanup (#14)
* update: Split types out to their own files * new: Adds initial CSS data types * update: Export html and cleanup files for consistency * new: Scripts pkg to manage the repo * docs: Update readme(s) * deps: Update all deps to latest
1 parent e9dd9f2 commit 60d53bd

43 files changed

Lines changed: 951 additions & 663 deletions

Some content is hidden

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

.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,11 @@ module.exports = {
3737
'@typescript-eslint/no-empty-function': 'off',
3838
},
3939
},
40+
{
41+
files: ['packages/scripts/**/*.ts'],
42+
rules: {
43+
'no-console': 'off',
44+
},
45+
},
4046
],
4147
};

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Email Types
44

5-
TypeScript definitions, compatibility data, and utils that makes building emails
6-
easier.
5+
TypeScript definitions, general data, and compatibility data that makes building
6+
emails easier.
77

88
_This is very much a work in progress_
99

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,28 @@
88
"postinstall": "lerna bootstrap",
99
"clean": "rm -rf ./packages/*/{*.tsbuildinfo,dist}",
1010
"clean:prune": "rm -rf ./{,*/,**/*/}{node_modules,coverage,*.lock,*.log,*.tsbuildinfo,dist}",
11-
"build": "yarn clean && lerna run build --stream && yarn types",
11+
"build": "yarn clean && yarn build:data && yarn scripts:build && yarn types",
12+
"build:data": "yarn workspace @email-types/data build",
13+
"scripts:build": "yarn workspace @email-types/scripts build",
14+
"scripts:prerelease": "yarn workspace @email-types/scripts prerelease",
1215
"test": "yarn build && yarn lint && yarn jest:coverage",
1316
"jest": "jest --colors --logHeapUsage",
14-
"jest:coverage": "yarn run jest --coverage",
17+
"jest:coverage": "yarn jest --coverage",
1518
"lint": "eslint . --ext js,jsx,ts,tsx --max-warnings=0 --report-unused-disable-directives",
1619
"prettier": "prettier \"**/*.{js,jsx,ts,tsx,md,mdx,json}\" --write",
1720
"types": "tsc --build packages/*/tsconfig.json",
18-
"prepublishOnly": "NODE_ENV=production yarn run build",
19-
"release": "lerna publish",
20-
"release:publish": "lerna publish from-git",
21+
"prerelease": "yarn build && yarn scripts:prerelease",
22+
"release": "yarn prerelease && lerna publish",
23+
"release:publish": "yarn prerelease && lerna publish from-git",
2124
"release:version": "lerna version --conventional-commits --changelog-preset conventional-changelog-beemo --create-release github --push",
2225
"canary:version": "lerna version prerelease --preid canary --conventional-commits --changelog-preset conventional-changelog-beemo --create-release github --push"
2326
},
2427
"lint-staged": {
2528
"**/*.{js,jsx,ts,tsx,md,mdx,json}": [
26-
"yarn run prettier"
29+
"yarn prettier"
2730
],
2831
"**/*.{js,jsx,ts,tsx}": [
29-
"yarn run lint --fix"
32+
"yarn lint --fix"
3033
]
3134
},
3235
"husky": {
@@ -35,36 +38,33 @@
3538
}
3639
},
3740
"devDependencies": {
38-
"@babel/cli": "^7.7.0",
39-
"@babel/core": "^7.7.2",
40-
"@babel/preset-env": "^7.7.1",
41-
"@babel/preset-typescript": "^7.7.2",
41+
"@babel/cli": "^7.7.7",
42+
"@babel/core": "^7.7.7",
43+
"@babel/preset-env": "^7.7.7",
44+
"@babel/preset-typescript": "^7.7.7",
4245
"@postmates/eslint-config": "^5.1.1",
4346
"@types/eslint": "^6.1.3",
44-
"@types/fs-extra": "^8.0.1",
45-
"@types/jest": "^24.0.23",
46-
"@types/mri": "^1.1.0",
47-
"@types/node": "^12.12.14",
47+
"@types/jest": "^24.0.24",
48+
"@types/node": "^12.12.21",
4849
"@types/prettier": "^1.19.0",
4950
"@typescript-eslint/eslint-plugin": "^2.7.0",
5051
"@typescript-eslint/parser": "^2.7.0",
51-
"conventional-changelog-beemo": "^1.5.3",
52-
"eslint": "^6.6.0",
53-
"eslint-config-prettier": "^6.6.0",
54-
"eslint-plugin-import": "^2.18.2",
55-
"eslint-plugin-jest": "^23.0.4",
52+
"conventional-changelog-beemo": "^1.6.0",
53+
"eslint": "^6.8.0",
54+
"eslint-config-prettier": "^6.7.0",
55+
"eslint-plugin-import": "^2.19.1",
56+
"eslint-plugin-jest": "^23.1.1",
5657
"eslint-plugin-jsx-a11y": "^6.2.3",
57-
"eslint-plugin-prettier": "^3.1.1",
58-
"eslint-plugin-react": "^7.16.0",
58+
"eslint-plugin-prettier": "^3.1.2",
59+
"eslint-plugin-react": "^7.17.0",
5960
"eslint-plugin-react-hooks": "^1.7.0",
60-
"fs-extra": "^8.1.0",
6161
"husky": "^3.0.9",
6262
"jest": "^24.9.0",
63-
"lerna": "^3.18.4",
63+
"lerna": "^3.19.0",
6464
"lint-staged": "^10.0.0-1",
6565
"prettier": "^1.19.1",
6666
"react": "^16.12.0",
67-
"typescript": "^3.7.2"
67+
"typescript": "^3.7.4"
6868
},
6969
"keywords": [
7070
"css-in-js",

packages/data/README.md

Lines changed: 118 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,143 @@
1-
[msotype]: https://github.com/email-types/email-types/msotype
2-
[stylis-plugin-mso]:
3-
https://github.com/email-types/email-types/stylis-plugin-mso
1+
[wiki-dtd]: https://en.wikipedia.org/wiki/Document_type_definition
2+
[dep-mdn-data]: https://github.com/mdn/data
3+
4+
<div align="center">
45

56
# Email Types Data
67

7-
General TypeScript definitions and compatibility data that can be used when
8-
building emails. Checkout [msotype] and [stylis-plugin-mso] for examples.
8+
General TypeScript definitions and data that can be used when building emails.
99

1010
```sh
11-
yarn add --dev @email-types/data
11+
yarn add @email-types/data
12+
```
13+
14+
</div>
15+
16+
---
17+
18+
| Category | Description | Exports |
19+
| :---------------- | :--------------------------------------------------------------------- | :-------------------------------------------------------------------- |
20+
| [**css**](#css) | Email specific data about the different features of the CSS language. | • `data-types` |
21+
| [**html**](#html) | Email specific data about the different features of the HTML language. | • `doctypes` |
22+
| [**mso**](#mso) | Data about the different features of the MSO language. | • `properties` <br> • `syntaxes` <br> • `operators` <br> • `versions` |
23+
24+
## CSS
25+
26+
<details>
27+
<summary><strong>Examples</strong></summary>
28+
<ul>
29+
<li><a href="https://github.com/email-types/msotype" target="_blank">msotype</a></li>
30+
</ul>
31+
</details>
32+
33+
<p></p>
34+
35+
Email specific data about the different features of the CSS language. All CSS
36+
data is generated using [`mdn-data`][dep-mdn-data] during the build pipeline,
37+
exposing only what's relevant to reduce the overall package size.
38+
39+
```ts
40+
import * as css from '@email-types/data/css';
41+
```
42+
43+
### DataTypes
44+
45+
CSS basic data types, such as `<string>`, `<number>`, and `<length>`.
46+
47+
## HTML
48+
49+
<details>
50+
<summary><strong>Examples</strong></summary>
51+
<ul>
52+
<li><a href="https://github.com/email-types/doctype" target="_blank">email-doctype</a></li>
53+
</ul>
54+
</details>
55+
56+
<p></p>
57+
58+
Email specific data about the different features of the HTML language.
59+
60+
```ts
61+
import * as html from '@email-types/data/html';
1262
```
1363

14-
## Data
64+
### Doctypes
65+
66+
HTML [Document Type Definition (DTD)][wiki-dtd] data that can be used in emails.
67+
It does not include unsupported or deprecated doctype versions.
68+
69+
Checkout [email-doctype] for an example using this data.
70+
71+
## MSO
72+
73+
<details>
74+
<summary><strong>Examples</strong></summary>
75+
<ul>
76+
<li><a href="https://github.com/email-types/msotype" target="_blank">msotype</a></li>
77+
<li><a href="https://github.com/email-types/stylis-plugin-mso" target="_blank">stylis-plugin-mso</a></li>
78+
</ul>
79+
</details>
1580

16-
| | Description | Exports |
17-
| :-------------- | :----------------------------------------------------- | :----------------------------------------------------------------------------------- |
18-
| [**mso**](#mso) | Data about the different features of the MSO language. | • `properties` <br> • `syntaxes` <br> • `operators` <br> • `types` <br> • `versions` | `AlternativePropertiesHyphen` |
19-
| **features** | _todo_ | _todo_ |
20-
| **providers** | _todo_ | _todo_ |
81+
<p></p>
2182

22-
### MSO
83+
Data about the different features of the Microsoft Office ("MSO") language.
2384

24-
#### Properties
85+
```ts
86+
import * as mso from '@email-types/data/mso';
87+
```
88+
89+
### Properties
90+
91+
MSO style property data, including data for the `mso-` CSS vendor prefix. When
92+
using this data, you should consider the following:
2593

26-
Property data for MSO (Microsoft Office), including data for the `mso-` CSS
27-
vendor prefix. There are 2 categories of property data.
94+
**`css alternatives`** - Properties that end with an `-alt` postfix that are
95+
direct alternatives to a standard CSS property.
2896

29-
- **`alternatives`** - Properties that end with an `-alt` postfix that are
30-
direct alternatives to a standard CSS property.
31-
- **`standard`** - Properties that correspond to a Microsoft Office feature.
32-
While these do not have a CSS equivalent, they may or may not have an effect
33-
on Microsoft Outlook
97+
**`office only`** - Properties that do not end with an `-alt` postfix and have
98+
no CSS equivalent. Instead, they correspond to a Microsoft Office feature.
99+
However, since some versions of Microsoft Outlook use Microsoft Word as it's
100+
rendering engine, these properties may or may not have an effect on your email.
34101

35-
#### Syntaxes
102+
- **todo**: Test each of these properties to understand how they effect
103+
rendering of emails. Then document it all.
36104

37-
MSO value definition syntax is used for the formal syntax of MSO properties. For
38-
example, the `color` property uses the following syntax where <named-color> is
39-
referring to a syntax that is defined in `syntaxes.ts`.
105+
### Syntaxes
106+
107+
MSO syntax is value definitions used for the formal syntax of MSO properties.
108+
For example, the `mso-border-alt` property allows for `<border-style>` values.
109+
This is referring to a syntax defined in `syntaxes.ts`.
40110

41111
```ts
42-
color: {
43-
syntax: '<named-color>';
112+
// example properties.ts
113+
{
114+
'mso-border-alt': {
115+
syntax: '<border-style>',
116+
}
117+
}
118+
119+
// example syntaxes.ts
120+
{
121+
'border-style': {
122+
syntax: 'dashed | dotted | <string>';
123+
}
44124
}
45125
```
46126

47-
#### Operators
127+
### Operators
48128

49-
Operator syntax that can be used to create MSO conditional expressions,
129+
MSO operator syntax that can be used to create MSO conditional expressions,
50130
comments.
51131

52-
#### Types
132+
### Versions
133+
134+
MSO version vectors that map to specific Outlook clients. This is commonly
135+
used—in combination with an [`operator`](#operators)—to target specific versions
136+
of Outlook when creating conditional expressions, comments.
53137

54-
CSS basic data types, such as `<sting>` and `<length>`, that are acceptable
55-
values that can be used by MSO properties.
138+
## Upcoming
56139

57-
#### Versions
140+
**Clients**
58141

59-
MSO version vectors that map to specific Outlook clients. This is commonly used
60-
to target specific versions of Outlook with conditional comments.
142+
Data about the different email clients—which will include `applications` and
143+
`webmail`.

packages/data/css.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dist/css';

packages/data/css.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./dist/css');

packages/data/doctypes.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/data/doctypes.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/data/html.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dist/html';

packages/data/html.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./dist/html');

0 commit comments

Comments
 (0)