Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bobtemplates/plone/svelte_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _update_configure_zcml(configurator):
match_str = "-*- extra stuff goes here -*-"
insert_str = """
<plone:static
directory="svelte_apps"
directory="apps"
type="plone"
name="{0}.svelte"
/>
Expand All @@ -73,13 +73,13 @@ def post_renderer(configurator):
run_black(configurator)
git_commit(
configurator,
"Add Svelte app: in svelte_apps/{0}".format(
"Add Svelte app: in apps/{0}".format(
configurator.variables["svelte_app_name"],
),
)
echo(
"===================================================\n"
"=> Sucessfully added: {0} in svelte_apps/{1} \n"
"=> Sucessfully added: {0} in apps/{1} \n"
"=> you might want to go into the dir and run:\n"
"$ yarn\n"
"and then:"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"moduleResolution": "bundler",
"target": "ESNext",
"module": "ESNext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"verbatimModuleSyntax": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "{{{ svelte_app_name }}}",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"watch": "vite build --watch",
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.2",
"svelte": "^4.0.5",
"vite": "^4.4.5"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'

export default {
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
// for more information about preprocessors
preprocess: vitePreprocess(),
compilerOptions: {
css: "external",
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'

// https://vitejs.dev/config/
export default defineConfig({
build: {
manifest: true,
rollupOptions: {
input: 'src/main.js',
output: {
entryFileNames: `assets/{{{ svelte_app_name_dashed }}}-[name].js`,
// chunkFileNames: `assets/[name].js`,
// assetFileNames: `assets/[name].[ext]`,
sourcemap: true,
format: 'iife',
name: '{{{ svelte_app_file_name }}}',
dir: '../../src/{{{ package.namespace }}}/{{{ package.name }}}/apps/{{{ svelte_app_name_dashed }}}/'
},
}
},
base: '../../src/{{{ package.namespace }}}/{{{ package.name }}}/apps/{{{ svelte_app_name_dashed }}}/',
plugins: [svelte()],
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
t<?xml version="1.0"?>
<registry
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="{{{ package.dottedname }}}">
Expand All @@ -8,8 +8,8 @@
<value key="enabled">True</value>
<value key="load_defer">True</value>
<value key="compile">False</value>
<value key="jscompilation">++plone++{{{ package.dottedname }}}.svelte/{{{ svelte_app_name_dashed }}}/{{{ svelte_app_name_dashed }}}-bundle.js</value>
<value key="csscompilation">++plone++{{{ package.dottedname }}}.svelte/{{{ svelte_app_name_dashed }}}/{{{ svelte_app_name_dashed }}}-bundle.css</value>
<value key="jscompilation">++plone++{{{ package.dottedname }}}.svelte/{{{ svelte_app_name_dashed }}}/assets/{{{ svelte_app_name_dashed }}}-main.js</value>
<!-- <value key="csscompilation">++plone++{{{ package.dottedname }}}.svelte/{{{ svelte_app_name_dashed }}}/assets/{{{ svelte_app_name_dashed }}}-main.css</value> -->
<value key="last_compilation">2020-10-29 22:00:00</value>
</records>

Expand All @@ -25,8 +25,10 @@
</value>
</records>

<!-- <records interface="Products.CMFPlone.interfaces.controlpanel.ITinyMCESchema" prefix="plone">
<!--
<records interface="Products.CMFPlone.interfaces.controlpanel.ITinyMCESchema" prefix="plone">
<value key="other_settings" purge="false">{"custom_elements": "{{{ svelte_app_name_dashed }}}"}</value>
</records> -->
</records>
-->

</registry>

This file was deleted.

This file was deleted.