Skip to content

Commit

Permalink
Complete refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelmund committed Jan 3, 2022
1 parent 6b61414 commit ad42ae5
Show file tree
Hide file tree
Showing 142 changed files with 6,271 additions and 3,727 deletions.
27 changes: 9 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,38 @@ on:
env:
CI: true
TEST: true
PLAYWRIGHT_BROWSERS_PATH: 0

jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
version: 6.23.2
- uses: actions/setup-node@v2
with:
node-version: "14.x"
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm check
node-version: '14'
- run: npm install
- run: npm run lint
- run: npm run check
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
node-version: '14'

- name: Cache node modules
id: playwright-cache
uses: actions/cache@v2
with:
path: ~/.npm
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-

- name: Playwright install
working-directory: packages/svemix
- name: Install dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install-deps

- name: Dependencies install
working-directory: packages/svemix
run: npm install
run: npm ci

- name: Run tests
working-directory: packages/svemix
run: npm run test
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: NPM PUBLISH
on:
release:
types: [created]
workflow_dispatch:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -11,15 +11,15 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Svemix Build
working-directory: packages/svemix
run: npm install && npm run test
- name: Svemix Publish
- name: Svemix Publish
working-directory: packages/svemix/dist
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.DS_Store
node_modules
/node_modules
node_modules/
/packages/svemix/node_modules
/packages/svemix-preprocess/node_modules
**node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021 [pixelmund](https://github.com/pixelmund)
Copyright (c) 2021 [svemix](https://github.com/svemix)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# Welcome to Svemix

Svemix is a somewhat different framework than you're probably used to.
It can be seen as a full-stack addition to Svelte(SvelteKit).
It can be seen as an full-stack addition to Svelte(SvelteKit).
Svemix provides you with server scripts inside your Svelte components/routes, which will be transformed into endpoints.
Loader functions and actions similar to remix, which also run only on the server, improved developer experience, SEO handling, easy to use forms, sessions and so much more.

[For an still early example please look into this repo](https://github.com/svemix/svemix-example).

This repository contains the Svemix source code. This repo and project is a work in progress, so we appreciate your patience.


## Documentation

For documentation about Svemix (which is missing a lot of things), please visit [our website](https://svemix.com).


## Contributing

If you're interested in contributing code and/or documentation, feel free to open an Pull Request. A Contributing Guide will follow in the Future.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion packages/svemix/dist/meta.d.ts → dist/meta.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ export interface MetaResult {
openGraph?: OpenGraph;
twitter?: Twitter;
}
export declare type MetaFunction<Props extends Record<any, any>> = (props: Props) => MetaResult;
export declare type MetaFunction<Props extends Record<any, any>> = (
props: Props
) => MetaResult | Promise<MetaResult>;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SVEMIX_DIR, tc, writeFile } from '../utils.js';
const SSRTransformer = function (args) {
let { doc, config } = args;
let { doc } = args;
const ssrContent = ssrEndpointTemplate({
ssrContent: doc.scripts.ssr.content,
doc
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { RequestHandler } from '@sveltejs/kit/types/endpoint';
import type { ServerRequest } from '@sveltejs/kit/types/hooks';
import type { ActionResult, LoaderResult, MetaFunction } from '.';
import type { ActionResult, LoaderResult } from '.';
import type { MetaFunction } from '../meta';
interface SvemixPostHandlerParams {
action: (request: ServerRequest) => Promise<ActionResult> | ActionResult;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/
// @ts-nocheck
/**
* Module variables.
* @private
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 0 additions & 38 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +0,0 @@
# create-svelte

Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte);

## Creating a project

If you're seeing this, you've probably already done this step. Congrats!

```bash
# create a new project in the current directory
npm init svelte@next

# create a new project in my-app
npm init svelte@next my-app
```

> Note: the `@next` is temporary
## Developing

Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

Before creating a production version of your app, install an [adapter](https://kit.svelte.dev/docs#adapters) for your target environment. Then:

```bash
npm run build
```

> You can preview the built app with `npm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production.
2 changes: 1 addition & 1 deletion docs/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta name="msapplication-TileColor" content="#171717" />
<meta name="theme-color" content="#171717" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="https://rsms.me/inter/inter.css">
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
%svelte.head%
</head>
<body class="overflow-x-hidden bg-neutral-900 text-gray-200 min-h-screen w-full">
Expand Down
66 changes: 33 additions & 33 deletions docs/src/prism.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* purgecss start ignore */

pre[class*="language-"],
code[class*="language-"] {
pre[class*='language-'],
code[class*='language-'] {
color: #d4d4d4;
font-size: 18px;
text-shadow: none;
font-family: Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace;
font-family: Menlo, Monaco, Consolas, 'Andale Mono', 'Ubuntu Mono', 'Courier New', monospace;
direction: ltr;
text-align: left;
white-space: pre;
Expand All @@ -21,43 +21,43 @@ code[class*="language-"] {
hyphens: none;
}

pre[class*="language-"]::selection,
code[class*="language-"]::selection,
pre[class*="language-"] *::selection,
code[class*="language-"] *::selection {
pre[class*='language-']::selection,
code[class*='language-']::selection,
pre[class*='language-'] *::selection,
code[class*='language-'] *::selection {
text-shadow: none;
background: #264F78;
background: #264f78;
}

@media print {
pre[class*="language-"],
code[class*="language-"] {
pre[class*='language-'],
code[class*='language-'] {
text-shadow: none;
}
}

pre[class*="language-"] {
pre[class*='language-'] {
padding: 1em;
margin: .5em 0;
margin: 0.5em 0;
overflow: auto;
background: #1e1e1e;
}

:not(pre) > code[class*="language-"] {
padding: .1em .3em;
border-radius: .3em;
:not(pre) > code[class*='language-'] {
padding: 0.1em 0.3em;
border-radius: 0.3em;
color: #db4c69;
background: #1e1e1e;
}
/*********************************************************
* Tokens
*/
.namespace {
opacity: .7;
opacity: 0.7;
}

.token.doctype .token.doctype-tag {
color: #569CD6;
color: #569cd6;
}

.token.doctype .token.name {
Expand Down Expand Up @@ -105,7 +105,7 @@ pre[class*="language-"] {
}

.token.operator.arrow {
color: #569CD6;
color: #569cd6;
}

.token.atrule {
Expand All @@ -129,7 +129,7 @@ pre[class*="language-"] {
}

.token.keyword {
color: #569CD6;
color: #569cd6;
}

.token.keyword.module,
Expand Down Expand Up @@ -234,24 +234,24 @@ pre[class*="language-"] {
* Language Specific
*/

pre[class*="language-javascript"],
code[class*="language-javascript"],
pre[class*="language-jsx"],
code[class*="language-jsx"],
pre[class*="language-typescript"],
code[class*="language-typescript"],
pre[class*="language-tsx"],
code[class*="language-tsx"] {
pre[class*='language-javascript'],
code[class*='language-javascript'],
pre[class*='language-jsx'],
code[class*='language-jsx'],
pre[class*='language-typescript'],
code[class*='language-typescript'],
pre[class*='language-tsx'],
code[class*='language-tsx'] {
color: #9cdcfe;
}

pre[class*="language-css"],
code[class*="language-css"] {
pre[class*='language-css'],
code[class*='language-css'] {
color: #ce9178;
}

pre[class*="language-html"],
code[class*="language-html"] {
pre[class*='language-html'],
code[class*='language-html'] {
color: #d4d4d4;
}

Expand All @@ -265,7 +265,7 @@ code[class*="language-html"] {
/*********************************************************
* Line highlighting
*/
pre[class*="language-"] > code[class*="language-"] {
pre[class*='language-'] > code[class*='language-'] {
position: relative;
z-index: 1;
}
Expand All @@ -276,4 +276,4 @@ pre[class*="language-"] > code[class*="language-"] {
z-index: 0;
}

/* purgecss end ignore */
/* purgecss end ignore */
34 changes: 14 additions & 20 deletions docs/src/routes/$__svemix__/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import { getHandler, postHandler } from 'svemix/server';

import { getHandler, postHandler } from "svemix/server";
import type { MetaFunction } from 'svemix/server';
export const prerender = true;


import type { MetaFunction } from "svemix/server"
export const prerender = true;
export const loader = () => ({});

export const loader = () => ({})
export const metadata: MetaFunction<any> = () => ({
title: 'The Full-Stack addition to SvelteKit - SVEMIX',
description:
'The Full-Stack addition to SvelteKit. Write your server code inside .svelte files, handle sessions, forms and SEO easily.'
});

export const metadata : MetaFunction<any> = () => ({
title: 'The Full-Stack addition to SvelteKit - SVEMIX',
description: 'The Full-Stack addition to SvelteKit. Write your server code inside .svelte files, handle sessions, forms and SEO easily.'
})



export const get = getHandler({
hasMeta: true,
loader: loader,
metadata: metadata
});



export const get = getHandler({
hasMeta: true,
loader: loader,
metadata: metadata
});
Loading

0 comments on commit ad42ae5

Please sign in to comment.