Skip to content

Commit

Permalink
Merge branch 'master' into upgrade-typescript-version
Browse files Browse the repository at this point in the history
  • Loading branch information
kikoruiz committed Oct 11, 2023
2 parents cac3edc + 3c6f4fc commit 96e120a
Show file tree
Hide file tree
Showing 70 changed files with 1,365 additions and 512 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @sui-bot @kikoruiz @andresz1
* @sui-bot @kikoruiz @andresz1 @carlosvillu
93 changes: 29 additions & 64 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,74 +2,39 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]

env:
DATE: $(date +%FT%TZ)
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Redundant Builds
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v2
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- uses: browser-actions/setup-chrome@latest
- run: sudo apt-get install xvfb
- run: npm install --no-save --no-fund --no-audit --legacy-peer-deps
- run: npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null
- run: npm run lint
- run: npm run test:server:ci
- run: xvfb-run --auto-servernum npm run test:client:ci
- run: npx -p ./packages/sui-ci sui-ci release
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
GITHUB_EMAIL: [email protected]
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }}
GITHUB_USER: sui-bot
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

metrics:
name: 'Send Metrics to Devhose'
runs-on: ubuntu-latest
needs: [ build ]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- run: |
./bin/devhose-cli_2.17.0_amd64 deployment \
-devhose-tenant "adevinta-spain-fe-github-sui" \
-devhose-secret "${{ secrets.DEVHOSE_SECRET }}" \
-devhose-dest "mpi" \
-application "sui" \
-environment "pro" \
-facility "sdrn:adevinta:service:adevinta-spain-sui-github" \
-id "${{ github.run_id }}" \
-source "github" \
-started-at "${{ env.DATE }}" \
-status "succeeded" \
-target-infrastructure "npm" \
-target-provider "npm" \
-trigger-type "build" \
-trigger-source "github" \
-resource-type "github" \
-resource-service "sdrn:adevinta:service:github" \
-accelerate-metrics \
-resource-scm-commit "${{ github.sha }}" \
-resource-repository "sdrn:adevinta:repo:github.com/${{ github.repository }}"
- name: Cancel Previous Redundant Builds
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v2
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- uses: browser-actions/setup-chrome@latest
- run: sudo apt-get install xvfb
- run: npm install --no-save --no-fund --no-audit --legacy-peer-deps
- run: npx -y ultra-runner --raw --recursive prepublishOnly &>/dev/null
- run: npm run lint
- run: npm run test:server:ci
- run: xvfb-run --auto-servernum npm run test:client:ci
- run: npx -p ./packages/sui-ci sui-ci release
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
GITHUB_EMAIL: [email protected]
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }}
GITHUB_USER: sui-bot
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ packages/sui-studio/test/server/integration/empty-studio/components/fake/compone

!packages/sui-sass-loader/test/server/fixtures/**/node_modules

contract/logs/pact.log
contract/logs/pact.log
.npmrc
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SUI is a set of packages which goal to ease development of SUI-based components
| [sui-helpers](./packages/sui-helpers) | A set of internal helpers used by sui-related packages. |
| [sui-hoc](./packages/sui-hoc) | React utility belt for function components and higher-order components |
| [sui-i18n](./packages/sui-i18n) | Isomorphic i18n service for browser and node |
| [sui-jest](./packages/sui-jest) | CLI to work with Jest |
| [sui-js](./packages/sui-js) | Javascript utilities |
| [sui-js-compiler](./packages/sui-js-compiler) | Javascript compiler |
| [sui-lint](./packages/sui-lint) | CLI to lint your code and make it compliant to SUI official rules |
Expand Down
Binary file removed bin/devhose-cli_2.17.0_amd64
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@
"stylelint": {
"extends": "./node_modules/@s-ui/lint/stylelint.config.js"
}
}
}
41 changes: 41 additions & 0 deletions packages/sui-bundler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# CHANGELOG

# 9.42.0 (2023-09-29)


### Features

