Skip to content

Commit

Permalink
Merge branch 'master' into feat-domain-fetcher-circuit-breaker
Browse files Browse the repository at this point in the history
  • Loading branch information
jordevo committed Jun 12, 2024
2 parents 84b55c4 + 398c7b9 commit ad09b5e
Show file tree
Hide file tree
Showing 18 changed files with 174 additions and 68 deletions.
9 changes: 9 additions & 0 deletions packages/eslint-plugin-sui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

# 1.6.0 (2024-06-10)


### Features

* rename rule ([caa0f89](https://github.com/SUI-Components/sui/commit/caa0f89372b79f5045afe5baa93812d787c4a844))



# 1.5.0 (2024-05-10)


Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-sui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-sui",
"version": "1.5.0",
"version": "1.6.0",
"access": "public",
"description": "Set of sui lint rules",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-sui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ module.exports = {
'serialize-deserialize': SerializeDeserialize,
commonjs: CommonJS,
decorators: Decorators,
layersArch: LayersArch
'layers-arch': LayersArch
}
}
38 changes: 38 additions & 0 deletions packages/lint-repository-sui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# CHANGELOG

# 1.12.0 (2024-06-10)


### Features

* ui doenst have a src folder ([580ece7](https://github.com/SUI-Components/sui/commit/580ece7ecb45aff9fb8b3686765e39ec88992b8a))



# 1.11.0 (2024-06-10)


### Features

* fix linting error ([a009f1a](https://github.com/SUI-Components/sui/commit/a009f1a85ed3b14ef9f4cb58b333bc161a551dc8))
* fix mandatory path checks ([55d4e6d](https://github.com/SUI-Components/sui/commit/55d4e6dfc3db9f8815adecfbe4aa75fd748b6200))
* remove reserved word ([89aedcf](https://github.com/SUI-Components/sui/commit/89aedcf8c7fd958130353adfe98ffc116d19e136))



# 1.10.0 (2024-06-07)


### Features

* force deploy ([93d19d3](https://github.com/SUI-Components/sui/commit/93d19d3753c6fc4348fbc30903aad783328fd2f4))



# 1.6.0 (2024-06-07)


### Bug Fixes

* fix structure rule ([da2a9cd](https://github.com/SUI-Components/sui/commit/da2a9cdd8a2b2eee534c99dd33f53c801ae4f70e))



# 1.5.0 (2024-05-10)


Expand Down
2 changes: 1 addition & 1 deletion packages/lint-repository-sui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lint-repository-sui",
"access": "public",
"version": "1.5.0",
"version": "1.12.0",
"description": "Set of sui lint rules to lint a repository",
"keywords": [],
"author": "Sui",
Expand Down
45 changes: 9 additions & 36 deletions packages/lint-repository-sui/src/rules/structure.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const dedent = require('string-dedent')

const MANDATORY_PACKAGES = ['domain', 'literals', 'theme', 'ui']
const FILES_AND_FOLDERS = [
'.docker',
'.github',
Expand All @@ -9,34 +10,24 @@ const FILES_AND_FOLDERS = [
'.nvmrc',
'.dockerignore',
'.gitignore',
'tsconfig.json',
'README.md',

'app/src',
'app/test',
'app/Makefile',
'app/package.json',
'app/tsconfig.json',
'app/CHANGELOG.md',

'app/src/pages',
'app/src/app.(t|j)s(x)?',
'app/src/contextFactory.(t|j)s(x)?',
'app/src/hooks.(t|j)s(x)?',
'app/src/contextFactory{.js,.ts,/index.js,/index.ts}',
'app/src/hooks{.js,.ts,/index.js,/index.ts}',
'app/src/index.html',
'app/src/index.(s)?css',
'app/src/routes.(t|j)s(x)?',
'packages/**/src',
'packages/**/test',
'packages/**/Makefile',
'packages/**/package.json',
'packages/**/tsconfig.json',
'packages/**/CHANGELOG.md',

'deploy/config-(pre|pro).yml',
'deploy/*-(pre|pro)-paas.yml',
...MANDATORY_PACKAGES.map(pkg =>
[pkg !== 'ui' && `packages/${pkg}/src`, `packages/${pkg}/Makefile`, `packages/${pkg}/package.json`].filter(Boolean)
).flat(Infinity),
'packages/domain/test',
'deploy/config-pro.yml',
'deploy/*-pro-paas.yml',
'deploy/tags.yml',

'qa/e2e'
]

Expand Down Expand Up @@ -64,24 +55,6 @@ module.exports = {
create: function (context) {
return {
...Object.fromEntries(FILES_AND_FOLDERS.map(pattern => [pattern, () => context.monitoring(true)])),

'.github/dependabot.yml': matches => {
const [match] = matches
const json = match.parsed
const labels = json?.updates[0]?.labels || []
const isAutomergeEnabled = labels.find(key => key === 'skynet:merge')

if (!isAutomergeEnabled) {
context.monitoring(false)
context.report({
messageId: 'automergeDisabled'
})
return
}

context.monitoring(true)
},

missmatch: key => {
context.monitoring(false)
context.report({
Expand Down
9 changes: 9 additions & 0 deletions packages/sui-domain/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG

# 2.17.0 (2024-06-10)


### Features

* Add DomainError class ([f89d4fb](https://github.com/SUI-Components/sui/commit/f89d4fb9b0980af58d1e24c9d8d2117113fe50b5))



# 2.16.0 (2024-05-22)


Expand Down
2 changes: 1 addition & 1 deletion packages/sui-domain/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@s-ui/domain",
"type": "module",
"version": "2.16.0",
"version": "2.17.0",
"description": "SDK for creating domains",
"main": "lib/index.js",
"scripts": {
Expand Down
25 changes: 25 additions & 0 deletions packages/sui-domain/src/DomainError.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Base class for handling errors in the domain layer
*/
export default class DomainError extends Error {
constructor({code, message, cause}) {
super(message, {cause})
this.name = 'DomainError'
this.code = code
}

/**
* DomainError factory method
*
* @param {String} code Code to identify the error instance. It's required.
* @param {String} message Description for the error useful for giving more context.
* @param {Object} cause Keeps the original error useful for wrapping uncontrolled errors.
*/
static create({code, message, cause}) {
if (!code) {
throw new Error('[DomainError] The code property is required.')
}

return new DomainError({code, message, cause})
}
}
1 change: 1 addition & 0 deletions packages/sui-domain/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export {default as DomainError} from './DomainError.js'
export {default as Entity} from './Entity.js'
export {default as EntryPointFactory} from './EntryPointFactory.js'
export {default as CircuitBreakerManager} from './circuitBreaker/CircuitBreakerManager.js'
Expand Down
14 changes: 14 additions & 0 deletions packages/sui-lint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# CHANGELOG

# 4.42.0 (2024-06-10)


### Features

* add more support to typescript ([b3616de](https://github.com/SUI-Components/sui/commit/b3616dedc3a780abd1380b8d35726601fa9b0354))
* Add support to parse TS files ([a5c8730](https://github.com/SUI-Components/sui/commit/a5c8730a271c9271c6882d81fe64349b3af778e2))
* add support to typescript ([2e43455](https://github.com/SUI-Components/sui/commit/2e4345526fe601518657921cceb0a50e6eda9af6))
* Enabled all eslint rules ([2866abf](https://github.com/SUI-Components/sui/commit/2866abfef72c1fb33f65e2f7e0b65a909d0cadb7))
* rename rule ([f4f04b5](https://github.com/SUI-Components/sui/commit/f4f04b5ed9875691d99b5d90d3d4ce746f50926e))
* restore original versions ([015daf5](https://github.com/SUI-Components/sui/commit/015daf5fcf24cee4edb001bcd8c98359f538931d))



# 4.41.0 (2024-04-05)


Expand Down
24 changes: 14 additions & 10 deletions packages/sui-lint/eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ module.exports = {
'react-hooks',
'simple-import-sort',
'jest',
'jest-dom'
'jest-dom',
'sui'
],
rules: {
...REACT_RULES,
Expand All @@ -198,17 +199,20 @@ module.exports = {
'prefer-regex-literals': RULES.WARNING,
'prettier/prettier': [RULES.ERROR, prettierOptions],
'simple-import-sort/imports': [RULES.WARNING, {groups: IMPORT_SORT_GROUPS}],
'react/jsx-no-bind': RULES.OFF
'react/jsx-no-bind': RULES.OFF,
'sui/commonjs': RULES.WARNING,
'sui/layers-arch': RULES.WARNING
},
overrides: [
// {
// files: ['**/domain/src/**'],
// plugins: ['sui'],
// rules: {
// 'sui/factory-pattern': RULES.WARNING,
// 'sui/serialize-deserialize': RULES.WARNING
// }
// },
{
files: ['**/domain/src/**', 'domain/src/**'],
plugins: ['sui'],
rules: {
'sui/factory-pattern': RULES.WARNING,
'sui/serialize-deserialize': RULES.WARNING,
'sui/decorators': RULES.WARNING
}
},
{
files: ['**/*.+(ts|tsx)'],
extends: ['standard-with-typescript', 'standard-react', 'prettier'],
Expand Down
19 changes: 14 additions & 5 deletions packages/sui-lint/eslintrc.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ module.exports = {
'react-hooks',
'simple-import-sort',
'jest',
'jest-dom'
// 'sui'
'jest-dom',
'sui'
],
rules: {
...REACT_RULES,
Expand All @@ -199,11 +199,20 @@ module.exports = {
'prefer-regex-literals': RULES.WARNING,
'prettier/prettier': [RULES.ERROR, prettierOptions],
'simple-import-sort/imports': [RULES.WARNING, {groups: IMPORT_SORT_GROUPS}],
'react/jsx-no-bind': RULES.OFF
// 'sui/factory-pattern': RULES.WARNING,
// 'sui/serialize-deserialize': RULES.WARNING
'react/jsx-no-bind': RULES.OFF,
'sui/commonjs': RULES.WARNING,
'sui/layers-arch': RULES.WARNING
},
overrides: [
{
files: ['**/domain/src/**', 'domain/src/**'],
plugins: ['sui'],
rules: {
'sui/factory-pattern': RULES.WARNING,
'sui/serialize-deserialize': RULES.WARNING,
'sui/decorators': RULES.WARNING
}
},
{
files: ['**/*.+(ts|tsx)'],
extends: ['standard-with-typescript', 'standard-react', 'prettier'],
Expand Down
2 changes: 1 addition & 1 deletion packages/sui-lint/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-ui/lint",
"version": "4.41.0",
"version": "4.42.0",
"description": "Linting CLI for sui packages",
"main": "./bin/sui-lint.js",
"bin": {
Expand Down
11 changes: 11 additions & 0 deletions packages/sui-studio/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# CHANGELOG

# 11.43.0 (2024-06-10)


### Features

* Add jest compatibility with test path on studio-dev ([7f98fa7](https://github.com/SUI-Components/sui/commit/7f98fa7cb7ebe8492d1901fc43c3ad3027bc41ec))
* Delete unnecesary conditional with isJestTest ([e0f232b](https://github.com/SUI-Components/sui/commit/e0f232b681435f43bddab4f156234ce69333052b))
* Disable Test component if detect jest folder ([04ba88f](https://github.com/SUI-Components/sui/commit/04ba88f6b2fb44eda407f6db6ee39314bbb15a2c))



# 11.42.0 (2024-05-09)


Expand Down
7 changes: 6 additions & 1 deletion packages/sui-studio/bin/sui-studio-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,20 @@ if (!category || !component) {

const componentPath = path.join(PWD, 'components', category, component)
const legacyTestPath = path.join(PWD, 'test', category, component)
const jestPath = path.join(componentPath, '__tests__')

const testPath = fs.existsSync(legacyTestPath) ? legacyTestPath : path.join(componentPath, 'test')
const isJestTest = fs.existsSync(jestPath)

const {cache, ...others} = config

const studioDevConfig = {
...others,
context: path.join(__dirname, '..', 'workbench', 'src'),
plugins: [...config.plugins, new webpack.DefinePlugin({__COMPONENT_ID__: JSON.stringify(componentID)})],
plugins: [
...config.plugins,
new webpack.DefinePlugin({__COMPONENT_ID__: JSON.stringify(componentID), __DISABLE_TESTS__: isJestTest})
],
resolve: {
...config.resolve,
alias: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sui-studio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-ui/studio",
"version": "11.42.0",
"version": "11.43.0",
"description": "Develop, maintain and publish your SUI components.",
"main": "index.js",
"bin": {
Expand Down
Loading

0 comments on commit ad09b5e

Please sign in to comment.