Skip to content

Commit 9651922

Browse files
authored
Merge branch 'main' into added-bin-script
2 parents a56a470 + 5ee10d9 commit 9651922

File tree

80 files changed

+1707
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1707
-166
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ node_modules/
22
yarn.lock
33
yarn-error.log
44
package-lock.json
5+
.vscode
56
storybook-static/
67
coverage/
78
dist/
9+
tsconfig.tsbuildinfo
10+
tsconfig.build.tsbuildinfo
811
.env.local

.storybook/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const config = {
6565
'@ids-hooks': path.resolve(__dirname, '../packages/components/src/hooks'),
6666
'@ids-partials': path.resolve(__dirname, '../packages/components/src/partials'),
6767
'@ids-shared': path.resolve(__dirname, '../packages/components/src/shared'),
68-
'@ids-core': path.resolve(__dirname, '../packages/components/src/core'),
68+
'@ids-core': path.resolve(__dirname, '../packages/core/src'),
6969
};
7070

7171
webpackConfig.plugins.push(new NodePolyfillPlugin());

bin/prepare_ds_symlinks.mjs

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,11 @@ const getSourceDir = (packageName) => {
88
const currFileDir = path.dirname(fileURLToPath(import.meta.url));
99
const dsDir = path.join(currFileDir, '..');
1010

11-
return path.join(dsDir, 'packages', packageName, 'src');
11+
return path.join(dsDir, 'packages', packageName);
1212
}
1313
const createSymlink = (source, target) => {
1414
execSync(`mkdir -p ${target} && rm -rf ${target} && ln -s ${source} ${target}`);
1515
}
16-
const updateIbexaTSConfigFile = () => {
17-
const tsConfigFilePath = path.resolve('ibexa.tsconfig.json');
18-
const tsConfigContent = JSON.parse(fs.readFileSync(tsConfigFilePath, 'utf-8'));
19-
20-
tsConfigContent.compilerOptions ??= {};
21-
tsConfigContent.compilerOptions.paths ??= {};
22-
tsConfigContent.compilerOptions.paths['@ids-assets/*'] = [
23-
`${getSourceDir('assets')}/*`,
24-
];
25-
tsConfigContent.compilerOptions.paths['@ids-components/*'] = [
26-
`${getSourceDir('components')}/*`,
27-
];
28-
tsConfigContent.compilerOptions.paths['@ids-core/*'] = [
29-
`${getSourceDir('core')}/*`,
30-
];
31-
32-
fs.writeFileSync(tsConfigFilePath, JSON.stringify(tsConfigContent, null, 4));
33-
}
3416
const createSymlinks = () => {
3517
const composerJsonFilePath = path.resolve('composer.json');
3618
const composerJsonContent = JSON.parse(fs.readFileSync(composerJsonFilePath, 'utf-8'));
@@ -40,14 +22,35 @@ const createSymlinks = () => {
4022
const componentsSourcePath = getSourceDir('components');
4123
const coreSourcePath = getSourceDir('core');
4224
const assetsSourcePath = getSourceDir('assets');
43-
const componentsSymlinkPath = path.join(assetsDirPath, 'ids-components/dist');
44-
const coreSymlinkPath = path.join(assetsDirPath, 'ids-core/dist');
45-
const assetsSymlinkPath = path.join(assetsDirPath, 'ids-assets/dist');
25+
const componentsSymlinkPath = path.join(assetsDirPath, 'ids-components');
26+
const coreSymlinkPath = path.join(assetsDirPath, 'ids-core');
27+
const assetsSymlinkPath = path.join(assetsDirPath, 'ids-assets');
4628

4729
createSymlink(assetsSourcePath, assetsSymlinkPath);
4830
createSymlink(componentsSourcePath, componentsSymlinkPath);
4931
createSymlink(coreSourcePath, coreSymlinkPath);
5032
}
5133

52-
updateIbexaTSConfigFile();
5334
createSymlinks();
35+
36+
/* eslint-disable no-console */
37+
console.log(
38+
'\x1b[32m%s\x1b[0m',
39+
'+-----------------------------------------------------------------+',
40+
);
41+
console.log(
42+
'\x1b[32m%s\x1b[0m',
43+
'| Symlinks created successfully. |',
44+
);
45+
console.log(
46+
'\x1b[32m%s\x1b[0m',
47+
'| Go to admin-ui-assets/src/bundle/Resources/public/vendors |',
48+
);
49+
console.log(
50+
'\x1b[32m%s\x1b[0m',
51+
'| and double check if directories ids-X are properly symlinked. |',
52+
);
53+
console.log(
54+
'\x1b[32m%s\x1b[0m',
55+
'+-----------------------------------------------------------------+',
56+
);

bin/prepare_release.sh

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ check_process()
4444
check_command "git"
4545
check_command "yarn"
4646

47-
ASSETS_DIR="packages/assets"
48-
COMPONENTS_DIR="packages/components"
49-
5047
CURRENT_BRANCH=`git branch | grep '*' | cut -d ' ' -f 2`
5148
TMP_BRANCH="version_$VERSION"
5249
TAG="v$VERSION"
@@ -55,27 +52,8 @@ echo "# Switching to $BRANCH and updating"
5552
git checkout -q $BRANCH > /dev/null && git pull > /dev/null
5653
check_process "switch to $BRANCH"
5754

58-
echo "# Removing the assets"
59-
yarn run packages:remove-dist
60-
61-
echo "# Removing yarn.lock"
62-
rm -rf "yarn.lock"
63-
64-
echo "# Installing dependendencies"
65-
yarn install
66-
yarn run packages:build
67-
68-
echo "# Removing Storybook and dev files"
69-
rm -rf ".storybook" "scripts" "src" "stories" "types" "eslint.config.js" "tsconfig.json"
70-
check_process "clean storybook dev"
71-
72-
echo "# Removing components dev files"
73-
rm -rf "$COMPONENTS_DIR/scripts" "$COMPONENTS_DIR/src" "$COMPONENTS_DIR/.babelrc" "$COMPONENTS_DIR/tsconfig.build.json" "$COMPONENTS_DIR/tsconfig.json"
74-
check_process "clean components dev"
75-
76-
echo "# Removing assets dev files"
77-
rm -rf "$ASSETS_DIR/src"
78-
check_process "clean assets dev"
55+
./bin/prepare_release_files.sh
56+
check_process "prepare the release files"
7957

8058
echo "# Creating the custom branch: $TMP_BRANCH"
8159
git checkout -q -b "$TMP_BRANCH" > /dev/null

bin/prepare_release_files.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#! /bin/sh
2+
# Script to prepare design system module release files
3+
4+
check_command()
5+
{
6+
$1 --version 2>&1 > /dev/null
7+
check_process "find '$1' in the PATH, is it installed?"
8+
}
9+
10+
check_process()
11+
{
12+
[ $? -ne 0 ] && echo "Fail to $1" && exit 3
13+
}
14+
15+
check_command "yarn"
16+
17+
ASSETS_DIR="packages/assets"
18+
COMPONENTS_DIR="packages/components"
19+
20+
echo "# Removing the assets"
21+
yarn run packages:remove-dist
22+
23+
echo "# Removing yarn.lock"
24+
rm -rf "yarn.lock"
25+
26+
echo "# Installing dependendencies"
27+
yarn install
28+
yarn run packages:build
29+
30+
echo "# Removing Storybook and dev files"
31+
rm -rf ".storybook" "scripts" "src" "stories" "types" "eslint.config.js" "tsconfig.json"
32+
check_process "clean storybook dev"
33+
34+
echo "# Removing components dev files"
35+
rm -rf "$COMPONENTS_DIR/scripts" "$COMPONENTS_DIR/src" "$COMPONENTS_DIR/.babelrc" "$COMPONENTS_DIR/tsconfig.build.json" "$COMPONENTS_DIR/tsconfig.json"
36+
check_process "clean components dev"
37+
38+
echo "# Removing assets dev files"
39+
rm -rf "$ASSETS_DIR/src"
40+
check_process "clean assets dev"
41+
42+
exit 0

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,16 @@
6464
"components:fix": "cd packages/components; yarn fix",
6565
"components:extract-translations": "cd packages/components; yarn extract-translations",
6666
"components:build": "cd packages/components; yarn build",
67+
"components:watch": "cd packages/components; yarn watch",
6768
"core:test": "cd packages/core; yarn test",
6869
"core:fix": "cd packages/core; yarn fix",
6970
"core:build": "cd packages/core; yarn build",
71+
"core:watch": "cd packages/core; yarn watch",
7072
"packages:test": "yarn components:test && yarn assets:test && yarn core:test",
7173
"packages:fix": "yarn components:fix && yarn assets:fix && yarn core:fix",
7274
"packages:remove-dist": "rm -rf packages/assets/dist && rm -rf packages/components/dist && rm -rf packages/core/dist",
7375
"packages:build": "yarn components:build && yarn assets:build && yarn core:build",
76+
"packages:watch": "yarn core:watch & yarn components:watch",
7477
"infra:prettier-test": "yarn prettier \"./{.storybook,src,stories}/**/*.{js,ts,jsx,tsx}\" --check",
7578
"infra:prettier-fix": "yarn infra:prettier-test --write",
7679
"infra:eslint-test": "eslint \"./{.storybook,src,stories}/**/*.{js,ts,jsx,tsx}\"",
@@ -82,5 +85,9 @@
8285
"build-storybook": "storybook build",
8386
"test-storybook": "test-storybook"
8487
},
85-
"packageManager": "[email protected]"
88+
"packageManager": "[email protected]",
89+
"dependencies": {
90+
"@popperjs/core": "^2.11.8",
91+
"react-popper": "^2.3.0"
92+
}
8693
}

0 commit comments

Comments
 (0)