Skip to content

Commit ccd1514

Browse files
Add TypeScript support. Drop support for Node 10 and 12. (#584)
* TS conversion part 1 (#564) * TS Part 2 (#565) * Bump prismjs from 1.25.0 to 1.27.0 in /website (#562) Bumps [prismjs](https://github.com/PrismJS/prism) from 1.25.0 to 1.27.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](PrismJS/prism@v1.25.0...v1.27.0) --- updated-dependencies: - dependency-name: prismjs dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * TS Part 2 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * ts part 3 (#566) * Ts part 5 (#567) * ts part 3 * part 5 * Ts part 6 (#568) * ts part 3 * part 5 * Imports * Round 7 (#569) * severity (#570) * Convert more files (#571) * Ts part 10 (#572) * Update .gitignore * Part 10 * Part 11 (#573) * TS Part 12 (#574) * Accept current state for ESLint (#575) * Ts part 14 (#576) * Update esbuild.config.js * Add @types/node * Reporter * Update tsconfig.json * Tests * Define more types * Add build to github workflows * Update tsconfig.json * Bump some deps and rule file path for different file systems (#577) * TS part 16 (#578) * file name formats * lint issues * Update ci.yml * Ts part 16 (#580) * file name formats * lint issues * Update ci.yml * Move docs folder to website * Delete Footer.js * Delete help.js * Delete index.js * Delete versions.js * Convert to v2 config * Update languages.js * Create .gitignore * Upgrade to v2 of docusaurus * Delete versioned docs * Delete main.css * Create styles.module.css * Create index.js * Create help.js * Create custom.css * Update sidebars.json * Update docusaurus.config.js * Update docusaurus.config.js * Update types ref. Remove source from files directory (#582) * Drop support for node 12 (#581) * Add migration docs (#583) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 9a0ef3f commit ccd1514

File tree

691 files changed

+13737
-30399
lines changed

Some content is hidden

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

691 files changed

+13737
-30399
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
website
22
coverage/
33
index.d.ts
4+
dist/

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
extends: ['eslint-config-tc', 'eslint-config-typescript-tc'],
3+
rules: {
4+
'no-prototype-builtins': 'off',
5+
'unicorn/filename-case': 'off',
6+
},
7+
};

.eslintrc.json

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

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-node@v3.0.0
1818
with:
19-
node-version: '12.x'
19+
node-version: '14'
2020
- run: npm ci --no-progress
21+
- run: npm run build
2122
- run: npm run lint
2223

2324
test:
@@ -27,7 +28,7 @@ jobs:
2728

2829
strategy:
2930
matrix:
30-
node: [10, 12, 14]
31+
node: [14, 16]
3132
# TODO: Add windows-latest
3233
os: [ubuntu-latest, macos-latest]
3334

@@ -38,4 +39,5 @@ jobs:
3839
with:
3940
node-version: ${{ matrix.node }}
4041
- run: npm ci --no-progress
42+
- run: npm run build
4143
- run: npm run test:ci

.github/workflows/prerelease.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3.0.0
1313
with:
14-
node-version: '12.x'
14+
node-version: '14'
1515
registry-url: 'https://registry.npmjs.org'
1616
- run: npm ci --no-progress --production
17+
- run: npm run build
1718
- run: npm version --no-push --no-git-tag-version --yes ${{ github.event.release.tag_name }}
1819
- run: npm publish --tag next
1920
env:

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3.0.0
1313
with:
14-
node-version: '12.x'
14+
node-version: '14'
1515
registry-url: 'https://registry.npmjs.org'
1616
- run: npm ci --no-progress --production
17+
- run: npm run build
1718
- run: npm version --no-push --no-git-tag-version --yes ${{ github.event.release.tag_name }}
1819
- run: npm publish --tag latest
1920
env:

.gitignore

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ coverage
2525
# nyc test coverage
2626
.nyc_output
2727

28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
3428
# node-waf configuration
3529
.lock-wscript
3630

@@ -59,30 +53,12 @@ typings/
5953
# Output of 'npm pack'
6054
*.tgz
6155

62-
# Yarn Integrity file
63-
.yarn-integrity
64-
6556
# dotenv environment variables file
6657
.env
6758
.env.test
6859

6960
# parcel-bundler cache (https://parceljs.org/)
7061
.cache
7162

72-
# next.js build output
73-
.next
74-
75-
# nuxt.js build output
76-
.nuxt
77-
78-
# vuepress build output
79-
.vuepress/dist
80-
81-
# Serverless directories
82-
.serverless/
83-
84-
# FuseBox cache
85-
.fusebox/
86-
87-
# DynamoDB Local files
88-
.dynamodb/
63+
# compile output
64+
dist

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Node
66

7-
* [Node.js](https://nodejs.org/) - v10.0.0+
7+
* [Node.js](https://nodejs.org/) - v14.0.0+
88
* [npm](https://www.npmjs.com/) - v6.0.0+
99

1010
## Install project dependencies

esbuild.config.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires, import/no-extraneous-dependencies */
2+
3+
const esbuild = require('esbuild');
4+
// Automatically exclude all node_modules from the bundled version
5+
const {nodeExternalsPlugin} = require('esbuild-node-externals');
6+
const {readdirSync} = require('fs');
7+
const path = require('path');
8+
9+
const rulesDirectory = path.join(__dirname, 'src', 'rules');
10+
const bundle = true;
11+
const minify = true;
12+
const platform = 'node';
13+
const sourcemap = true;
14+
const target = 'node14';
15+
const plugins = [nodeExternalsPlugin()];
16+
17+
readdirSync(rulesDirectory).forEach((file) => {
18+
const ruleFilePath = path.join(rulesDirectory, file);
19+
const beginIndex = 0;
20+
const endIndex = -3;
21+
const ruleFileNameWithoutExtension = file.slice(beginIndex, endIndex);
22+
23+
esbuild
24+
.build({
25+
entryPoints: [ruleFilePath],
26+
outfile: `dist/rules/${ruleFileNameWithoutExtension}.js`,
27+
bundle,
28+
minify,
29+
platform,
30+
sourcemap: false,
31+
target,
32+
plugins,
33+
})
34+
// eslint-disable-next-line unicorn/no-process-exit
35+
.catch(() => process.exit(1));
36+
});
37+
38+
esbuild
39+
.build({
40+
entryPoints: ['./src/api.ts'],
41+
outfile: 'dist/api.js',
42+
bundle,
43+
minify,
44+
platform,
45+
sourcemap,
46+
target,
47+
plugins,
48+
})
49+
// eslint-disable-next-line unicorn/no-process-exit
50+
.catch(() => process.exit(1));
51+
52+
esbuild
53+
.build({
54+
entryPoints: ['./src/cli.ts'],
55+
outfile: 'dist/cli.js',
56+
bundle,
57+
minify,
58+
platform,
59+
sourcemap,
60+
target,
61+
plugins,
62+
})
63+
// eslint-disable-next-line unicorn/no-process-exit
64+
.catch(() => process.exit(1));

index.d.ts

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

0 commit comments

Comments
 (0)