@designcrowd/fe-shared-lib 1.2.7-ml-291-6 → 1.2.7-rr-debugging

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/Dockerfile CHANGED
@@ -29,7 +29,7 @@ COPY .npmignore ./
29
29
  RUN npm run bundle-translation
30
30
 
31
31
  RUN mkdir artifacts
32
- RUN npm publish || (touch artifacts/npm_publish_failed && exit 1)
32
+ RUN npm publish || touch artifacts/npm_publish_failed
33
33
  RUN cp package.json artifacts/
34
34
 
35
35
  ENTRYPOINT ["/bin/echo", "Nothing to do."]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designcrowd/fe-shared-lib",
3
- "version": "1.2.7-ml-291-6",
3
+ "version": "1.2.7-rr-debugging",
4
4
  "scripts": {
5
5
  "start": "run-p storybook watch:translation",
6
6
  "build": "npm run build:css --production",
@@ -36,11 +36,10 @@
36
36
  {{ title }}
37
37
  </h2>
38
38
  <p class="tw-mb-8 tw-text-grayscale-600">{{ modalDescription }}</p>
39
- <form id="forgotPassword" ref="forgotPasswordForm" method="post" novalidate @submit="validate">
39
+ <form id="forgotPassword" ref="forgotPasswordForm" method="post" @submit="validate">
40
40
  <input type="hidden" name="__RequestVerificationToken" :value="antiForgeryToken" />
41
41
  <label for="email" class="tw-sr-only"> {{ emailLabel }} </label>
42
42
  <input
43
- ref="emailInput"
44
43
  v-model="aEmail"
45
44
  name="email"
46
45
  :class="{ 'tw-border-error-500': !!emailError }"
@@ -73,7 +72,6 @@
73
72
  </div>
74
73
  </template>
75
74
  <script>
76
- import { getCurrentLocale } from '../../../useSharedLibTranslate';
77
75
  import HelloBar from '../../../../src/atoms/components/HelloBar/HelloBar.vue';
78
76
  import SubmissionButton from './SubmissionButton.vue';
79
77
 
@@ -138,15 +136,11 @@ export default {
138
136
  goBackToLoginLabel: this.forgotPasswordContent?.goBackToLoginLabel ?? 'Go back to login',
139
137
  emailAddressPlaceholderLabel: this.forgotPasswordContent?.emailAddressPlaceholderLabel ?? 'Email address',
140
138
  emailLabel: this.forgotPasswordContent?.emailLabel ?? 'Email',
141
- emailErrorMessage: this.forgotPasswordContent?.emailErrorMessage ?? 'Please enter a valid email address',
142
139
  modalDescription: this.forgotPasswordContent?.description ?? 'Enter your email below. We will then send a reset-password link to your email address.',
143
140
  title: this.forgotPasswordContent?.title ?? 'Forgot your password?',
144
141
  };
145
142
  },
