Skip to content

Commit 942a606

Browse files
committed
chore: aligned project framework with template
1 parent f016a9d commit 942a606

File tree

12 files changed

+523
-200
lines changed

12 files changed

+523
-200
lines changed

.eslintrc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@
2828
"no-constant-condition": 0,
2929
"no-useless-escape": 0,
3030
"no-console": "error",
31+
"no-restricted-globals": [
32+
"error",
33+
{
34+
"name": "global",
35+
"message": "Use `globalThis` instead"
36+
},
37+
{
38+
"name": "window",
39+
"message": "Use `globalThis` instead"
40+
}
41+
],
3142
"require-yield": 0,
3243
"eqeqeq": ["error", "smart"],
3344
"spaced-comment": [
@@ -39,7 +50,8 @@
3950
},
4051
"block": {
4152
"exceptions": ["*"]
42-
}
53+
},
54+
"markers": ["/"]
4355
}
4456
],
4557
"capitalized-comments": [
@@ -80,7 +92,8 @@
8092
],
8193
"pathGroupsExcludedImportTypes": [
8294
"type"
83-
]
95+
],
96+
"newlines-between": "never"
8497
}
8598
],
8699
"@typescript-eslint/no-namespace": 0,
@@ -102,7 +115,7 @@
102115
"@typescript-eslint/consistent-type-imports": ["error"],
103116
"@typescript-eslint/consistent-type-exports": ["error"],
104117
"no-throw-literal": "off",
105-
"@typescript-eslint/no-throw-literal": ["error"],
118+
"@typescript-eslint/no-throw-literal": "off",
106119
"@typescript-eslint/no-floating-promises": ["error", {
107120
"ignoreVoid": true,
108121
"ignoreIIFE": true

.gitlab-ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ variables:
1717
HOMEBREW_CACHE: "${CI_PROJECT_DIR}/tmp/Homebrew"
1818

1919
default:
20-
image: registry.gitlab.com/matrixai/engineering/maintenance/gitlab-runner
2120
interruptible: true
2221
before_script:
2322
# Replace this in windows runners that use powershell
@@ -44,6 +43,7 @@ stages:
4443
- integration # Cross-platform application bundling, integration tests, and pre-release
4544
- release # Cross-platform distribution and deployment
4645

46+
image: registry.gitlab.com/matrixai/engineering/maintenance/gitlab-runner
4747

4848
check:lint:
4949
stage: check
@@ -157,9 +157,6 @@ build:linux:
157157
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
158158

159159
build:windows:
160-
inherit:
161-
default:
162-
- interruptible
163160
stage: build
164161
needs: []
165162
tags:
@@ -170,7 +167,7 @@ build:windows:
170167
- .\scripts\choco-install.ps1
171168
- refreshenv
172169
- npm install --ignore-scripts
173-
- $env:Path = "$(npm bin);" + $env:Path
170+
- $env:Path = "$(npm root)\.bin;" + $env:Path
174171
- npm test -- --ci --coverage
175172
artifacts:
176173
when: always
@@ -198,7 +195,7 @@ build:macos:
198195
- ./scripts/brew-install.sh
199196
- hash -r
200197
- npm install --ignore-scripts
201-
- export PATH="$(npm bin):$PATH"
198+
- export PATH="$(npm root)/.bin:$PATH"
202199
- npm test -- --ci --coverage
203200
artifacts:
204201
when: always

docs/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ <h3>Docs Generation</h3>
4343
<a href="#publishing" id="publishing" style="color: inherit; text-decoration: none;">
4444
<h3>Publishing</h3>
4545
</a>
46+
<p>Publishing is handled automatically by the staging pipeline.</p>
47+
<p>Prerelease:</p>
48+
<pre><code class="language-sh"><span class="hl-1"># npm login</span><br/><span class="hl-0">npm version prepatch --preid alpha </span><span class="hl-1"># premajor/preminor/prepatch</span><br/><span class="hl-0">git push --follow-tags</span>
49+
</code></pre>
50+
<p>Release:</p>
51+
<pre><code class="language-sh"><span class="hl-1"># npm login</span><br/><span class="hl-0">npm version patch </span><span class="hl-1"># major/minor/patch</span><br/><span class="hl-0">git push --follow-tags</span>
52+
</code></pre>
53+
<p>Manually:</p>
4654
<pre><code class="language-sh"><span class="hl-1"># npm login</span><br/><span class="hl-0">npm version patch </span><span class="hl-1"># major/minor/patch</span><br/><span class="hl-0">npm run build</span><br/><span class="hl-0">npm publish --access public</span><br/><span class="hl-0">git push</span><br/><span class="hl-0">git push --tags</span>
4755
</code></pre>
4856
</div></div>

jest.config.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,21 @@ module.exports = {
3333
roots: ['<rootDir>/tests'],
3434
testMatch: ['**/?(*.)+(spec|test|unit.test).+(ts|tsx|js|jsx)'],
3535
transform: {
36-
'^.+\\.tsx?$': 'ts-jest',
37-
'^.+\\.jsx?$': 'babel-jest',
36+
"^.+\\.(t|j)sx?$": [
37+
"@swc/jest",
38+
{
39+
jsc: {
40+
parser: {
41+
syntax: "typescript",
42+
tsx: true,
43+
decorators: compilerOptions.experimentalDecorators,
44+
dynamicImport: true,
45+
},
46+
target: compilerOptions.target.toLowerCase(),
47+
keepClassNames: true,
48+
},
49+
}
50+
],
3851
},
3952
reporters: [
4053
'default',
@@ -60,6 +73,9 @@ module.exports = {
6073
// Setup files after env are executed before each test file
6174
// after the jest test environment is installed
6275
// Can access globals
63-
setupFilesAfterEnv: ['<rootDir>/tests/setupAfterEnv.ts'],
76+
setupFilesAfterEnv: [
77+
'jest-extended/all',
78+
'<rootDir>/tests/setupAfterEnv.ts'
79+
],
6480
moduleNameMapper: moduleNameMapper,
6581
};

0 commit comments

Comments
 (0)