* **packages/sui-bundler:** Add option to save stats.json in build ([a46a346](https://github.com/SUI-Components/sui/commit/a46a346124da17fa2852d05a85a98afabf79094d))



# 9.41.0 (2023-08-28)


### Bug Fixes

* **packages/sui-bundler:** Fix bundler error display ([31a1499](https://github.com/SUI-Components/sui/commit/31a1499c740709196ac08ed0cab93885f09fa711))



# 9.40.0 (2023-08-24)


### Features

* **packages/sui-bundler:** disable error overlay ([2da7c44](https://github.com/SUI-Components/sui/commit/2da7c44cb79b15ab466dfef7cad34cb46bbdf2d6))



# 9.39.0 (2023-08-14)


### Bug Fixes

* **packages/sui-bundler:** upgrade versions for security ([1b5d3aa](https://github.com/SUI-Components/sui/commit/1b5d3aa3659bc8f363b6ea9cf34305a04e2457c5))


### Features

* **packages/sui-bundler:** add fast refresh support ([b47bc8c](https://github.com/SUI-Components/sui/commit/b47bc8cdc2ae6c4862508b3b6c6cb39082865b08))



# 9.38.0 (2023-05-04)


Expand Down
9 changes: 9 additions & 0 deletions packages/sui-bundler/bin/sui-bundler-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'production'

program
.option('-C, --clean', 'Remove public folder before create a new one')
.option('-S, --save-stats', 'Save stats.json in public folder')
.option(
'-l, --link-package [package]',
'Replace each occurrence of this package with an absolute path to this folder',
Expand All @@ -43,6 +44,7 @@ program
const {
clean = false,
context,
saveStats,
linkPackage: packagesToLink = []
} = program.opts()

Expand Down Expand Up @@ -88,6 +90,13 @@ compiler.run(async (error, stats) => {

console.log(`Webpack stats: ${stats}`)

if (saveStats) {
const filePath = `${process.cwd()}/public/stats.json`
fs.writeFileSync(filePath, JSON.stringify(stats.toJson(), null, 2), {
encoding: 'utf8'
})
}

const offlinePath = path.join(process.cwd(), 'src', 'offline.html')
const offlinePageExists = fs.existsSync(offlinePath)
const {offline: offlineConfig = {}} = projectConfig
Expand Down
15 changes: 12 additions & 3 deletions packages/sui-bundler/bin/sui-bundler-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,18 @@ log.processing('Generating minified bundle...')
webpack(webpackConfig).run((error, stats) => {
if (error) {
showError(error, program)
return 1
process.exit(1)
}

if (stats.hasErrors()) {
const jsonStats = stats.toJson('errors-warnings')
jsonStats.errors?.forEach(error => log.error(error.message))
process.exit(1)
}

if (stats.hasWarnings()) {
const jsonStats = stats.toJson('errors-warnings')
jsonStats.warnings?.forEach(warning => log.warn(warning.message))
}

if (stats.hasErrors() || stats.hasWarnings()) {
Expand All @@ -86,6 +97,4 @@ webpack(webpackConfig).run((error, stats) => {
log.success(
`Your library is compiled in production mode in: \n${outputFolder}`
)

return 0
})
8 changes: 5 additions & 3 deletions packages/sui-bundler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-ui/bundler",
"version": "9.38.0",
"version": "9.42.0",
"description": "Config-free bundler for ES6 React apps.",
"bin": {
"sui-bundler": "./bin/sui-bundler.js"
Expand Down Expand Up @@ -47,9 +47,11 @@
"strip-ansi": "6.0.1",
"style-loader": "3.3.1",
"url": "0.11.0",
"webpack": "5.74.0",
"webpack": "5.82.1",
"webpack-dev-server": "4.10.0",
"webpack-manifest-plugin": "5.0.0",
"webpack-node-externals": "3.0.0"
"webpack-node-externals": "3.0.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"react-refresh": "0.14.0"
}
}
9 changes: 8 additions & 1 deletion packages/sui-bundler/shared/module-rules-babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ const EXCLUDED_FOLDERS_REGEXP = new RegExp(
`node_modules(?!${path.sep}@s-ui(${path.sep}studio)(${path.sep}workbench)?${path.sep}src)`
)

module.exports = ({isServer = false, supportLegacyBrowsers = true} = {}) => ({
module.exports = ({
isServer = false,
isDevelopment = false,
supportLegacyBrowsers = true
} = {}) => ({
test: /\.jsx?$/,
exclude: EXCLUDED_FOLDERS_REGEXP,
use: [
Expand All @@ -16,6 +20,9 @@ module.exports = ({isServer = false, supportLegacyBrowsers = true} = {}) => ({
cacheCompression: false,
babelrc: false,
compact: true,
plugins: [
isDevelopment && require.resolve('react-refresh/babel')
].filter(Boolean),
presets: [
[
require.resolve('babel-preset-sui'),
Expand Down
Loading

0 comments on commit 96e120a

Please sign in to comment.