srcdev-nuxt-components 9.2.4 → 9.2.5

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.
@@ -17,11 +17,17 @@ A consumer app's `postinstall` script runs both automatically after every `npm i
17
17
 
18
18
  ```json
19
19
  "scripts": {
20
- "setup:claude": "cp -r node_modules/srcdev-nuxt-components/.claude/skills .claude/skills/srcdev-nuxt-components",
21
- "postinstall": "nuxt prepare && npm run setup:claude"
20
+ "setup:claude": "mkdir -p .claude/skills/srcdev-nuxt-components && cp -r node_modules/srcdev-nuxt-components/.claude/skills/. .claude/skills/srcdev-nuxt-components",
21
+ "postinstall": "node node_modules/srcdev-nuxt-components/scripts/copy-snippets.mjs && nuxt prepare && npm run setup:claude"
22
22
  }
23
23
  ```
24
24
 
25
+ This postinstall hook does three things in order:
26
+
27
+ 1. Copies VSCode snippets from the layer to your `.vscode/` folder
28
+ 2. Runs `nuxt prepare` to generate type declarations
29
+ 3. Runs `setup:claude` to copy skills into `.claude/skills/srcdev-nuxt-components/`
30
+
25
31
  ### 2. Check whether your app needs an env flag for nuxt prepare
26
32
 
27
33
  Some apps set an env var to switch `nuxt.config.ts` behaviour when running outside the full dev server (e.g. `NUXT_STANDALONE=true`). Check your own `nuxt.config.ts` — if it gates any config behind such a variable, add it to the `postinstall` command:
@@ -42,7 +48,7 @@ From this point on, `npm install` and `npm ci` trigger both steps automatically.
42
48
 
43
49
  ## Notes
44
50
 
51
+ - **Snippet copy must run in consumer app**: npm doesn't invoke postinstall hooks for dependencies. Each consumer app must explicitly call `scripts/copy-snippets.mjs` in its own postinstall to copy VSCode snippets to `.vscode/`. The layer's postinstall is used when the layer runs standalone, but consumers are responsible for their own `.vscode/` folder.
45
52
  - Skills land in `.claude/skills/srcdev-nuxt-components/` — safe to re-run without overwriting your own project's skills.
46
- - VSCode snippets are copied to `.vscode/` automatically by the layer's postinstall no extra step needed on the consumer's side. They're available in VSCode's autocomplete immediately after `npm install`.
47
- - `postinstall` also fires on `npm ci`, so CI environments get the skills too if they have a `.claude/` directory in the project.
48
- - If you do not want `postinstall` running in CI, guard it: `"postinstall": "[ \"$CI\" = \"true\" ] || (nuxt prepare && npm run setup:claude)"`.
53
+ - `postinstall` also fires on `npm ci`, so CI environments get the skills and snippets too if they have a `.claude/` directory in the project.
54
+ - If you do not want `postinstall` running in CI, guard it: `"postinstall": "[ \"$CI\" = \"true\" ] || (node node_modules/srcdev-nuxt-components/scripts/copy-snippets.mjs && nuxt prepare && npm run setup:claude)"`.
package/README.md CHANGED
@@ -43,16 +43,22 @@ Skills are copied into `.claude/skills/srcdev-nuxt-components/` so they never co
43
43
 
44
44
  ### Automate with postinstall (recommended)
45
45
 
46
- To ensure skills are always up to date and `nuxt prepare` is never forgotten, combine both into a `postinstall` script. npm runs this automatically after every `npm install`:
46
+ To ensure skills are always up to date, VSCode snippets are installed, and `nuxt prepare` is never forgotten, add a `postinstall` script. npm runs this automatically after every `npm install`:
47
47
 
48
48
  ```json
49
49
  "scripts": {
50
- "setup:claude": "cp -r node_modules/srcdev-nuxt-components/.claude/skills .claude/skills/srcdev-nuxt-components",
51
- "postinstall": "nuxt prepare && npm run setup:claude"
50
+ "setup:claude": "mkdir -p .claude/skills/srcdev-nuxt-components && cp -r node_modules/srcdev-nuxt-components/.claude/skills/. .claude/skills/srcdev-nuxt-components",
51
+ "postinstall": "node node_modules/srcdev-nuxt-components/scripts/copy-snippets.mjs && nuxt prepare && npm run setup:claude"
52
52
  }
53
53
  ```
54
54
 
55
- > If your app uses a standalone env flag for `nuxt prepare` (e.g. `NUXT_STANDALONE=true`), include it in the `postinstall` command. This is project-specific — check your own `nuxt.config.ts` to confirm whether it is needed.
55
+ **What this does:**
56
+
57
+ 1. `copy-snippets.mjs` — copies VSCode snippets (`.code-snippets` files) from the layer to your `.vscode/` folder
58
+ 2. `nuxt prepare` — generates Nuxt type declarations
59
+ 3. `setup:claude` — copies skills into `.claude/skills/srcdev-nuxt-components/`
60
+
61
+ > **Note**: The snippet copy must run from your consumer app's postinstall, not the layer's. npm doesn't invoke postinstall hooks for dependencies, so each consumer app is responsible for copying snippets into its own `.vscode/` folder. If your app uses a standalone env flag for `nuxt prepare` (e.g. `NUXT_STANDALONE=true`), add it before `nuxt prepare`. This is project-specific — check your own `nuxt.config.ts` to confirm whether it is needed.
56
62
 
