Skip to content

Commit c417c42

Browse files
hunruhmasad-frost
authored andcommitted
Checkpoint
Co-authored-by: masad-frost <[email protected]>
1 parent 111101c commit c417c42

File tree

16 files changed

+8850
-0
lines changed

16 files changed

+8850
-0
lines changed

.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
es2021: true,
5+
},
6+
extends: [
7+
'eslint:recommended',
8+
'plugin:@typescript-eslint/strict-type-checked',
9+
'plugin:@typescript-eslint/stylistic-type-checked',
10+
'plugin:prettier/recommended',
11+
],
12+
parser: '@typescript-eslint/parser',
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
16+
project: ['./tsconfig.json'],
17+
},
18+
plugins: ['@typescript-eslint'],
19+
rules: {
20+
'linebreak-style': ['error', 'unix'],
21+
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
22+
},
23+
ignorePatterns: ['/*', '!/src'],
24+
};

.github/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: "18.x"
20+
21+
- name: Install Dependencies
22+
run: npm ci
23+
24+
- name: Typecheck and Build
25+
run: npm run build
26+
27+
- name: Test the build
28+
run: npm run test:build

.github/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Use Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: "20.x"
20+
21+
- name: Install Dependencies
22+
run: npm ci
23+
24+
- name: Run static checks
25+
run: npm run allstatic
26+
27+
# Tests require to run on replit, we'll add it to PRs
28+
# via custom github webhooks
29+
# - name: Run Tests
30+
# run: npm run test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
.npmrc

.replit

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
run = "npm run test:watch"
2+
3+
entrypoint = "src/index.ts"
4+
modules = ["nodejs-20:v12-20231130-57acee0"]
5+
6+
[nix]
7+
channel = "stable-23_11"
8+
9+
[deployment]
10+
run = ["tsx", "index.ts"]
11+
deploymentTarget = "cloudrun"
12+
ignorePorts = false
13+
14+
[[ports]]
15+
localPort = 24678
16+
externalPort = 80
17+
18+
19+
# disabled for now until multiple LSPs are properly supported
20+
# [languages.eslint]
21+
# pattern = "**{*.ts,*.js,*.tsx,*.jsx,*.json}"
22+
# [languages.eslint.languageServer]
23+
# start = "vscode-eslint-language-server --stdio"
24+
# [languages.eslint.languageServer.configuration]
25+
# nodePath = "node" # this should resolve to nvm
26+
# validate = "on"
27+
# useESLintClass = false
28+
# format = false
29+
# quiet = false
30+
# run = "onType"
31+
# packageManager = "npm"
32+
# rulesCustomizations = []
33+
# onIgnoredFiles = "off"
34+
# [languages.eslint.languageServer.configuration.workspaceFolder]
35+
# name = "replit-storage-typescript"
36+
# # we seem to not be able to use ${REPL_HOME} here as the vscode package does
37+
# # not evaluate the environment variable, and we need a `/` prefix so it
38+
# # knows we gave it an absolute path
39+
# uri = "file:///home/runner/${REPL_SLUG}"
40+
# [languages.eslint.languageServer.configuration.experimental]
41+
# useFlatConfig = false
42+
# [languages.eslint.languageServer.configuration.problems]
43+
# shortenToSingleLine = false
44+
# [languages.eslint.languageServer.configuration.codeAction.disableRuleComment]
45+
# enable = true
46+
# location = "separateLine"
47+
# commentStyle = "line"
48+
# [languages.eslint.languageServer.configuration.codeAction.showDocumentation]
49+
# enable = true

buildtests/cjs.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { expect, test } from "vitest";
2+
// @ts-ignore
3+
const storage = require("../dist");
4+
5+
test("cjs import test", async () => {
6+
expect(storage).toBeTruthy();
7+
expect(storage.Client).toBeTruthy();
8+
});

buildtests/esm.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { expect, test } from "vitest";
2+
// @ts-ignore
3+
import * as storageStarImport from "../dist";
4+
// @ts-ignore
5+
import { Client as ClientImport } from "../dist";
6+
7+
test("esm import test", async () => {
8+
expect(storageStarImport).toBeTruthy();
9+
expect(storageStarImport.Client).toBeTruthy();
10+
expect(ClientImport).toBeTruthy();
11+
});

0 commit comments

Comments
 (0)