mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
chore(examples): remove Sapper, Snowpack examples (#1423)
* chore(examples): remove Sapper example As of June 2022, Sapper is officially deprecated. Ref:ef01df6f4e
* chore(examples): remove Snowpack example As of April 2022, Snowpack is no longer maintained. Vite is the recommended alternative. Ref:45456aa149
This commit is contained in:
parent
6f9e023066
commit
cae4629b98
20 changed files with 0 additions and 5246 deletions
|
@ -1,6 +1,5 @@
|
||||||
/lib
|
/lib
|
||||||
/css
|
/css
|
||||||
__sapper__
|
|
||||||
.svelte-kit
|
.svelte-kit
|
||||||
.routify
|
.routify
|
||||||
dist
|
dist
|
||||||
|
|
|
@ -225,8 +225,6 @@ export default {
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- [examples/rollup](examples/rollup/)
|
- [examples/rollup](examples/rollup/)
|
||||||
- [examples/sapper](examples/sapper/)
|
|
||||||
- [examples/snowpack](examples/snowpack/)
|
|
||||||
- [examples/sveltekit](examples/sveltekit/)
|
- [examples/sveltekit](examples/sveltekit/)
|
||||||
- [examples/vite](examples/vite/)
|
- [examples/vite](examples/vite/)
|
||||||
- [examples/webpack](examples/webpack/)
|
- [examples/webpack](examples/webpack/)
|
||||||
|
|
4
examples/sapper/.gitignore
vendored
4
examples/sapper/.gitignore
vendored
|
@ -1,4 +0,0 @@
|
||||||
.DS_Store
|
|
||||||
/node_modules/
|
|
||||||
/src/node_modules/
|
|
||||||
/__sapper__/
|
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
"version": "0.0.1",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"start": "node __sapper__/build",
|
|
||||||
"dev": "sapper dev",
|
|
||||||
"build": "sapper build --legacy",
|
|
||||||
"export": "sapper export --legacy"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"polka": "next"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@babel/core": "^7.18.9",
|
|
||||||
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
|
||||||
"@babel/plugin-transform-runtime": "^7.18.9",
|
|
||||||
"@babel/preset-env": "^7.18.9",
|
|
||||||
"@babel/runtime": "^7.18.9",
|
|
||||||
"@rollup/plugin-babel": "^5.3.1",
|
|
||||||
"@rollup/plugin-commonjs": "^21.1.0",
|
|
||||||
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
||||||
"@rollup/plugin-replace": "^4.0.0",
|
|
||||||
"@rollup/plugin-url": "^6.1.0",
|
|
||||||
"carbon-components-svelte": "^0.64.3",
|
|
||||||
"carbon-preprocess-svelte": "^0.9.1",
|
|
||||||
"rollup": "^2.77.0",
|
|
||||||
"rollup-plugin-svelte": "^7.1.0",
|
|
||||||
"rollup-plugin-terser": "^7.0.0",
|
|
||||||
"sapper": "^0.29.3",
|
|
||||||
"svelte": "^3.49.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,98 +0,0 @@
|
||||||
import path from "path";
|
|
||||||
import resolve from "@rollup/plugin-node-resolve";
|
|
||||||
import replace from "@rollup/plugin-replace";
|
|
||||||
import commonjs from "@rollup/plugin-commonjs";
|
|
||||||
import url from "@rollup/plugin-url";
|
|
||||||
import svelte from "rollup-plugin-svelte";
|
|
||||||
import babel from "@rollup/plugin-babel";
|
|
||||||
import { terser } from "rollup-plugin-terser";
|
|
||||||
import { optimizeImports } from "carbon-preprocess-svelte";
|
|
||||||
import config from "sapper/config/rollup.js";
|
|
||||||
import pkg from "./package.json";
|
|
||||||
|
|
||||||
const mode = process.env.NODE_ENV;
|
|
||||||
const dev = mode === "development";
|
|
||||||
const legacy = !!process.env.SAPPER_LEGACY_BUILD;
|
|
||||||
|
|
||||||
const onwarn = (warning, onwarn) =>
|
|
||||||
(warning.code === "MISSING_EXPORT" && /'preload'/.test(warning.message)) ||
|
|
||||||
(warning.code === "CIRCULAR_DEPENDENCY" &&
|
|
||||||
/[/\\]@sapper[/\\]/.test(warning.message)) ||
|
|
||||||
onwarn(warning);
|
|
||||||
|
|
||||||
export default {
|
|
||||||
client: {
|
|
||||||
input: config.client.input(),
|
|
||||||
output: config.client.output(),
|
|
||||||
plugins: [
|
|
||||||
replace({
|
|
||||||
preventAssignment: true,
|
|
||||||
"process.browser": true,
|
|
||||||
"process.env.NODE_ENV": JSON.stringify(mode),
|
|
||||||
}),
|
|
||||||
svelte({
|
|
||||||
preprocess: [optimizeImports()],
|
|
||||||
compilerOptions: {
|
|
||||||
dev,
|
|
||||||
hydratable: true,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
url({
|
|
||||||
sourceDir: path.resolve(__dirname, "src/node_modules/images"),
|
|
||||||
publicPath: "/client/",
|
|
||||||
}),
|
|
||||||
resolve({
|
|
||||||
browser: true,
|
|
||||||
dedupe: ["svelte"],
|
|
||||||
}),
|
|
||||||
commonjs(),
|
|
||||||
|
|
||||||
legacy &&
|
|
||||||
babel({
|
|
||||||
extensions: [".js", ".mjs", ".html", ".svelte"],
|
|
||||||
babelHelpers: "runtime",
|
|
||||||
exclude: ["node_modules/@babel/**"],
|
|
||||||
presets: [["@babel/preset-env", { targets: "> 0.25%, not dead" }]],
|
|
||||||
plugins: [
|
|
||||||
"@babel/plugin-syntax-dynamic-import",
|
|
||||||
["@babel/plugin-transform-runtime", { useESModules: true }],
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
!dev && terser({ module: true }),
|
|
||||||
],
|
|
||||||
preserveEntrySignatures: false,
|
|
||||||
onwarn,
|
|
||||||
},
|
|
||||||
server: {
|
|
||||||
input: config.server.input(),
|
|
||||||
output: config.server.output(),
|
|
||||||
plugins: [
|
|
||||||
replace({
|
|
||||||
preventAssignment: true,
|
|
||||||
"process.browser": false,
|
|
||||||
"process.env.NODE_ENV": JSON.stringify(mode),
|
|
||||||
}),
|
|
||||||
svelte({
|
|
||||||
preprocess: [optimizeImports()],
|
|
||||||
compilerOptions: {
|
|
||||||
dev,
|
|
||||||
generate: "ssr",
|
|
||||||
hydratable: true,
|
|
||||||
},
|
|
||||||
emitCss: false,
|
|
||||||
}),
|
|
||||||
url({
|
|
||||||
sourceDir: path.resolve(__dirname, "src/node_modules/images"),
|
|
||||||
publicPath: "/client/",
|
|
||||||
emitFiles: false, // already emitted by client build
|
|
||||||
}),
|
|
||||||
resolve({ dedupe: ["svelte"] }),
|
|
||||||
commonjs(),
|
|
||||||
],
|
|
||||||
external: Object.keys(pkg.dependencies).concat(
|
|
||||||
require("module").builtinModules
|
|
||||||
),
|
|
||||||
preserveEntrySignatures: "strict",
|
|
||||||
onwarn,
|
|
||||||
},
|
|
||||||
};
|
|
|
@ -1,3 +0,0 @@
|
||||||
import * as sapper from "@sapper/app";
|
|
||||||
|
|
||||||
sapper.start({ target: document.querySelector("#sapper") });
|
|
|
@ -1,12 +0,0 @@
|
||||||
<script>
|
|
||||||
export let status;
|
|
||||||
export let error;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<svelte:head>
|
|
||||||
<title>{status}</title>
|
|
||||||
</svelte:head>
|
|
||||||
|
|
||||||
<h1>{status}</h1>
|
|
||||||
|
|
||||||
<p>{error.message}</p>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<script>
|
|
||||||
import "carbon-components-svelte/css/white.css";
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<slot />
|
|
|
@ -1,5 +0,0 @@
|
||||||
<script>
|
|
||||||
import { Button } from "carbon-components-svelte";
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<Button>Primary button</Button>
|
|
|
@ -1,11 +0,0 @@
|
||||||
import polka from "polka";
|
|
||||||
import * as sapper from "@sapper/server";
|
|
||||||
|
|
||||||
const { PORT, NODE_ENV } = process.env;
|
|
||||||
const dev = NODE_ENV === "development";
|
|
||||||
|
|
||||||
polka()
|
|
||||||
.use(sapper.middleware())
|
|
||||||
.listen(PORT, (err) => {
|
|
||||||
if (err) console.log("error", err);
|
|
||||||
});
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
||||||
%sapper.base% %sapper.scripts% %sapper.styles% %sapper.head%
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="sapper">%sapper.html%</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
File diff suppressed because it is too large
Load diff
3
examples/snowpack/.gitignore
vendored
3
examples/snowpack/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
||||||
/.snowpack
|
|
||||||
/build
|
|
||||||
/node_modules
|
|
|
@ -1,6 +0,0 @@
|
||||||
<script>
|
|
||||||
import "carbon-components-svelte/css/white.css";
|
|
||||||
import { Button } from "carbon-components-svelte";
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<Button>Primary button</Button>
|
|
|
@ -1,12 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<meta name="description" content="Snowpack App" />
|
|
||||||
<title>snowpack</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script type="module" src="/index.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,5 +0,0 @@
|
||||||
import App from "./App.svelte";
|
|
||||||
|
|
||||||
const app = new App({ target: document.body });
|
|
||||||
|
|
||||||
export default app;
|
|
|
@ -1,16 +0,0 @@
|
||||||
{
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"dev": "snowpack dev",
|
|
||||||
"build": "snowpack build"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"svelte": "^3.49.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@snowpack/plugin-svelte": "^3.7.0",
|
|
||||||
"carbon-components-svelte": "^0.67.1",
|
|
||||||
"carbon-preprocess-svelte": "^0.9.1",
|
|
||||||
"snowpack": "^3.8.8"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
/** @type {import("snowpack").SnowpackUserConfig } */
|
|
||||||
module.exports = {
|
|
||||||
plugins: ["@snowpack/plugin-svelte"],
|
|
||||||
};
|
|
|
@ -1,5 +0,0 @@
|
||||||
const { optimizeImports } = require("carbon-preprocess-svelte");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
preprocess: [optimizeImports()],
|
|
||||||
};
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue