Skip to content

Commit e59d554

Browse files
authored
v1.0.0 Merge pull request #64 from SolidOS/newFace
Structural improvements
2 parents 31066b2 + 675590f commit e59d554

38 files changed

Lines changed: 10454 additions & 8138 deletions

.github/workflows/CI.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ permissions:
88
on:
99
push:
1010
branches:
11-
- "**"
11+
- main
1212
pull_request:
1313
branches:
14-
- "**"
14+
- main
1515
workflow_dispatch:
1616

1717
jobs:
@@ -22,7 +22,6 @@ jobs:
2222
strategy:
2323
matrix:
2424
node-version:
25-
- 18.x
2625
- 20.x
2726
- 22.x
2827

@@ -35,7 +34,7 @@ jobs:
3534
- run: npm ci
3635
- run: npm run lint --if-present
3736
- run: npm test
38-
- run: npm run test:e2e
37+
- run: npm run test-e2e
3938
- run: npm run build --if-present
4039
- name: Save build
4140
if: matrix.node-version == '20.x'

.storybook/main.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
module.exports = {
2-
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
2+
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
33
addons: [
4-
"@storybook/addon-links",
5-
"@storybook/addon-webpack5-compiler-babel",
6-
"@chromatic-com/storybook",
7-
"@storybook/addon-docs"
4+
'@storybook/addon-links',
5+
'@storybook/addon-webpack5-compiler-babel',
6+
'@chromatic-com/storybook',
7+
'@storybook/addon-docs'
88
],
99

1010
webpackFinal: async (config) => {
1111
config.externals = {
12-
fs: "null",
13-
};
12+
fs: 'null',
13+
}
1414
config.resolve = {
1515
...config.resolve,
16-
extensions: [...config.resolve.extensions, ".ts", ".tsx"],
16+
extensions: [...config.resolve.extensions, '.ts', '.tsx'],
1717
fallback: {
1818
...config.resolve.fallback,
19-
"path": false
19+
path: false
20+
},
21+
alias: {
22+
...(config.resolve.alias || {}),
23+
$rdf: require.resolve('rdflib'),
24+
SolidLogic: require.resolve('solid-logic'),
2025
}
21-
};
22-
return config;
26+
}
27+
return config
2328
},
2429

2530
framework: {
26-
name: "@storybook/react-webpack5",
31+
name: '@storybook/react-webpack5',
2732
options: {}
2833
},
2934

3035
docs: {},
3136

3237
typescript: {
33-
reactDocgen: "react-docgen-typescript"
38+
reactDocgen: 'react-docgen-typescript'
3439
}
35-
};
40+
}

.storybook/preview.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
21
export const parameters = {
32
actions: { },
43
}
5-
export const tags = ["autodocs"];
4+
export const tags = ['autodocs']

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ A visualization of [Activity Streams](https://www.w3.org/TR/activitystreams-voca
2525
To run all tests:
2626
```shell script
2727
npm run test
28-
npm run test:e2e
28+
npm run test-e2e
2929
```
3030

3131
#### Unit tests
3232

33-
Unit tests use `jest` and are placed next to the tested file as `*.spec.ts` files.
33+
Unit tests use `jest` and are placed in the test/unit folder and have `*.spec.ts` extension.
3434

3535
#### E2E tests
3636

babel.config.js

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

babel.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
presets: [
3+
['@babel/preset-env', {
4+
targets: {
5+
browsers: ['> 1%', 'last 3 versions', 'not dead']
6+
}
7+
}],
8+
'@babel/preset-typescript',
9+
'@babel/preset-react'
10+
]
11+
}

eslint.config.mjs

Lines changed: 120 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,130 @@
1-
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2-
import storybook from "eslint-plugin-storybook";
3-
import { defineConfig } from "eslint/config";
4-
import tsParser from "@typescript-eslint/parser";
5-
import typescriptEslint from "@typescript-eslint/eslint-plugin";
6-
import js from "@eslint/js";
7-
import { FlatCompat } from "@eslint/eslintrc";
1+
import storybook from 'eslint-plugin-storybook'
2+
import tsParser from '@typescript-eslint/parser'
3+
import neostandard from 'neostandard'
4+
import globals from 'globals'
5+
import { fileURLToPath } from 'url'
6+
import { dirname } from 'path'
87

9-
const compat = new FlatCompat({
10-
baseDirectory: import.meta.dirname ?? process.cwd(),
11-
recommendedConfig: js.configs.recommended,
12-
allConfig: js.configs.all
13-
});
8+
const __dirname = dirname(fileURLToPath(import.meta.url))
149

