@slicemachine/adapter-sveltekit 0.3.78-alpha.lh-svelte5.2 → 0.3.78-alpha.xru-e2e-tests-logged-in.1

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.
Files changed (41) hide show
  1. package/dist/AlternateGrid/javascript.svelte +2 -2
  2. package/dist/AlternateGrid/typescript.svelte +1 -5
  3. package/dist/CallToAction/javascript.svelte +3 -3
  4. package/dist/CallToAction/typescript.svelte +2 -6
  5. package/dist/CustomerLogos/javascript.svelte +2 -2
  6. package/dist/CustomerLogos/typescript.svelte +1 -5
  7. package/dist/Hero/javascript.svelte +2 -2
  8. package/dist/Hero/typescript.svelte +1 -5
  9. package/dist/hooks/documentation-read.cjs +2 -9
  10. package/dist/hooks/documentation-read.cjs.map +1 -1
  11. package/dist/hooks/documentation-read.js +2 -9
  12. package/dist/hooks/documentation-read.js.map +1 -1
  13. package/dist/hooks/project-init.cjs.map +1 -1
  14. package/dist/hooks/project-init.js.map +1 -1
  15. package/dist/hooks/slice-create.cjs +7 -22
  16. package/dist/hooks/slice-create.cjs.map +1 -1
  17. package/dist/hooks/slice-create.js +7 -22
  18. package/dist/hooks/slice-create.js.map +1 -1
  19. package/dist/plugin.cjs +2 -4
  20. package/dist/plugin.cjs.map +1 -1
  21. package/dist/plugin.js +2 -4
  22. package/dist/plugin.js.map +1 -1
  23. package/package.json +3 -5
  24. package/src/hooks/documentation-read.ts +8 -28
  25. package/src/hooks/project-init.ts +0 -2
  26. package/src/hooks/slice-create.ts +22 -55
  27. package/src/plugin.ts +2 -9
  28. package/dist/AlternateGrid/javascript.with-let-props.svelte +0 -227
  29. package/dist/AlternateGrid/typescript.with-let-props.svelte +0 -224
  30. package/dist/CallToAction/javascript.with-let-props.svelte +0 -127
  31. package/dist/CallToAction/typescript.with-let-props.svelte +0 -124
  32. package/dist/CustomerLogos/javascript.with-let-props.svelte +0 -124
  33. package/dist/CustomerLogos/typescript.with-let-props.svelte +0 -121
  34. package/dist/Hero/javascript.with-let-props.svelte +0 -190
  35. package/dist/Hero/typescript.with-let-props.svelte +0 -187
  36. package/dist/lib/checkIsSvelte5.cjs +0 -31
  37. package/dist/lib/checkIsSvelte5.cjs.map +0 -1
  38. package/dist/lib/checkIsSvelte5.d.ts +0 -7
  39. package/dist/lib/checkIsSvelte5.js +0 -31
  40. package/dist/lib/checkIsSvelte5.js.map +0 -1
  41. package/src/lib/checkIsSvelte5.ts +0 -49
