Skip to content

Commit 92a770e

Browse files
author
Flo
committed
Copy over everything from symfony/ux#2288
0 parents  commit 92a770e

38 files changed

+1368
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/.symfony.bundle.yaml export-ignore
4+
/assets/src export-ignore
5+
/assets/test export-ignore
6+
/assets/vitest.config.js export-ignore
7+
/doc export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/tests export-ignore

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/assets/node_modules/
2+
/vendor/
3+
/composer.lock
4+
/phpunit.xml
5+
/.phpunit.result.cache

.symfony.bundle.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
branches: ["2.x"]
2+
maintained_branches: ["2.x"]
3+
doc_dir: "doc"

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# CHANGELOG
2+
3+
## 2.13.2
4+
5+
- Revert "Change JavaScript package to `type: module`"
6+
7+
## 2.13.0
8+
9+
- Add support for Svelte 4.
10+
- Add Symfony 7 support.
11+
- Change JavaScript package to `type: module`
12+
13+
## 2.9.0
14+
15+
- Add support for symfony/asset-mapper
16+
17+
- Replace `symfony/webpack-encore-bundle` by `symfony/stimulus-bundle` in dependencies
18+
19+
- Minimum PHP version is now 8.1
20+
21+
## 2.8.0
22+
23+
- Introduce the package

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2021-present Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Fork by ChqThomas
2+
3+
https://github.com/symfony/ux/pull/2288
4+
5+
# Symfony UX Svelte
6+
7+
Symfony UX Svelte integrates [Svelte](https://svelte.dev/) into Symfony applications.
8+
It provides tools to render Svelte 3 components from Twig.
9+
10+
**This repository is a READ-ONLY sub-tree split**. See
11+
https://github.com/symfony/ux to create issues or submit pull requests.
12+
13+
## Resources
14+
15+
- [Documentation](https://symfony.com/bundles/ux-svelte/current/index.html)
16+
- [Report issues](https://github.com/symfony/ux/issues) and
17+
[send Pull Requests](https://github.com/symfony/ux/pulls)
18+
in the [main Symfony UX repository](https://github.com/symfony/ux)
19+

assets/dist/components.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { SvelteComponent } from 'svelte';
2+
export interface ComponentCollection {
3+
[key: string]: SvelteComponent;
4+
}
5+
export declare const components: ComponentCollection;

assets/dist/components.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const components = {};
2+
3+
export { components };

assets/dist/loader.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { SvelteComponent } from 'svelte';
2+
import { type ComponentCollection } from './components.js';
3+
declare global {
4+
function resolveSvelteComponent(name: string): typeof SvelteComponent<any>;
5+
interface Window {
6+
resolveSvelteComponent(name: string): typeof SvelteComponent<any>;
7+
}
8+
}
9+
export declare function registerSvelteControllerComponents(svelteComponents?: ComponentCollection): void;

assets/dist/loader.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { components } from './components.js';
2+
3+
function registerSvelteControllerComponents(svelteComponents = components) {
4+
window.resolveSvelteComponent = (name) => {
5+
const component = svelteComponents[name];
6+
if (typeof component === 'undefined') {
7+
const possibleValues = Object.keys(svelteComponents).length > 0 ? Object.keys(svelteComponents).join(', ') : 'none';
8+
throw new Error(`Svelte controller "${name}" does not exist. Possible values: ${possibleValues}`);
9+
}
10+
return component;
11+
};
12+
}
13+
14+
export { registerSvelteControllerComponents };

0 commit comments

Comments
 (0)