Skip to content

Commit 620df75

Browse files
authored
🏷 Rewrite with TypeScript (#23)
Rewrites css-typed with TypeScript. Fixes commander option misconfig. Includes additional changes as part of the rewrite. - Use .editorconfig instead of prettier.config.js - Move images to their own directory - Adds typescript and @connorjs/tsconfig - Removes old, unreachable error handling - Upgrades dependencies - Moves GitVersion config into pipeline file Increases unpacked size by 0.3kB. +semver:minor
1 parent b35771d commit 620df75

19 files changed

+958
-389
lines changed

β€Ž.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
# Prettier default
5+
charset = utf-8
6+
insert_final_newline = true
7+
end_of_line = lf
8+
max_line_length = 80
9+
trim_trailing_whitespace = true
10+
11+
# Custom
12+
# Use tabs: https://alexandersandberg.com/articles/default-to-tabs-instead-of-spaces-for-an-accessible-first-environment/
13+
indent_style = tab
14+
15+
[*.{yaml,yml}]
16+
# YAML disallows tabs: https://yaml.org/spec/
17+
indent_size = 2
18+
indent_style = space

β€Ž.github/workflows/pipeline.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ jobs:
2727
id: GitVersion
2828
uses: gittools/actions/gitversion/[email protected]
2929
with:
30-
useConfigFile: true
30+
overrideConfig: |
31+
workflow=GitHubFlow/v1
32+
mode=ContinuousDeployment
3133
3234
- name: Use Node.js
3335
uses: actions/setup-node@v4
@@ -88,7 +90,7 @@ jobs:
8890
node dist/main.js "$RUNNER_TEMP/*.css" --localsConvention camelCaseOnly
8991
diff --strip-trailing-cr -uI '//.*' src/fixtures/casing/camelCaseOnly.d.css.ts "$RUNNER_TEMP/casing.d.css.ts"
9092
91-
node dist/main.js --localsConvention camelCaseOnly "$RUNNER_TEMP/*.css"
93+
node dist/main.js --localsConvention camelCaseOnly "$RUNNER_TEMP/*.css"
9294
diff --strip-trailing-cr -uI '//.*' src/fixtures/casing/camelCaseOnly.d.css.ts "$RUNNER_TEMP/casing.d.css.ts"
9395
9496
Publish:

β€Ž.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
artifacts/
12
dist/
23
node_modules/
4+
35
.idea/

β€ŽGitVersion.yml

-2
This file was deleted.

β€ŽREADME.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
TypeScript declaration generator for CSS files.
66

7-
<img alt="css-typed logo" src="./css-typed.svg" width="400">
7+
<img alt="css-typed logo" src="images/css-typed.svg" width="400">
88

99
</div>
1010

β€Žeslint.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import connorjsConfig from "eslint-config-connorjs";
33
export default [
44
...connorjsConfig,
55
{
6-
// Ignore declaration files for ESLint because this package does not have TypeScript
7-
ignores: [`**/*.d.css.ts`],
6+
// Ignore declaration files used for tests. These represent generated files.
7+
ignores: [`src/fixtures/**/*.d.css.ts`],
88
},
99
];
File renamed without changes.
File renamed without changes.

β€Žlint-staged.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export default {
2-
"*.{cjs,js,json}": [`prettier -w`, `eslint -f pretty --fix`],
2+
"*.{cjs,js,json,ts}": [`prettier -w`, `eslint -f pretty --fix`],
33
"*.{css,md,yaml,yml}": `prettier -w`,
44
};

0 commit comments

Comments
Β (0)