15-
export default defineConfig([{
10+
export default [
11+
...neostandard(),
12+
{
13+
ignores: [
14+
'lib/**',
15+
'node_modules/**',
16+
'coverage/**',
17+
'storybook-static/**'
18+
],
19+
},
20+
{
21+
files: ['src/**/*.ts'],
1622
languageOptions: {
17-
parser: tsParser,
23+
globals: {
24+
...globals.browser,
25+
...globals.node,
26+
Atomics: 'readonly',
27+
SharedArrayBuffer: 'readonly',
28+
},
29+
parser: tsParser,
30+
parserOptions: {
31+
project: ['./tsconfig.json']
32+
},
1833
},
34+
rules: {
35+
// Style rules (not handled by TypeScript)
36+
semi: ['error', 'never'],
37+
quotes: ['error', 'single'],
1938

39+
// Disable ESLint rules that TypeScript handles better
40+
'no-unused-vars': 'off', // TypeScript handles this via noUnusedLocals
41+
'no-undef': 'off', // TypeScript handles undefined variables
42+
},
43+
settings: {
44+
react: {
45+
version: 'detect',
46+
},
47+
},
48+
},
49+
{
50+
files: ['src/**/*.tsx'],
2051
plugins: {
21-
"@typescript-eslint": typescriptEslint,
22-
storybook,
52+
storybook,
2353
},
54+
languageOptions: {
55+
globals: {
56+
...globals.browser,
57+
...globals.node,
58+
Atomics: 'readonly',
59+
SharedArrayBuffer: 'readonly',
60+
},
61+
parser: tsParser,
62+
parserOptions: {
63+
ecmaVersion: 2020,
64+
sourceType: 'module',
65+
ecmaFeatures: {
66+
jsx: true,
67+
},
68+
},
69+
},
70+
rules: {
71+
// Style rules (not handled by TypeScript)
72+
semi: ['error', 'never'],
73+
quotes: ['error', 'single'],
2474

25-
extends: compat.extends(
26-
"eslint:recommended",
27-
"plugin:@typescript-eslint/recommended",
28-
"plugin:react/recommended",
29-
),
30-
75+
// Disable ESLint rules that TypeScript handles better
76+
'no-unused-vars': 'off', // TypeScript handles this via noUnusedLocals
77+
'no-undef': 'off', // TypeScript handles undefined variables
78+
},
3179
settings: {
32-
react: {
33-
version: "detect",
34-
},
80+
react: {
81+
version: 'detect',
82+
},
83+
},
84+
},
85+
{
86+
files: ['src/**/*.js', 'src/**/*.cjs', 'src/**/*.mjs'],
87+
88+
languageOptions: {
89+
globals: {
90+
...globals.browser,
91+
...globals.node,
92+
Atomics: 'readonly',
93+
SharedArrayBuffer: 'readonly',
94+
}
95+
},
96+
rules: {
97+
// Code style - match TypeScript settings
98+
semi: ['error', 'never'],
99+
quotes: ['error', 'single'],
100+
101+
// Strict checking - match TypeScript strictness
102+
'no-console': 'error',
103+
'no-unused-vars': 'error', // Match TypeScript noUnusedLocals: true
104+
'no-undef': 'error',
105+
strict: ['error', 'global'], // Match TypeScript alwaysStrict: true
106+
107+
// Additional strictness to match TypeScript behavior
108+
'no-implicit-globals': 'error',
109+
'prefer-const': 'error', // Encourage immutability
110+
'no-var': 'error', // Use let/const only
111+
'no-redeclare': 'error'
112+
},
113+
},
114+
{
115+
files: ['e2e-test/**/*.ts', 'test/unit/**/*.ts', 'test/unit/**/*.tsx'],
116+
languageOptions: {
117+
parser: tsParser,
118+
parserOptions: {
119+
project: './tsconfig.test.json',
120+
tsconfigRootDir: __dirname,
121+
},
35122
},
36-
}]);
123+
rules: {
124+
semi: ['error', 'never'],
125+
quotes: ['error', 'single'],
126+
'no-console': 'off', // Allow console in tests
127+
'no-undef': 'off', // Tests may define globals
128+
}
129+
},
130+
]

jest.config.js

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

jest.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default {
2+
testEnvironment: 'jsdom',
3+
setupFilesAfterEnv: ['./test/jest.setup.ts'],
4+
testEnvironmentOptions: {
5+
customExportConditions: ['node']
6+
},
7+
transform: {
8+
'^.+\\.(ts|tsx|js|jsx)$': ['babel-jest', { configFile: './babel.config.mjs' }],
9+
},
10+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
11+
extensionsToTreatAsEsm: ['.ts', '.tsx'],
12+
moduleNameMapper: {
13+
'^SolidLogic$': 'solid-logic',
14+
'^\\$rdf$': 'rdflib'
15+
},
16+
}

0 commit comments

Comments
 (0)