@@ -1,124 +0,0 @@
1
- <script>
2
- import { isFilled } from "@prismicio/client";
3
- import {
4
- PrismicImage,
5
- PrismicRichText,
6
- PrismicLink,
7
- } from "@prismicio/svelte";
8
-
9
- /**
10
- * @type {import("@prismicio/client").Content.${PascalNameToReplace}Slice}
11
- */
12
- export let slice;
13
- </script>
14
-
15
- <section
16
- data-slice-type={slice.slice_type}
17
- data-slice-variation={slice.variation}
18
- class="es-bounded es-customer-logos"
19
- >
20
- <div class="es-bounded__content es-customer-logos__content">
21
- {#if isFilled.richText(slice.primary.eyebrowHeadline)}
22
- <div class="es-customer-logos__heading">
23
- <PrismicRichText field={slice.primary.eyebrowHeadline} />
24
- </div>
25
- {/if}
26
- {#if slice.primary.logos.length > 0}
27
- <ul class="es-customer-logos__logos">
28
- {#each slice.primary.logos as logo}
29
- {#if isFilled.image(logo.image)}
30
- <li class="es-customer-logos__logo">
31
- <PrismicLink field={logo.link}>
32
- <PrismicImage
33
- field={logo.image}
34
- class="es-customer-logos__logo__link__image"
35
- height="26"
36
- width="160"
37
- />
38
- </PrismicLink>
39
- </li>
40
- {/if}
41
- {/each}
42
- </ul>
43
- {/if}
44
- <PrismicLink
45
- field={slice.primary.callToActionLink}
46
- class="es-customer-logos__button"
47
- />
48
- </div>
49
-
50
- <style>
51
- .es-bounded {
52
- margin: 0px;
53
- min-width: 0px;
54
- position: relative;
55
- padding: 8vw 1.25rem;
56
- }
57
-
58
- .es-bounded__content {
59
- min-width: 0px;
60
- max-width: 90%;
61
- margin: 0px auto;
62
- }
63
-
64
- .es-customer-logos {
65
- font-family: system-ui, sans-serif;
66
- background-color: #f4f0ec;
67
- color: #333;
68
- }
69
-
70
- .es-customer-logos__content {
71
- display: grid;
72
- gap: 2rem;
73
- justify-items: center;
74
- }
75
-
76
- .es-customer-logos__heading {
77
- color: #8592e0;
78
- font-size: 1.5rem;
79
- font-weight: 500;
80
- text-align: center;
81
- }
82
-
83
- .es-customer-logos__heading * {
84
- margin: 0;
85
- }
86
-
87
- .es-customer-logos__logos {
88
- display: grid;
89
- grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
90
- grid-column-gap: 1.25rem;
91
- grid-row-gap: 2rem;
92
- align-items: center;
93
- list-style-type: none;
94
- width: 100%;
95
- }
96
-
97
- @media (min-width: 1200px) {
98
- .es-customer-logos__logos {
99
- margin-left: -3rem;
100
- }
101
- }
102
-
103
- .es-customer-logos__logo {
104
- margin: 0;
105
- display: flex;
106
- justify-content: center;
107
- }
108
-
109
- @media (min-width: 1200px) {
110
- .es-customer-logos__logo {
111
- margin-left: 3rem;
112
- }
113
- }
114
-
115
- .es-customer-logos__logo__link__image {
116
- max-width: 10rem;
117
- }
118
-
119
- .es-customer-logos__button {
120
- justify-self: center;
121
- text-decoration: underline;
122
- }
123
- </style>
124
- </section>
@@ -1,121 +0,0 @@
1
- <script lang="ts">
2
- import { type Content, isFilled } from "@prismicio/client";
3
- import {
4
- PrismicImage,
5
- PrismicRichText,
6
- PrismicLink,
7
- } from "@prismicio/svelte";
8
-
9
- export let slice: Content.PascalNameToReplaceSlice;
10
- </script>
11
-
12
- <section
13
- data-slice-type={slice.slice_type}
14
- data-slice-variation={slice.variation}
15
- class="es-bounded es-customer-logos"
16
- >
17
- <div class="es-bounded__content es-customer-logos__content">
18
- {#if isFilled.richText(slice.primary.eyebrowHeadline)}
19
- <div class="es-customer-logos__heading">
20
- <PrismicRichText field={slice.primary.eyebrowHeadline} />
21
- </div>
22
- {/if}
23
- {#if slice.primary.logos.length > 0}
24
- <ul class="es-customer-logos__logos">
25
- {#each slice.primary.logos as logo}
26
- {#if isFilled.image(logo.image)}
27
- <li class="es-customer-logos__logo">
28
- <PrismicLink field={logo.link}>
29
- <PrismicImage
30
- field={logo.image}
31
- class="es-customer-logos__logo__link__image"
32
- height="26"
33
- width="160"
34
- />
35
- </PrismicLink>
36
- </li>
37
- {/if}
38
- {/each}
39
- </ul>
40
- {/if}
41
- <PrismicLink
42
- field={slice.primary.callToActionLink}
43
- class="es-customer-logos__button"
44
- />
45
- </div>
46
-
47
- <style>
48
- .es-bounded {
49
- margin: 0px;
50
- min-width: 0px;
51
- position: relative;
52
- padding: 8vw 1.25rem;
53
- }
54
-
55
- .es-bounded__content {
56
- min-width: 0px;
57
- max-width: 90%;
58
- margin: 0px auto;
59
- }
60
-
61
- .es-customer-logos {
62
- font-family: system-ui, sans-serif;
63
- background-color: #f4f0ec;
64
- color: #333;
65
- }
66
-
67
- .es-customer-logos__content {
68
- display: grid;
69
- gap: 2rem;
70
- justify-items: center;
71
- }
72
-
73
- .es-customer-logos__heading {
74
- color: #8592e0;
75
- font-size: 1.5rem;
76
- font-weight: 500;
77
- text-align: center;
78
- }
79
-
80
- .es-customer-logos__heading * {
81
- margin: 0;
82
- }
83
-
84
- .es-customer-logos__logos {
85
- display: grid;
86
- grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
87
- grid-column-gap: 1.25rem;
88
- grid-row-gap: 2rem;
89
- align-items: center;
90
- list-style-type: none;
91
- width: 100%;
92
- }
93
-
94
- @media (min-width: 1200px) {
95
- .es-customer-logos__logos {
96
- margin-left: -3rem;
97
- }
98
- }
99
-
100
- .es-customer-logos__logo {
101
- margin: 0;
102
- display: flex;
103
- justify-content: center;
104
- }
105
-
106
- @media (min-width: 1200px) {
107
- .es-customer-logos__logo {
108
- margin-left: 3rem;
109
- }
110
- }
111
-
112
- .es-customer-logos__logo__link__image {
113
- max-width: 10rem;
114
- }
115
-
116
- .es-customer-logos__button {
117
- justify-self: center;
118
- text-decoration: underline;
119
- }
120
- </style>
121
- </section>
@@ -1,190 +0,0 @@
1
- <script>
2
- import {
3
- PrismicImage,
4
- PrismicRichText,
5
- PrismicLink,
6
- } from "@prismicio/svelte";
7
- import { isFilled } from "@prismicio/client";
8
-
9
- /**
10
- * @type {import("@prismicio/client").Content.${PascalNameToReplace}Slice}
11
- */
12
- export let slice;
13
- </script>
14
-
15
- <section
16
- data-slice-type={slice.slice_type}
17
- data-slice-variation={slice.variation}
18
- class="es-bounded es-fullpage-hero"
19
- >
20
- <div
21
- class={`
22
- es-fullpage-hero__content
23
- ${
24
- slice.variation === "imageRight"
25
- ? "es-fullpage-hero__image--right"
26
- : "es-fullpage-hero__image--left"
27
- }
28
- `}
29
- >
30
- <div>
31
- {#if isFilled.image(slice.primary.image)}
32
- <PrismicImage
33
- field={slice.primary.image}
34
- class="es-fullpage-hero__image"
35
- />
36
- {/if}
37
- </div>
38
- <div class="es-fullpage-hero__content-right">
39
- <div class="es-fullpage-hero__content__intro">
40
- {#if isFilled.keyText(slice.primary.eyebrowHeadline)}
41
- <p class="es-fullpage-hero__content__intro__eyebrow">
42
- {slice.primary.eyebrowHeadline}
43
- </p>
44
- {/if}
45
- {#if isFilled.richText(slice.primary.title)}
46
- <div class="es-fullpage-hero__content__intro__headline">
47
- <PrismicRichText field={slice.primary.title} />
48
- </div>
49
- {/if}
50
- {#if isFilled.richText(slice.primary.description)}
51
- <div class="es-fullpage-hero__content__intro__description">
52
- <PrismicRichText field={slice.primary.description} />
53
- </div>
54
- {/if}
55
- <PrismicLink
56
- field={slice.primary.callToActionLink}
57
- class="es-call-to-action__link"
58
- />
59
- </div>
60
- </div>
61
- </div>
62
-
63
- <style>
64
- .es-bounded {
65
- margin: 0px;
66
- min-width: 0px;
67
- position: relative;
68
- }
69
-
70
- .es-fullpage-hero {
71
- font-family: system-ui, sans-serif;
72
- background-color: #fff;
73
- color: #333;
74
- }
75
-
76
- .es-fullpage-hero__image {
77
- max-width: 100%;
78
- height: auto;
79
- align-self: center;
80
- }
81
-
82
- .es-fullpage-hero__image--left > div:first-child {
83
- order: 1;
84
- }
85
-
86
- .es-fullpage-hero__image--left > div:nth-child(2) {
87
- order: 2;
88
- }
89
-
90
- .es-fullpage-hero__image--right > div:first-child {
91
- order: 2;
92
- }
93
-
94
- .es-fullpage-hero__image--right > div:nth-child(2) {
95
- order: 1;
96
- }
97
-
98
- .es-fullpage-hero__content {
99
- display: flex;
100
- flex-direction: column;
101
- gap: 2rem;
102
- }
103
-
104
- .es-fullpage-hero__content-right {
105
- display: flex;
106
- flex-direction: column;
107
- justify-content: space-around;
108
- padding: 1.5rem;
109
- }
110
-
111
- @media (min-width: 1080px) {
112
- .es-fullpage-hero__content {
113
- flex-direction: row;
114
- }
115
-
116
- .es-fullpage-hero__content > div {
117
- width: 50%;
118
- }
119
- }
120
-
121
- .es-fullpage-hero__content__intro {
122
- display: grid;
123
- gap: 1rem;
124
- }
125
-
126
- .es-fullpage-hero__content__intro__eyebrow {
127
- color: #47c1af;
128
- font-size: 1.15rem;
129
- font-weight: 500;
130
- margin: 0;
131
- }
132
-
133
- .es-fullpage-hero__content__intro__headline {
134
- font-size: 1.625rem;
135
- font-weight: 700;
136
- }
137
-
138
- .es-fullpage-hero__content__intro__headline * {
139
- margin: 0;
140
- }
141
-
142
- @media (min-width: 640px) {
143
- .es-fullpage-hero__content__intro__headline {
144
- font-size: 2rem;
145
- }
146
- }
147
-
148
- @media (min-width: 1024px) {
149
- .es-fullpage-hero__content__intro__headline {
150
- font-size: 2.5rem;
151
- }
152
- }
153
-
154
- @media (min-width: 1200px) {
155
- .es-fullpage-hero__content__intro__headline {
156
- font-size: 2.75rem;
157
- }
158
- }
159
-
160
- .es-fullpage-hero__content__intro__description {
161
- font-size: 1.15rem;
162
- max-width: 38rem;
163
- }
164
-
165
- .es-fullpage-hero__content__intro__description > p {
166
- margin: 0;
167
- }
168
-
169
- @media (min-width: 1200px) {
170
- .es-fullpage-hero__content__intro__description {
171
- font-size: 1.4rem;
172
- }
173
- }
174
-
175
- .es-call-to-action__link {
176
- justify-self: flex-start;
177
- border-radius: 0.25rem;
178
- font-size: 0.875rem;
179
- line-height: 1.3;
180
- padding: 1rem 2.625rem;
181
- transition: background-color 100ms linear;
182
- background-color: #16745f;
183
- color: #fff;
184
- }
185
-
186
- .es-call-to-action__link:hover {
187
- background-color: #0d5e4c;
188
- }
189
- </style>
190
- </section>
@@ -1,187 +0,0 @@
1
- <script lang="ts">
2
- import {
3
- PrismicImage,
4
- PrismicRichText,
5
- PrismicLink,
6
- } from "@prismicio/svelte";
7
- import { type Content, isFilled } from "@prismicio/client";
8
-
9
- export let slice: Content.PascalNameToReplaceSlice;
10
- </script>
11
-
12
- <section
13
- data-slice-type={slice.slice_type}
14
- data-slice-variation={slice.variation}
15
- class="es-bounded es-fullpage-hero"
16
- >
17
- <div
18
- class={`
19
- es-fullpage-hero__content
20
- ${
21
- slice.variation === "imageRight"
22
- ? "es-fullpage-hero__image--right"
23
- : "es-fullpage-hero__image--left"
24
- }
25
- `}
26
- >
27
- <div>
28
- {#if isFilled.image(slice.primary.image)}
29
- <PrismicImage
30
- field={slice.primary.image}
31
- class="es-fullpage-hero__image"
32
- />
33
- {/if}
34
- </div>
35
- <div class="es-fullpage-hero__content-right">
36
- <div class="es-fullpage-hero__content__intro">
37
- {#if isFilled.keyText(slice.primary.eyebrowHeadline)}
38
- <p class="es-fullpage-hero__content__intro__eyebrow">
39
- {slice.primary.eyebrowHeadline}
40
- </p>
41
- {/if}
42
- {#if isFilled.richText(slice.primary.title)}
43
- <div class="es-fullpage-hero__content__intro__headline">
44
- <PrismicRichText field={slice.primary.title} />
45
- </div>
46
- {/if}
47
- {#if isFilled.richText(slice.primary.description)}
48
- <div class="es-fullpage-hero__content__intro__description">
49
- <PrismicRichText field={slice.primary.description} />
50
- </div>
51
- {/if}
52
- <PrismicLink
53
- field={slice.primary.callToActionLink}
54
- class="es-call-to-action__link"
55
- />
56
- </div>
57
- </div>
58
- </div>
59
-
60
- <style>
61
- .es-bounded {
62
- margin: 0px;
63
- min-width: 0px;
64
- position: relative;
65
- }
66
-
67
- .es-fullpage-hero {
68
- font-family: system-ui, sans-serif;
69
- background-color: #fff;
70
- color: #333;
71
- }
72
-
73
- .es-fullpage-hero__image {
74
- max-width: 100%;
75
- height: auto;
76
- align-self: center;
77
- }
78
-
79
- .es-fullpage-hero__image--left > div:first-child {
80
- order: 1;
81
- }
82
-
83
- .es-fullpage-hero__image--left > div:nth-child(2) {
84
- order: 2;
85
- }
86
-
87
- .es-fullpage-hero__image--right > div:first-child {
88
- order: 2;
89
- }
90
-
91
- .es-fullpage-hero__image--right > div:nth-child(2) {
92
- order: 1;
93
- }
94
-
95
- .es-fullpage-hero__content {
96
- display: flex;
97
- flex-direction: column;
98
- gap: 2rem;
99
- }
100
-
101
- .es-fullpage-hero__content-right {
102
- display: flex;
103
- flex-direction: column;
104
- justify-content: space-around;
105
- padding: 1.5rem;
106
- }
107
-
108
- @media (min-width: 1080px) {
109
- .es-fullpage-hero__content {
110
- flex-direction: row;
111
- }
112
-
113
- .es-fullpage-hero__content > div {
114
- width: 50%;
115
- }
116
- }
117
-
118
- .es-fullpage-hero__content__intro {
119
- display: grid;
120
- gap: 1rem;
121
- }
122
-
123
- .es-fullpage-hero__content__intro__eyebrow {
124
- color: #47c1af;
125
- font-size: 1.15rem;
126
- font-weight: 500;
127
- margin: 0;
128
- }
129
-
130
- .es-fullpage-hero__content__intro__headline {
131
- font-size: 1.625rem;
132
- font-weight: 700;
133
- }
134
-
135
- .es-fullpage-hero__content__intro__headline * {
136
- margin: 0;
137
- }
138
-
139
- @media (min-width: 640px) {
140
- .es-fullpage-hero__content__intro__headline {
141
- font-size: 2rem;
142
- }
143
- }
144
-
145
- @media (min-width: 1024px) {
146
- .es-fullpage-hero__content__intro__headline {
147
- font-size: 2.5rem;
148
- }
149
- }
150
-
151
- @media (min-width: 1200px) {
152
- .es-fullpage-hero__content__intro__headline {
153
- font-size: 2.75rem;
154
- }
155
- }
156
-
157
- .es-fullpage-hero__content__intro__description {
158
- font-size: 1.15rem;
159
- max-width: 38rem;
160
- }
161
-
162
- .es-fullpage-hero__content__intro__description > p {
163
- margin: 0;
164
- }
165
-
166
- @media (min-width: 1200px) {
167
- .es-fullpage-hero__content__intro__description {
168
- font-size: 1.4rem;
169
- }
170
- }
171
-
172
- .es-call-to-action__link {
173
- justify-self: flex-start;
174
- border-radius: 0.25rem;
175
- font-size: 0.875rem;
176
- line-height: 1.3;
177
- padding: 1rem 2.625rem;
178
- transition: background-color 100ms linear;
179
- background-color: #16745f;
180
- color: #fff;
181
- }
182
-
183
- .es-call-to-action__link:hover {
184
- background-color: #0d5e4c;
185
- }
186
- </style>
187
- </section>
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const fs = require("@slicemachine/plugin-kit/fs");
4
- const semver = require("semver");
5
- const checkIsSvelte5 = (args) => {
6
- return checkIsSvelteN(5, args);
7
- };
8
- const checkIsSvelteN = async (version, args) => {
9
- try {
10
- const packageJsonContent = await fs.readProjectFile({
11
- filename: "package.json",
12
- encoding: "utf8",
13
- helpers: args.helpers
14
- });
15
- const packageJson = JSON.parse(packageJsonContent);
16
- const allDependencies = {
17
- ...packageJson.dependencies,
18
- ...packageJson.devDependencies
19
- };
20
- const svelteVersion = allDependencies.svelte;
21
- if (!svelteVersion || ["latest", "next", "beta", "alpha", "dev", "*"].includes(svelteVersion)) {
22
- return false;
23
- }
24
- const minVersion = semver.minVersion(svelteVersion) ?? svelteVersion;
25
- return semver.major(minVersion) === version;
26
- } catch (error) {
27
- return false;
28
- }
29
- };
30
- exports.checkIsSvelte5 = checkIsSvelte5;
31
- //# sourceMappingURL=checkIsSvelte5.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkIsSvelte5.cjs","sources":["../../../src/lib/checkIsSvelte5.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { readProjectFile } from \"@slicemachine/plugin-kit/fs\";\nimport semver from \"semver\";\n\nimport { PluginOptions } from \"../types\";\n\nexport const checkIsSvelte5 = (args: CheckIsSvelteNArgs): Promise<boolean> => {\n\treturn checkIsSvelteN(5, args);\n};\n\ntype CheckIsSvelteNArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nconst checkIsSvelteN = async (\n\tversion: number,\n\targs: CheckIsSvelteNArgs,\n): Promise<boolean> => {\n\ttry {\n\t\tconst packageJsonContent = await readProjectFile({\n\t\t\tfilename: \"package.json\",\n\t\t\tencoding: \"utf8\",\n\t\t\thelpers: args.helpers,\n\t\t});\n\n\t\tconst packageJson = JSON.parse(packageJsonContent);\n\t\tconst allDependencies: Record<string, string> = {\n\t\t\t...packageJson.dependencies,\n\t\t\t...packageJson.devDependencies,\n\t\t};\n\t\tconst svelteVersion = allDependencies.svelte;\n\n\t\t// Assume version doesn't match when no version is found or on special cases.\n\t\tif (\n\t\t\t!svelteVersion ||\n\t\t\t[\"latest\", \"next\", \"beta\", \"alpha\", \"dev\", \"*\"].includes(svelteVersion)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Try to get the minimum version.\n\t\tconst minVersion = semver.minVersion(svelteVersion) ?? svelteVersion;\n\n\t\t// Check if the version is a match.\n\t\treturn semver.major(minVersion) === version;\n\t} catch (error) {\n\t\treturn false;\n\t}\n};\n"],"names":["readProjectFile"],"mappings":";;;;AAMa,MAAA,iBAAiB,CAAC,SAA8C;AACrE,SAAA,eAAe,GAAG,IAAI;AAC9B;AAMA,MAAM,iBAAiB,OACtB,SACA,SACqB;AACjB,MAAA;AACG,UAAA,qBAAqB,MAAMA,mBAAgB;AAAA,MAChD,UAAU;AAAA,MACV,UAAU;AAAA,MACV,SAAS,KAAK;AAAA,IAAA,CACd;AAEK,UAAA,cAAc,KAAK,MAAM,kBAAkB;AACjD,UAAM,kBAA0C;AAAA,MAC/C,GAAG,YAAY;AAAA,MACf,GAAG,YAAY;AAAA,IAAA;AAEhB,UAAM,gBAAgB,gBAAgB;AAGtC,QACC,CAAC,iBACD,CAAC,UAAU,QAAQ,QAAQ,SAAS,OAAO,GAAG,EAAE,SAAS,aAAa,GACrE;AACM,aAAA;AAAA,IACR;AAGA,UAAM,aAAa,OAAO,WAAW,aAAa,KAAK;AAGhD,WAAA,OAAO,MAAM,UAAU,MAAM;AAAA,WAC5B;AACD,WAAA;AAAA,EACR;AACD;;"}
@@ -1,7 +0,0 @@
1
- import { SliceMachineContext } from "@slicemachine/plugin-kit";
2
- import { PluginOptions } from "../types";
3
- export declare const checkIsSvelte5: (args: CheckIsSvelteNArgs) => Promise<boolean>;
4
- type CheckIsSvelteNArgs = {
5
- helpers: SliceMachineContext<PluginOptions>["helpers"];
6
- };
7
- export {};
@@ -1,31 +0,0 @@
1
- import { readProjectFile } from "@slicemachine/plugin-kit/fs";
2
- import semver from "semver";
3
- const checkIsSvelte5 = (args) => {
4
- return checkIsSvelteN(5, args);
5
- };
6
- const checkIsSvelteN = async (version, args) => {
7
- try {
8
- const packageJsonContent = await readProjectFile({
9
- filename: "package.json",
10
- encoding: "utf8",
11
- helpers: args.helpers
12
- });
13
- const packageJson = JSON.parse(packageJsonContent);
14
- const allDependencies = {
15
- ...packageJson.dependencies,
16
- ...packageJson.devDependencies
17
- };
18
- const svelteVersion = allDependencies.svelte;
19
- if (!svelteVersion || ["latest", "next", "beta", "alpha", "dev", "*"].includes(svelteVersion)) {
20
- return false;
21
- }
22
- const minVersion = semver.minVersion(svelteVersion) ?? svelteVersion;
23
- return semver.major(minVersion) === version;
24
- } catch (error) {
25
- return false;
26
- }
27
- };
28
- export {
29
- checkIsSvelte5
30
- };
31
- //# sourceMappingURL=checkIsSvelte5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkIsSvelte5.js","sources":["../../../src/lib/checkIsSvelte5.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { readProjectFile } from \"@slicemachine/plugin-kit/fs\";\nimport semver from \"semver\";\n\nimport { PluginOptions } from \"../types\";\n\nexport const checkIsSvelte5 = (args: CheckIsSvelteNArgs): Promise<boolean> => {\n\treturn checkIsSvelteN(5, args);\n};\n\ntype CheckIsSvelteNArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nconst checkIsSvelteN = async (\n\tversion: number,\n\targs: CheckIsSvelteNArgs,\n): Promise<boolean> => {\n\ttry {\n\t\tconst packageJsonContent = await readProjectFile({\n\t\t\tfilename: \"package.json\",\n\t\t\tencoding: \"utf8\",\n\t\t\thelpers: args.helpers,\n\t\t});\n\n\t\tconst packageJson = JSON.parse(packageJsonContent);\n\t\tconst allDependencies: Record<string, string> = {\n\t\t\t...packageJson.dependencies,\n\t\t\t...packageJson.devDependencies,\n\t\t};\n\t\tconst svelteVersion = allDependencies.svelte;\n\n\t\t// Assume version doesn't match when no version is found or on special cases.\n\t\tif (\n\t\t\t!svelteVersion ||\n\t\t\t[\"latest\", \"next\", \"beta\", \"alpha\", \"dev\", \"*\"].includes(svelteVersion)\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Try to get the minimum version.\n\t\tconst minVersion = semver.minVersion(svelteVersion) ?? svelteVersion;\n\n\t\t// Check if the version is a match.\n\t\treturn semver.major(minVersion) === version;\n\t} catch (error) {\n\t\treturn false;\n\t}\n};\n"],"names":[],"mappings":";;AAMa,MAAA,iBAAiB,CAAC,SAA8C;AACrE,SAAA,eAAe,GAAG,IAAI;AAC9B;AAMA,MAAM,iBAAiB,OACtB,SACA,SACqB;AACjB,MAAA;AACG,UAAA,qBAAqB,MAAM,gBAAgB;AAAA,MAChD,UAAU;AAAA,MACV,UAAU;AAAA,MACV,SAAS,KAAK;AAAA,IAAA,CACd;AAEK,UAAA,cAAc,KAAK,MAAM,kBAAkB;AACjD,UAAM,kBAA0C;AAAA,MAC/C,GAAG,YAAY;AAAA,MACf,GAAG,YAAY;AAAA,IAAA;AAEhB,UAAM,gBAAgB,gBAAgB;AAGtC,QACC,CAAC,iBACD,CAAC,UAAU,QAAQ,QAAQ,SAAS,OAAO,GAAG,EAAE,SAAS,aAAa,GACrE;AACM,aAAA;AAAA,IACR;AAGA,UAAM,aAAa,OAAO,WAAW,aAAa,KAAK;AAGhD,WAAA,OAAO,MAAM,UAAU,MAAM;AAAA,WAC5B;AACD,WAAA;AAAA,EACR;AACD;"}