Skip to content

Commit

Permalink
Add the blitz package (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
flybayer authored Apr 15, 2020
1 parent d956da6 commit 9e1ce7d
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/store/app/admin/pages/admin/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Link} from '@blitzjs/core'
import {Link} from 'blitz'

export default function () {
return (
Expand Down
2 changes: 1 addition & 1 deletion examples/store/app/admin/pages/admin/products/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Suspense} from 'react'
import {Link, useRouter, useQuery} from '@blitzjs/core'
import {Link, useRouter, useQuery} from 'blitz'
import getProduct from 'app/products/queries/getProduct'
import ProductForm from 'app/products/components/ProductForm'

Expand Down
2 changes: 1 addition & 1 deletion examples/store/app/admin/pages/admin/products/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Suspense} from 'react'
import {useQuery, Link} from '@blitzjs/core'
import {useQuery, Link} from 'blitz'
import getProducts from 'app/products/queries/getProducts'

function ProductsList() {
Expand Down
2 changes: 1 addition & 1 deletion examples/store/app/admin/pages/admin/products/new.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Link, useRouter} from '@blitzjs/core'
import {Link, useRouter} from 'blitz'
import ProductForm from 'app/products/components/ProductForm'

export default function () {
Expand Down
2 changes: 1 addition & 1 deletion examples/store/app/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head'
import {Link} from '@blitzjs/core'
import {Link} from 'blitz'

const Home = () => (
<div className="container">
Expand Down
2 changes: 1 addition & 1 deletion examples/store/app/products/pages/products/[handle].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Link, BlitzPage, GetStaticProps, GetStaticPaths} from '@blitzjs/core'
import {Link, BlitzPage, GetStaticProps, GetStaticPaths} from 'blitz'
import getProduct from 'app/products/queries/getProduct'
import getProducts from 'app/products/queries/getProducts'
import {Product} from 'db'
Expand Down
2 changes: 1 addition & 1 deletion examples/store/app/products/pages/products/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Link, BlitzPage, GetStaticProps} from '@blitzjs/core'
import {Link, BlitzPage, GetStaticProps} from 'blitz'
import getProducts from 'app/products/queries/getProducts'
import {Product} from 'db'

Expand Down
2 changes: 1 addition & 1 deletion examples/store/next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const {withBlitz} = require('@blitzjs/server')
const {withBlitz} = require('blitz')

module.exports = withBlitz({})
4 changes: 1 addition & 3 deletions examples/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"build": "blitz db migrate && blitz build"
},
"dependencies": {
"@blitzjs/cli": "0.0.2-canary.0",
"@blitzjs/core": "0.0.2-canary.0",
"@blitzjs/server": "0.0.2-canary.0",
"blitz": "0.0.2-canary.0",
"@prisma/cli": "2.0.0-beta.2",
"@prisma/client": "2.0.0-beta.2",
"final-form": "4.19.1",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"node": ">=12.16.1"
},
"scripts": {
"dev": "lerna run start --scope @blitzjs/* --stream --parallel",
"dev": "lerna run start --scope blitz --scope @blitzjs/* --stream --parallel",
"postinstall": "npm rebuild husky",
"build": "lerna run build --scope @blitzjs/* --stream",
"prepublishOnly": "lerna run build --scope @blitzjs/* && lerna run test --parallel",
"pretest": "lerna run build --scope @blitzjs/*",
"build": "lerna run build --scope blitz --scope @blitzjs/* --stream",
"prepublishOnly": "lerna run build --scope blitz --scope @blitzjs/* && lerna run test --parallel",
"pretest": "lerna run build --scope blitz --scope @blitzjs/*",
"test": "lerna run test --parallel"
},
"devDependencies": {
Expand Down
8 changes: 8 additions & 0 deletions packages/blitz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.log
.DS_Store
node_modules
.rts2_cache_cjs
.rts2_cache_esm
.rts2_cache_umd
.rts2_cache_system
dist
1 change: 1 addition & 0 deletions packages/blitz/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('@testing-library/jest-dom')
56 changes: 56 additions & 0 deletions packages/blitz/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "blitz",
"description": "Rails-like framework for monolithic, full-stack React apps without an API",
"version": "0.0.2-canary.0",
"license": "MIT",
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "tsdx test",
"test:watch": "tsdx test --watch",
"lint": "tsdx lint"
},
"author": {
"name": "Brandon Bayer",
"email": "[email protected]",
"url": "https://twitter.com/flybayer"
},
"main": "dist/index.js",
"module": "dist/core.esm.js",
"types": "dist/packages/blitz/src/index.d.ts",
"files": [
"dist"
],
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
}
},
"jest": {
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.js"
]
},
"engines": {
"yarn": "^1.19.1",
"node": ">=12.16.1"
},
"repository": {
"type": "git",
"url": "https://github.com/blitz-js/blitz"
},
"dependencies": {
"@blitzjs/cli": "0.0.2-canary.0",
"@blitzjs/core": "0.0.2-canary.0",
"@blitzjs/server": "0.0.2-canary.0"
},
"devDependencies": {
"@types/jest": "^25.1.3",
"@types/node": "^13.7.4",
"cross-env": "^7.0.0",
"husky": "^4.2.3",
"lint-staged": "^10.0.8",
"ts-jest": "24.3.0"
},
"gitHead": "6719104cb3e78948e7f06aa948ff72bbb84cb682"
}
2 changes: 2 additions & 0 deletions packages/blitz/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from '@blitzjs/core'
export {withBlitz} from '@blitzjs/server'
1 change: 1 addition & 0 deletions packages/blitz/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isServer = typeof window === 'undefined'
3 changes: 3 additions & 0 deletions packages/blitz/test/todo.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
it('todo', async () => {
expect(true).toBe(true)
})
13 changes: 13 additions & 0 deletions packages/blitz/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.json",
"include": ["src", "types", "test"],
"exclude": ["node_modules"],
"compilerOptions": {
"baseUrl": "./",
"declarationDir": "./dist",
"downlevelIteration": true,
"paths": {
"*": ["src/*", "node_modules/*"]
}
}
}
6 changes: 6 additions & 0 deletions packages/blitz/tsdx.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
rollup(config, options) {
config.external('@prisma/client')
return config
},
}
1 change: 1 addition & 0 deletions packages/blitz/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//

0 comments on commit 9e1ce7d

Please sign in to comment.