146
143
  computed: {
147
- currentLocale() {
148
- return getCurrentLocale();
149
- },
150
144
  getRedirectToSignInUrl() {
151
145
  const url = new URL(`https://${window.location.host}${this.signInUrl}`);
152
146
  if (this.aEmail) {
@@ -176,27 +170,21 @@ export default {
176
170
  },
177
171
  validate(e) {
178
172
  if (this.submitAction) {
179
- const url = new URL(this.submitAction, window.location.origin);
180
- url.searchParams.set('locale', this.currentLocale);
181
- this.$refs.forgotPasswordForm.action = url.toString();
173
+ this.$refs.forgotPasswordForm.action = this.submitAction;
174
+ }
175
+ if (this.aEmail) {
176
+ this.isLoading = true;
177
+ return true;
182
178
  }
183
179
 
180
+ this.isLoading = false;
181
+
184
182
  this.emailError = undefined;
185
183
 
186
184
  if (!this.aEmail) {
187
- this.isLoading = false;
188
- this.emailError = this.emailErrorMessage;
189
- e.preventDefault();
190
- return false;
191
- }
192
-
193
- if (this.$refs.emailInput.checkValidity()) {
194
- this.isLoading = true;
195
- return true;
185
+ this.emailError = 'Please enter a valid email address';
196
186
  }
197
187
 
198
- this.isLoading = false;
199
- this.emailError = this.emailErrorMessage;
200
188
  e.preventDefault();
201
189
  return false;
202
190
  },
@@ -13,7 +13,7 @@
13
13
  {{ title }}
14
14
  </h2>
15
15
  <p class="tw-mb-8 tw-text-grayscale-600">{{ description }}</p>
16
- <form id="resetPassword" ref="resetPasswordForm" method="post" @submit="validate">
16
+ <form id="resetPassword" method="post" @submit="validate">
17
17
  <input name="__RequestVerificationToken" type="hidden" :value="antiForgeryToken" />
18
18
  <input name="userName" type="hidden" :value="userName" />
19
19
  <input name="resetPasswordToken" type="hidden" :value="resetPasswordToken" />
@@ -25,14 +25,14 @@
25
25
  aria-required="true"
26
26
  :aria-invalid="!!passwordError"
27
27
  autocomplete="new-password"
28
- :placeholder="newPasswordPlaceholder"
28
+ placeholder="New password"
29
29
  class="password-input tw-mb-3 tw-h-12 tw-bg-no-repeat tw-w-full tw-rounded tw-shadow-inner tw-outline-none tw-py-4 tw-pl-10-important tw-pr-2 tw-text-grayscale-600 tw-border tw-border-grayscale-500 focus:tw-border-grayscale-700"
30
30
  :class="{ 'tw-border-error-500': !!passwordError }"
31
31
  />
32
32
  <p v-if="!!passwordError" class="tw-text-error-500 tw-text-sm tw-text-left tw-mb-4">
33
33
  {{ passwordError }}
34
34
  </p>
35
- <label for="confirmPassword" class="tw-sr-only">{{ confirmPasswordLabel }}</label>
35
+ <label for="confirmPassword" class="tw-sr-only"> Confirm Password </label>
36
36
  <input
37
37
  v-model="confirmPassword"
38
38
  name="confirmPassword"
@@ -40,7 +40,7 @@
40
40
  aria-required="true"
41
41
  :aria-invalid="!!confirmPasswordError"
42
42
  autocomplete="off"
43
- :placeholder="confirmPasswordPlaceholder"
43
+ placeholder="Confirm new password"
44
44
  class="password-input tw-mb-3 tw-h-12 tw-bg-no-repeat tw-w-full tw-rounded tw-shadow-inner tw-outline-none tw-py-4 tw-pl-10-important tw-pr-2 tw-text-grayscale-600 tw-border tw-border-grayscale-500 focus:tw-border-grayscale-700"
45
45
  :class="{ 'tw-border-error-500': !!confirmPasswordError }"
46
46
  />
@@ -50,7 +50,7 @@
50
50
  <SubmissionButton
51
51
  variant="primary"
52
52
  size="medium"
53
- :label="updatePasswordLabel"
53
+ label="UPDATE PASSWORD"
54
54
  label-size="larger"
55
55
  :is-loading="isLoading"
56
56
  :disabled="isLoading"
@@ -63,7 +63,6 @@
63
63
  </div>
64
64
  </template>
65
65
  <script>
66
- import { getCurrentLocale } from '../../../useSharedLibTranslate';
67
66
  import HelloBar from '../../../../src/atoms/components/HelloBar/HelloBar.vue';
68
67
  import SubmissionButton from './SubmissionButton.vue';
69
68
 
@@ -81,7 +80,7 @@ export default {
81
80
  description: {
82
81
  type: String,
83
82
  required: false,
84
- default: undefined,
83
+ default: 'Enter and confirm your new password',
85
84
  },
86
85
  userName: {
87
86
  type: String,
@@ -105,16 +104,6 @@ export default {
105
104
  required: false,
106
105
  default: undefined,
107
106
  },
108
- submitAction: {
109
- type: String,
110
- required: false,
111
- default: undefined,
112
- },
113
- resetPasswordContent: {
114
- type: Object,
115
- required: false,
116
- default: () => {},
117
- },
118
107
  },
119
108
  data() {
120
109
  return {
@@ -123,28 +112,10 @@ export default {
123
112
  confirmPassword: undefined,
124
113
  passwordError: undefined,
125
114
  confirmPasswordError: undefined,
126
-
127
- newPasswordLabel: this.resetPasswordContent?.newPasswordLabel ?? 'New Password',
128
- newPasswordPlaceholder: this.resetPasswordContent?.newPasswordPlaceholder ?? 'New password',
129
- confirmPasswordLabel: this.resetPasswordContent?.confirmPasswordLabel ?? 'Confirm Password',
130
- confirmPasswordPlaceholder: this.resetPasswordContent?.confirmPasswordPlaceholder ?? 'Confirm new password',
131
- updatePasswordLabel: this.resetPasswordContent?.updatePasswordLabel ?? 'UPDATE PASSWORD',
132
- passwordRequiredError: this.resetPasswordContent?.passwordRequiredError ?? 'Please enter a password',
133
- passwordsDoNotMatchError: this.resetPasswordContent?.passwordsDoNotMatchError ?? 'Passwords do not match',
134
115
  };
135
116
  },
136
- computed: {
137
- currentLocale() {
138
- return getCurrentLocale();
139
- },
140
- },
141
117
  methods: {
142
118
  validate(e) {
143
- if (this.submitAction) {
144
- const url = new URL(this.submitAction, window.location.origin);
145
- url.searchParams.set('locale', this.currentLocale);
146
- this.$refs.resetPasswordForm.action = url.toString();
147
- }
148
119
  if (this.password && this.password === this.confirmPassword) {
149
120
  this.isLoading = true;
150
121
  return true;
@@ -156,9 +127,9 @@ export default {
156
127
  this.confirmPasswordError = undefined;
157
128
 
158
129
  if (!this.password) {
159
- this.passwordError = this.passwordRequiredError;
130
+ this.passwordError = 'Please enter a password';
160
131
  } else if (!this.confirmPassword || this.password !== this.confirmPassword) {
161
- this.confirmPasswordError = this.passwordsDoNotMatchError;
132
+ this.confirmPasswordError = 'Passwords do not match';
162
133
  }
163
134
 
164
135
  e.preventDefault();
@@ -1,6 +1,11 @@
1
1
  // eslint-disable-next-line import/no-extraneous-dependencies
2
2
  import i18next from 'i18next';
3
3
 
4
+ // Make i18next available globally for debugging
5
+ if (typeof window !== 'undefined') {
6
+ window.i18next = i18next;
7
+ }
8
+
4
9
  const fallbackLocale = 'en-US';
5
10
 
6
11
  const relativePathsToTranslationFiles = {
@@ -16,10 +21,16 @@ const setSharedLibLocaleAsync = async (locale = 'en-US') => {
16
21
 
17
22
  if (!i18next.isInitialized) {
18
23
  await i18next.init({
19
- debug: false,
24
+ debug: true, // ✅ Turn on i18next debug logs
20
25
  fallbackLng: fallbackLocale,
21
26
  lng: localeToUse,
22
27
  });
28
+
29
+ console.log('[i18next] Initialized:', {
30
+ language: i18next.language,
31
+ isInitialized: i18next.isInitialized,
32
+ resources: i18next.services.resourceStore.data,
33
+ });
23
34
  }
24
35
 
25
36
  const languageFile = (await relativePathsToTranslationFiles[localeToUse]()).default;
@@ -27,11 +38,12 @@ const setSharedLibLocaleAsync = async (locale = 'en-US') => {
27
38
  await i18next.addResourceBundle(localeToUse, 'fe-shared-lib', {
28
39
  ...languageFile,
29
40
  });
41
+
42
+ console.log(`[i18next] Resource bundle loaded for ${localeToUse}:`, i18next.getResourceBundle(localeToUse, 'fe-shared-lib'));
30
43
  };
31
44
 
32
45
  const tr = (key, valuesToInterpolate = {}) => {
33
46
  const translated = i18next.t(key, { ns: 'fe-shared-lib', ...valuesToInterpolate });
34
-
35
47
  return translated;
36
48
  };
37
49
 
@@ -55,13 +67,8 @@ const sellDomainNameListModalTr = (key, valuesToInterpolate = {}) =>
55
67
 
56
68
  const sellDomainNameListTr = (key, valuesToInterpolate = {}) => tr(`sellDomainNameList.${key}`, valuesToInterpolate);
57
69
 
58
- const getCurrentLocale = () => {
59
- return i18next.language || 'en-US';
60
- };
61
-
62
70
  export {
63
71
  setSharedLibLocaleAsync,
64
- getCurrentLocale,
65
72
  tr,
66
73
  publishBrandPageModalTr,
67
74
  sellDomainNameWidgetTr,
@@ -70,5 +77,4 @@ export {
70
77
  sellDomainNameModalApplicationTr,
71
78
  sellDomainNameListModalTr,
72
79
  sellDomainNameListTr,
73
- };
74
-
80
+ };
package/CLAUDE.md DELETED
@@ -1,71 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Development Commands
6
-
7
- ### Starting Development
8
- - `npm start` - Builds Tailwind CSS files for all themes and launches Storybook development server on port 6006
9
- - `npm run storybook` - Same as `npm start` (alias)
10
-
11
- ### Building
12
- - `npm run build` - Builds production CSS using Tailwind
13
- - `npm run build:css` - Builds CSS files using tailwind.build.js
14
- - `npm run build:storybook` - Builds static Storybook for deployment
15
-
16
- ### Code Quality
17
- - `npm run lint` - Runs ESLint on TypeScript, JavaScript, and Vue files in src/
18
- - `npm run lint:fix` - Automatically fixes linting issues where possible
19
-
20
- ### Testing in UAT Environment
21
- To test experimental versions without publishing to production:
22
- 1. Update package.json version to `[current]-[description]`
23
- 2. Run `docker build . --build-arg NPM_TOKEN=$NPM_TOKEN`
24
- 3. Update consumer package reference to the new version
25
-
26
- ## Architecture Overview
27
-
28
- This is a shared component library and design system for DesignCrowd's frontend applications, published as `@designcrowd/fe-shared-lib`.
29
-
30
- ### Project Structure
31
- - **`src/atoms/`** - Reusable UI components (Button, Modal, Icon, etc.)
32
- - **`src/experiences/`** - Complex, business-specific components (AuthFlow, PaymentConfig, etc.)
33
- - **`src/themes/`** - Tailwind CSS theme configurations for different brands
34
- - **`src/css/`** - Global CSS and Tailwind configuration
35
- - **`public/css/`** - Generated CSS output files
36
-
37
- ### Theme System
38
- The library supports multiple brand themes through Tailwind CSS:
39
- - **BrandCrowd** (`bc.js`)
40
- - **BrandPage** (`bp.js`)
41
- - **CrazyDomains** (`cd.js`)
42
- - **DesignCrowd** (`dc.js`)
43
- - **Design.com** (`dcom.js`)
44
-
45
- Themes are built using `tailwind.themes.js` and exported via `src/themes/themes.js`.
46
-
47
- ### Component Organization
48
- - **Atoms**: Basic UI components with stories in Storybook
49
- - **Experiences**: Complex components combining multiple atoms for specific workflows
50
- - **Icons**: Extensive icon library with brand-specific variants
51
- - **Mixins**: Reusable Vue.js mixins for common functionality
52
-
53
- ### Key Files
54
- - `index.js` - Main export file exposing all components
55
- - `tailwind.config.js` - Tailwind CSS configuration
56
- - `vite.config.ts` - Vite build configuration for development
57
-
58
- ### Local Development Workflow
59
- Use `npm link` in this directory and `npm link @designcrowd/fe-shared-lib` in consumer projects for local development.
60
-
61
- ### Storybook
62
- - Development server runs on port 6006
63
- - Live Storybook: https://brandcrowd-storybook.s3.amazonaws.com/fe-shared-lib/live/index.html
64
- - Stories are co-located with components (`.stories.js` files)
65
-
66
- ### Brand Page Integration
67
- For changes affecting BrandPage Tab in BC.NET:
68
- 1. Update app.maker's reference to this library
69
- 2. Bump app.maker version
70
- 3. Run `npm run docker:publish:bp`
71
- 4. Update BC.NET's reference to the new app.maker version