57
63
  ---
58
64
 
@@ -5,6 +5,9 @@
5
5
  All `--pricing-card-*` tokens are the stable override surface. Set them at any scope (global, page,
6
6
  or instance) without touching the component itself.
7
7
 
8
+ Note: the price amount defaults to a `$` prefix. Pass `currency-symbol="£"` (or any other symbol) to
9
+ override it — there is no locale-aware formatting, just a literal prefix character.
10
+
8
11
  | Token | Default | Controls |
9
12
  |---|---|---|
10
13
  | `--pricing-card-border` | `1px solid var(--slate-03)` | Card border |
@@ -26,6 +29,7 @@ or instance) without touching the component itself.
26
29
  | `--pricing-card-period-color` | `#666` | Billing period text colour |
27
30
  | `--pricing-card-description-color` | `#555` | Plan description text colour |
28
31
  | `--pricing-card-feature-color` | `#333` | Feature list text colour |
32
+ | `--pricing-card-cta-align` | `flex-start` | CTA wrapper `align-self` — set to `stretch`, `center`, or `flex-end` to change CTA alignment/width within the card |
29
33
  | `--pricing-card-cta-bg` | `var(--theme-button-primary-surface)` | CTA button background |
30
34
  | `--pricing-card-cta-bg-hover` | `var(--theme-button-primary-surface-hover)` | CTA button background on hover |
31
35
  | `--pricing-card-cta-text` | `var(--theme-button-primary-text)` | CTA button text colour |
@@ -5,7 +5,7 @@
5
5
  <h3 class="pricing-card__name">{{ planName }}</h3>
6
6
 
7
7
  <div class="pricing-card__price">
8
- <span class="pricing-card__amount">${{ price }}</span>
8
+ <span class="pricing-card__amount">{{ currencySymbol }}{{ price }}</span>
9
9
  <span v-if="billingPeriod" class="pricing-card__period">{{ billingPeriod }}</span>
10
10
  </div>
11
11
 
@@ -42,6 +42,7 @@ interface Props {
42
42
  tag?: "div" | "section" | "article";
43
43
  planName: string;
44
44
  price: number;
45
+ currencySymbol?: string;
45
46
  billingPeriod?: string;
46
47
  description?: string;
47
48
  features?: string[];
@@ -53,6 +54,7 @@ interface Props {
53
54
 
54
55
  const props = withDefaults(defineProps<Props>(), {
55
56
  tag: "article",
57
+ currencySymbol: "$",
56
58
  billingPeriod: "one-time",
57
59
  description: undefined,
58
60
  features: () => [],
@@ -108,6 +110,7 @@ watch(
108
110
  --_description-color: var(--pricing-card-description-color, #555);
109
111
  --_feature-color: var(--pricing-card-feature-color, #333);
110
112
 
113
+ --_cta-align: var(--pricing-card-cta-align, flex-start);
111
114
  --_cta-bg: var(--pricing-card-cta-bg, var(--theme-button-primary-surface));
112
115
  --_cta-bg-hover: var(--pricing-card-cta-bg-hover, var(--theme-button-primary-surface-hover));
113
116
  --_cta-text: var(--pricing-card-cta-text, var(--theme-button-primary-text));
@@ -206,7 +209,7 @@ watch(
206
209
  }
207
210
 
208
211
  .pricing-card__cta {
209
- align-self: flex-start;
212
+ align-self: var(--_cta-align);
210
213
 
211
214
  :deep(.input-button-core) {
212
215
  padding: var(--_cta-padding);
@@ -19,6 +19,19 @@ describe("PricingCard", () => {
19
19
  expect(wrapper.text()).toContain("Get started");
20
20
  });
21
21
 
22
+ it("uses custom currency symbol when provided", () => {
23
+ const wrapper = mount(PricingCard, {
24
+ props: {
25
+ planName: "Single Site",
26
+ price: 49,
27
+ currencySymbol: "£",
28
+ },
29
+ });
30
+
31
+ expect(wrapper.text()).toContain("£49");
32
+ expect(wrapper.text()).not.toContain("$49");
33
+ });
34
+
22
35
  it("renders features from props", () => {
23
36
  const features = ["Feature 1", "Feature 2", "Feature 3"];
24
37
  const wrapper = mount(PricingCard, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "9.2.4",
4
+ "version": "9.2.5",
5
5
  "main": "nuxt.config.ts",
6
6
  "types": "types.d.ts",
7
7
  "license": "MIT",