Browse Source

[NO-JIRA] Add live-reload of design system

tags/10.0.0.68432
Kevin Silva 1 year ago
parent
commit
11d32ba258

+ 2
- 2
server/sonar-web/design-system/build.gradle View File

@@ -10,7 +10,7 @@ sonar {
}

task "yarn_validate-ci"(type: Exec) {
dependsOn ":server:sonar-web:yarn_design-system"
dependsOn ":server:sonar-web:yarn_run"

inputs.dir('src')

@@ -25,7 +25,7 @@ task "yarn_validate-ci"(type: Exec) {
}

task "yarn_lint-report-ci"(type: Exec) {
dependsOn ":server:sonar-web:yarn_design-system"
dependsOn ":server:sonar-web:yarn_run"

['src'].each {
inputs.dir(it)

+ 1
- 0
server/sonar-web/package.json View File

@@ -71,6 +71,7 @@
"@typescript-eslint/parser": "5.49.0",
"autoprefixer": "10.4.13",
"chalk": "4.1.2",
"chokidar": "3.5.3",
"design-system": "1.0.0",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.7",

+ 3
- 3
server/sonar-web/scripts/build-design-system.js View File

@@ -28,15 +28,15 @@ function buildDesignSystem(callback) {

const build = spawn('npx', ['turbo', 'run', 'design-system#build']);

build.stdout.on('data', function (data) {
build.stdout.on('data', (data) => {
console.log(chalk.green.bold(data.toString()));
});

build.stderr.on('data', function (data) {
build.stderr.on('data', (data) => {
console.log(chalk.red.bold(data.toString()));
});

build.on('exit', function (code) {
build.on('exit', (code) => {
if (code === 0) {
callback();
}

+ 8
- 0
server/sonar-web/scripts/start.js View File

@@ -22,6 +22,7 @@ process.env.NODE_ENV = 'development';

const fs = require('fs');
const chalk = require('chalk');
const chokidar = require('chokidar');
const esbuild = require('esbuild');
const http = require('http');
const httpProxy = require('http-proxy');
@@ -122,3 +123,10 @@ async function run() {
}

buildDesignSystem(run);

chokidar
.watch('./design-system/src', {
ignored: /(^|[/\\])\../, // ignore dotfiles
persistent: true,
})
.on('change', () => buildDesignSystem());

+ 2
- 1
server/sonar-web/yarn.lock View File

@@ -4479,6 +4479,7 @@ __metadata:
"@typescript-eslint/parser": 5.49.0
autoprefixer: 10.4.13
chalk: 4.1.2
chokidar: 3.5.3
classnames: 2.3.2
clipboard: 2.0.11
core-js: 3.27.2
@@ -5407,7 +5408,7 @@ __metadata:
languageName: node
linkType: hard

"chokidar@npm:^3.5.2":
"chokidar@npm:3.5.3, chokidar@npm:^3.5.2":
version: 3.5.3
resolution: "chokidar@npm:3.5.3"
dependencies:

Loading…
Cancel
Save