Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Jul 9, 2020
0 parents commit 4f03dec
Show file tree
Hide file tree
Showing 19 changed files with 5,685 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
/build/
node_modules/

/.tsc-output/
1 change: 1 addition & 0 deletions .nvmrc
@@ -0,0 +1 @@
14
18 changes: 18 additions & 0 deletions babel.config.cjs
@@ -0,0 +1,18 @@
// This is a CommonJS module because when we run Babel inside
// of Jest, it complains that it needs to be run in asynchronous
// mode. No idea why...

module.exports = {
presets: [
[
"@babel/preset-env",
{
targets: {
node: "current"
}
}
],
"@babel/preset-react",
"@babel/preset-typescript"
]
};
7 changes: 7 additions & 0 deletions jest.config.js
@@ -0,0 +1,7 @@
export default {
projects: [
"<rootDir>/packages/remix",
"<rootDir>/packages/@remix-run-core",
"<rootDir>/packages/@remix-run-express"
]
};
51 changes: 51 additions & 0 deletions package.json
@@ -0,0 +1,51 @@
{
"private": true,
"name": "remix-packages",
"type": "module",
"scripts": {
"clean": "git clean -fdX .",
"test": "jest",
"build": "node ./scripts/build.js",
"watch": "node ./scripts/watch.js"
},
"workspaces": [
"packages/remix",
"packages/@remix-run-core",
"packages/@remix-run-express"
],
"dependencies": {
"@babel/core": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-react": "^7.10.4",
"@babel/preset-typescript": "^7.10.4",
"@types/jest": "^25.2.3",
"@types/react": "^16.9.41",
"@types/react-test-renderer": "^16.9.2",
"@typescript-eslint/eslint-plugin": "2.x",
"@typescript-eslint/parser": "2.x",
"babel-eslint": "10.x",
"eslint": "6.x",
"eslint-config-react-app": "^5.2.1",
"eslint-plugin-flowtype": "4.x",
"eslint-plugin-import": "2.x",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-react": "7.x",
"eslint-plugin-react-hooks": "2.x",
"history": "^5.0.0",
"jest": "^26.0.1",
"prettier": "^2.0.5",
"react": "0.0.0-experimental-33c3af284",
"react-dom": "0.0.0-experimental-33c3af284",
"react-router-dom": "0.0.0-experimental-ffd8c7d0",
"react-test-renderer": "0.0.0-experimental-33c3af284",
"rollup": "^2.21.0",
"typescript": "^3.9.6"
},
"prettier": {
"arrowParens": "avoid",
"trailingComma": "none"
},
"eslintConfig": {
"extends": "react-app"
}
}
1 change: 1 addition & 0 deletions packages/@remix-run-core/createHttpHandler.ts
@@ -0,0 +1 @@
export default function createHttpHandler() {}
1 change: 1 addition & 0 deletions packages/@remix-run-core/index.tsx
@@ -0,0 +1 @@
export { default as createHttpHandler } from "./createHttpHandler";
4 changes: 4 additions & 0 deletions packages/@remix-run-core/package.json
@@ -0,0 +1,4 @@
{
"name": "@remix-run/core",
"version": "0.0.0"
}
3 changes: 3 additions & 0 deletions packages/@remix-run-express/index.tsx
@@ -0,0 +1,3 @@
import { createHttpHandler } from "@remix-run/core";

export default createHttpHandler();
4 changes: 4 additions & 0 deletions packages/@remix-run-express/package.json
@@ -0,0 +1,4 @@
{
"name": "@remix-run/express",
"version": "0.0.0"
}
16 changes: 16 additions & 0 deletions packages/remix/__tests__/link-test.tsx
@@ -0,0 +1,16 @@
import React from "react";
import { create as createTestRenderer } from "react-test-renderer";
import { RemixLink } from "remix";

describe("A <RemixLink>", () => {
it("works", () => {
let renderer = createTestRenderer(<RemixLink />);
expect(renderer.toJSON()).toMatchInlineSnapshot(`
<a
href="#"
>
link
</a>
`);
});
});
7 changes: 7 additions & 0 deletions packages/remix/index.tsx
@@ -0,0 +1,7 @@
import React from "react";

export function RemixLink() {
return <a href="#">link</a>;
}

export function RemixEntryProvider() {}
10 changes: 10 additions & 0 deletions packages/remix/package.json
@@ -0,0 +1,10 @@
{
"name": "remix",
"version": "0.0.0",
"peerDependencies": {
"history": ">=5",
"react": "0.0.0-experimental-33c3af284",
"react-dom": "0.0.0-experimental-33c3af284",
"react-router-dom": "0.0.0-experimental-ffd8c7d0"
}
}
19 changes: 19 additions & 0 deletions scripts/build.js
@@ -0,0 +1,19 @@
import { exec } from "./utils.js";

async function build() {
await exec("tsc -b");

await exec("mkdir -p build/@remix-run");

await Promise.all([
exec("cp -r .tsc-output/remix build/remix"),
exec("cp -r .tsc-output/@remix-run-core build/@remix-run/core"),
exec("cp -r .tsc-output/@remix-run-express build/@remix-run/express")
]);

return 0;
}

build().then(code => {
process.exit(code);
});
4 changes: 4 additions & 0 deletions scripts/utils.js
@@ -0,0 +1,4 @@
import childProcess from "child_process";
import util from "util";

export const exec = util.promisify(childProcess.exec);
6 changes: 6 additions & 0 deletions scripts/watch.js
@@ -0,0 +1,6 @@
import { spawn } from "child_process";

spawn("tsc", ["--watch"], {
env: process.env,
stdio: "inherit"
});
25 changes: 25 additions & 0 deletions tsconfig.json
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"target": "es2018",
"moduleResolution": "node",
"downlevelIteration": true,
"esModuleInterop": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"declaration": true,
"outDir": ".tsc-output",
"sourceMap": true,
"skipLibCheck": true,
"jsx": "react"
},
"files": [
"packages/@remix-run-core/index.tsx",
"packages/@remix-run-express/index.tsx",
"packages/remix/index.tsx"
],
"include": ["types/global.d.ts"]
}
2 changes: 2 additions & 0 deletions types/global.d.ts
@@ -0,0 +1,2 @@
// eslint-disable-next-line no-unused-vars
declare const __DEV__: boolean;

0 comments on commit 4f03dec

Please sign in to comment.