ripal-ui 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ripal-ui",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "A collection of React elements and components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -61,6 +61,8 @@ export default config
61
61
 
62
62
  // Path to generate the config file in the user's project root
63
63
  const configFilePath = path.resolve(process.cwd(), '../../ripal-ui.config.js');
64
+ const langDirPath = path.resolve(process.cwd(), '../../lang');
65
+ const enJsonFilePath = path.resolve(langDirPath, 'en.json');
64
66
 
65
67
  // Check if the config file already exists
66
68
  if (!fs.existsSync(configFilePath)) {
@@ -68,13 +70,10 @@ if (!fs.existsSync(configFilePath)) {
68
70
  fs.writeFileSync(configFilePath, configContent);
69
71
  console.log('ripal-ui.config.js has been generated in the root project.');
70
72
 
71
- fs.mkdirSync(
72
- path.resolve(process.cwd(), '../../lang')
73
- );
74
- fs.writeFileSync(
75
- path.resolve(process.cwd(), '../../lang/en.json'), `[
76
- say_hello: "Hello world"
77
- ]`);
73
+ fs.mkdirSync(langDirPath, {recursive: true});
74
+
75
+ const enContent = JSON.stringify({ say_hello: "Hello world"}, null, 4);
76
+ fs.writeFileSync(enJsonFilePath, enContent);
78
77
  } else {
79
78
  console.log('ripal-ui.config.js already exists. No changes made.');
80
79
  }