Skip to content

Commit

Permalink
🎉 Remove custom blitz compiler - all custom features now in core fram…
Browse files Browse the repository at this point in the history
…ework! (#2662)

(minor)
  • Loading branch information
flybayer authored Aug 24, 2021
1 parent 46b4088 commit 827bcf3
Show file tree
Hide file tree
Showing 144 changed files with 709 additions and 5,211 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ examples/auth2
db.sqlite-journal
test/integration/**/db.json
test/**/*/out
test/**/blitz-env.d.ts
examples/**/blitz-env.d.ts
.blitz**

14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,17 @@ Error: Failed to load parser './parser.js' declared in 'examples/auth/.eslintrc.
at Module.require (internal/modules/cjs/loader.js:887:19)
error Command failed with exit code 2.
```

##### Failed to compile - LICENSE

This error occurs sometimes when you import code from packages/next/build/utils.ts into some other code like config-shared.ts. Solution is to move the code into another file.

```
Failed to compile.
../../../packages/next/dist/compiled/webpack/LICENSE
Module parse failed: Unexpected token (1:10)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See webpack.js.org/concepts#loaders
> Copyright JS Foundation and other contributors
|
| Permission is hereby granted, free of charge, to any person obtaining
```
2 changes: 1 addition & 1 deletion examples/auth/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
"downlevelIteration": true,
"jsx": "preserve"
},
"exclude": ["node_modules", "cypress"],
"exclude": ["node_modules", "cypress", "test"],
"include": ["**/*.ts", "**/*.tsx"]
}
13 changes: 1 addition & 12 deletions examples/custom-server/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
module.exports = {
parser: "@typescript-eslint/parser",
env: {
es2020: true,
},
extends: ["react-app", "plugin:jsx-a11y/recommended"],
plugins: ["@typescript-eslint", "jsx-a11y"],
rules: {
"import/no-anonymous-default-export": "error",
"import/no-webpack-loader-syntax": "off",
"react/react-in-jsx-scope": "off", // React is always in scope with Blitz
"jsx-a11y/anchor-is-valid": "off", //Doesn't play well with Blitz/Next <Link> usage
},
extends: "blitz",
}
6 changes: 6 additions & 0 deletions examples/custom-server/blitz-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
2 changes: 1 addition & 1 deletion examples/custom-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
"tsBuildInfoFile": ".tsbuildinfo"
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
"include": ["blitz-env.d.ts", "**/*.ts", "**/*.tsx"]
}
2 changes: 1 addition & 1 deletion examples/fauna/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"jsx": "preserve"
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
"include": ["blitz-env.d.ts", "**/*.ts", "**/*.tsx"]
}
2 changes: 1 addition & 1 deletion examples/no-prisma/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"jsx": "preserve"
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
"include": ["blitz-env.d.ts", "**/*.ts", "**/*.tsx"]
}
2 changes: 1 addition & 1 deletion examples/static/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
"tsBuildInfoFile": ".tsbuildinfo"
},
"exclude": ["node_modules", "**/*.e2e.ts", "cypress"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
"include": ["blitz-env.d.ts", "**/*.ts", "**/*.tsx"]
}
2 changes: 1 addition & 1 deletion examples/store/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"jsx": "preserve"
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
"include": ["blitz-env.d.ts", "**/*.ts", "**/*.tsx"]
}
1 change: 1 addition & 0 deletions nextjs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ coverage
# test output
test/**/out*
test/**/next-env.d.ts
test/**/blitz-env.d.ts
.DS_Store
/e2e-tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"include": ["blitz-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
7 changes: 7 additions & 0 deletions nextjs/packages/next/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ import { writeBuildId } from './write-build-id'
import { normalizeLocalePath } from '../shared/lib/i18n/normalize-locale-path'
import { isWebpack5 } from 'next/dist/compiled/webpack/webpack'
import { NextConfigComplete } from '../server/config-shared'
import { saveRouteManifest } from './routes'

const staticCheckWorker = require.resolve('./utils')

Expand Down Expand Up @@ -177,6 +178,12 @@ export default async function build(
telemetry.record(events)
)

const routeManifestSpinner = createSpinner({
prefixText: `${Log.prefixes.info} Generating route manifest`,
})
await saveRouteManifest(pagesDir, config)
routeManifestSpinner?.stopAndPersist()

const ignoreTypeScriptErrors = Boolean(config.typescript?.ignoreBuildErrors)
const typeCheckStart = process.hrtime()
const typeCheckingSpinner = createSpinner({
Expand Down
Loading

0 comments on commit 827bcf3

Please sign in to comment.