Skip to content

Commit

Permalink
recreate @primate/solid
Browse files Browse the repository at this point in the history
  • Loading branch information
terrablue committed Aug 4, 2024
1 parent 38d88f2 commit c7e81d7
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 33 deletions.
12 changes: 0 additions & 12 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,10 @@
"@rcompat/object": "^0.5.0"
},
"peerDependencies": {
"@babel/core": "7",
"babel-preset-solid": "1",
"primate": "workspace:^",
"solid-js": "1",
"svelte": "4"
},
"peerDependenciesMeta": {
"@babel/core": {
"optional": true
},
"babel-preset-solid": {
"optional": true
},
"solid-js": {
"optional": true
},
"svelte": {
"optional": true
}
Expand Down
1 change: 0 additions & 1 deletion packages/frontend/src/server/solid/dependencies.js

This file was deleted.

64 changes: 64 additions & 0 deletions packages/solid/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "@primate/solid",
"version": "0.4.0",
"description": "Primate Solid frontend",
"homepage": "https://primatejs.com/modules/solid",
"bugs": "https://github.com/primatejs/primate/issues",
"license": "MIT",
"files": [
"src/**/*.js",
"!src/**/*.spec.js"
],
"repository": {
"type": "git",
"url": "https://github.com/primatejs/primate",
"directory": "packages/solid"
},
"dependencies": {
"@primate/frontend": "workspace:^",
"@rcompat/build": "^0.4.0",
"@rcompat/fs": "^0.4.0",
"@rcompat/platform": "^0.3.0"
},
"peerDependencies": {
"@babel/core": "7",
"babel-preset-solid": "1",
"primate": "workspace:^",
"solid-js": "1"
},
"type": "module",
"imports": {
"#*": {
"@primate/lt": "./src/private/*.js",
"default": "./src/private/*.js"
},
"#build": {
"@primate/lt": "./src/private/build/index.js",
"default": "./src/private/build/index.js"
},
"#serve": {
"@primate/lt": "./src/private/serve/index.js",
"default": "./src/private/serve/index.js"
},
"#context/*": {
"@primate/lt": "./src/private/context/*.js",
"default": "./src/private/context/*.js"
},
"#client": {
"@primate/lt": "./src/private/client/index.js",
"default": "./src/private/client/index.js"
},
"#client/*": {
"@primate/lt": "./src/private/client/*.js",
"default": "./src/private/client/*.js"
}
},
"exports": {
".": {
"runtime": "./src/public/runtime.js",
"default": "./src/public/default.js"
},
"./head": "./src/public/head.js",
"./context/*": "./src/public/context/*.js"
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import build from "#build";
import name from "#solid/name";
import create_root from "#solid/client/create-root";
import expose from "#solid/client/expose";
import create_root from "#client/create-root";
import expose from "#client/expose";
import name from "#name";
import build from "@primate/frontend/core/build";
import client from "./client.js";
import publish from "./publish.js";
import server from "./server.js";
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export default length => {
return `
import { createSignal } from "solid-js";
import { createComponent } from "solid-js/web";
import AppContext from "@primate/frontend/solid/context/app";
import HeadContext from "@primate/frontend/solid/context/head";
import AppContext from "@primate/solid/context/app";
import HeadContext from "@primate/solid/context/head";
export default ({
components,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ export default `
hydrate as hydrate_solid,
render as render_solid,
} from "solid-js/web";
export { default as SolidHead } from "@primate/frontend/solid/head";
export { default as SolidHead } from "@primate/solid/head";
`;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions packages/solid/src/private/pkgname.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default "@primate/solid";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import handler from "#handler";
import client from "#solid/client";
import name from "#solid/name";
import handler from "@primate/frontend/core/handler";
import client from "#client";
import name from "#name";
import render from "./render.js";

export default (extension, spa) => (app, next) => {
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions packages/solid/src/public/context/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "#context/app";
1 change: 1 addition & 0 deletions packages/solid/src/public/context/head.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "#context/head";
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import build from "#solid/build";
import default_extension from "#solid/extension";
import name from "#solid/name";
import serve from "#solid/serve";
import build from "#build";
import default_extension from "#extension";
import pkgname from "#pkgname";
import serve from "#serve";

export default ({
extension = default_extension,
// activate fetch-based browsing
spa = true,
} = {}) => ({
name: `primate:${name}`,
name: pkgname,
build: build(extension),
serve: serve(extension, spa),
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import HeadContext from "#solid/context/head";
import HeadContext from "#context/head";
import platform from "@rcompat/platform";
import { onCleanup, onMount, useContext } from "solid-js";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import default_extension from "#solid/extension";
import name from "#solid/name";
import serve from "#solid/serve";
import default_extension from "#extension";
import pkgname from "#pkgname";
import serve from "#serve";

export default ({
extension = default_extension,
// activate fetch-based browsing
spa = true,
} = {}) => ({
name: `primate:${name}`,
name: pkgname,
serve: serve(extension, spa),
});
3 changes: 3 additions & 0 deletions packages/solid/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig.base.json"
}

0 comments on commit c7e81d7

Please sign in to comment.