Skip to content

Commit

Permalink
chore: add node-fetch (QwikDev#2457)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat authored Dec 17, 2022
1 parent 5542bb8 commit 519c048
Show file tree
Hide file tree
Showing 15 changed files with 107 additions and 15 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@types/express": "4.17.15",
"@types/mri": "1.1.1",
"@types/node": "^18.11.16",
"@types/node-fetch": "2.6.2",
"@types/path-browserify": "1.0.0",
"@types/prettier": "2.7.1",
"@types/prompts": "2.4.2",
Expand All @@ -89,6 +90,7 @@
"husky": "^8.0.0",
"monaco-editor": "^0.34.1",
"mri": "1.2.0",
"node-fetch": "3.3.0",
"ora": "6.1.2",
"path-browserify": "1.0.1",
"prettier": "2.8.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
"@builder.io/qwik-city": "0.0.128",
"@builder.io/sdk-qwik": "0.0.37",
"@docsearch/css": "3.3.0",
"@types/node-fetch": "2.6.2",
"@types/prismjs": "^1.26.0",
"algoliasearch": "4.14.2",
"autoprefixer": "10.4.13",
"fflate": "0.7.4",
"gray-matter": "4.0.3",
"node-fetch": "3.3.0",
"postcss": "8.4.20",
"prism-themes": "1.9.0",
"prismjs": "1.29.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/qwik-city/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
"vite": "4.0.1",
"yaml": "2.1.3"
},
"peerDependencies": {
"@builder.io/qwik": ">=0.16.0"
},
"license": "MIT",
"homepage": "https://qwik.builder.io/",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/qwik/src/core/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -941,10 +941,10 @@ export const useResource$: <T>(generatorFn: ResourceFn<T>, opts?: ResourceOption
// @public
export const useResourceQrl: <T>(qrl: QRL<ResourceFn<T>>, opts?: ResourceOptions) => ResourceReturn<T>;

// @public @deprecated
// @public
export const useServerMount$: <T>(first: MountFn<T>) => void;

// @public @deprecated
// @public
export const useServerMountQrl: <T>(mountQrl: QRL<MountFn<T>>) => void;

// @alpha (undocumented)
Expand Down
1 change: 0 additions & 1 deletion packages/qwik/src/core/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ useTask$(() => {

@see `useTask`
@public
@deprecated - use `useTask$()` with `isServer` instead. See https://qwik.builder.io/docs/components/lifecycle/#usemountserver

# `useClientMount`

Expand Down
4 changes: 0 additions & 4 deletions packages/qwik/src/core/use/use-mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export type MountFn<T> = () => ValueOrPromise<T>;
*
* @see `useTask`
* @public
* @deprecated - use `useTask$()` with `isServer` instead. See
* https://qwik.builder.io/docs/components/lifecycle/#usemountserver
*/
// </docs>
export const useServerMountQrl = <T>(mountQrl: QRL<MountFn<T>>): void => {
Expand Down Expand Up @@ -65,8 +63,6 @@ export const useServerMountQrl = <T>(mountQrl: QRL<MountFn<T>>): void => {
*
* @see `useTask`
* @public
* @deprecated - use `useTask$()` with `isServer` instead. See
* https://qwik.builder.io/docs/components/lifecycle/#usemountserver
*/
// </docs>
export const useServerMount$ = /*#__PURE__*/ implicit$FirstArg(useServerMountQrl);
Expand Down
12 changes: 6 additions & 6 deletions packages/qwik/src/core/use/use-watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ export interface UseTaskOptions {
* Use `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when
* those inputs change.
*
* The `taskFn` only executes if the observed inputs change. To observe the inputs, use the
* `obs` function to wrap property reads. This creates subscriptions that will trigger the
* `taskFn` to rerun.
* The `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs`
* function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to
* rerun.
*
* @see `Tracker`
*
Expand Down Expand Up @@ -288,9 +288,9 @@ export const useTaskQrl = (qrl: QRL<TaskFn>, opts?: UseTaskOptions): void => {
* Use `useTask` to observe changes on a set of inputs, and then re-execute the `taskFn` when
* those inputs change.
*
* The `taskFn` only executes if the observed inputs change. To observe the inputs, use the
* `obs` function to wrap property reads. This creates subscriptions that will trigger the
* `taskFn` to rerun.
* The `taskFn` only executes if the observed inputs change. To observe the inputs, use the `obs`
* function to wrap property reads. This creates subscriptions that will trigger the `taskFn` to
* rerun.
*
* @see `Tracker`
*
Expand Down
1 change: 1 addition & 0 deletions packages/qwik/src/optimizer/src/plugins/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
exclude: [
'@vite/client',
'@vite/env',
'node-fetch',
'undici',
QWIK_CORE_ID,
QWIK_JSX_RUNTIME_ID,
Expand Down
1 change: 1 addition & 0 deletions packages/qwik/src/optimizer/src/plugins/vite.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const includeDeps = undefined;
const excludeDeps = [
'@vite/client',
'@vite/env',
'node-fetch',
'undici',
'@builder.io/qwik',
'@builder.io/qwik/jsx-runtime',
Expand Down
79 changes: 79 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions scripts/create-qwik-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ async function updatePackageJson(config: BuildConfig, destDir: string) {
setVersionFromRoot('eslint');
setVersionFromRoot('prettier');
setVersionFromRoot('typescript');
setVersionFromRoot('node-fetch');
setVersionFromRoot('undici');
setVersionFromRoot('vite');

Expand Down
3 changes: 3 additions & 0 deletions scripts/package-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export async function generatePackageJson(config: BuildConfig) {
qwik: './qwik.cjs',
},
type: 'module',
dependencies: {
undici: '^5.14.0',
},
exports: {
'.': {
types: './core.d.ts',
Expand Down
5 changes: 3 additions & 2 deletions scripts/qwik-city.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ async function buildVite(config: BuildConfig, inputDir: string, outputDir: strin
'source-map',
'vfile',
'@mdx-js/mdx',
'node-fetch',
'undici',
'typescript',
];
Expand Down Expand Up @@ -475,7 +476,7 @@ async function buildMiddlewareNetlifyEdge(
async function buildMiddlewareNode(config: BuildConfig, inputDir: string, outputDir: string) {
const entryPoints = [join(inputDir, 'middleware', 'node', 'index.ts')];

const external = ['undici', 'path', ...MIDDLEWARE_EXTERNALS];
const external = ['node-fetch', 'undici', 'path', ...MIDDLEWARE_EXTERNALS];

await build({
entryPoints,
Expand Down Expand Up @@ -571,7 +572,7 @@ async function buildStaticDeno(config: BuildConfig, inputDir: string, outputDir:
async function buildStaticNode(config: BuildConfig, inputDir: string, outputDir: string) {
const entryPoints = [join(inputDir, 'static', 'node', 'index.ts')];

const external = ['fs', 'undici', 'os', 'path', 'url', 'worker_threads'];
const external = ['fs', 'node-fetch', 'undici', 'os', 'path', 'url', 'worker_threads'];

await build({
entryPoints,
Expand Down
2 changes: 2 additions & 0 deletions starters/apps/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
"@builder.io/qwik-city": "0.0.128",
"@types/eslint": "8.4.1",
"@types/node": "latest",
"@types/node-fetch": "latest",
"@typescript-eslint/eslint-plugin": "5.14.0",
"@typescript-eslint/parser": "5.14.0",
"eslint-plugin-qwik": "latest",
"eslint": "8.12.0",
"node-fetch": "latest",
"undici": "latest",
"prettier": "latest",
"typescript": "latest",
Expand Down
2 changes: 2 additions & 0 deletions starters/apps/library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
"@builder.io/qwik": "latest",
"@types/eslint": "8.4.1",
"@types/node": "latest",
"@types/node-fetch": "latest",
"@typescript-eslint/eslint-plugin": "5.14.0",
"@typescript-eslint/parser": "5.14.0",
"eslint-plugin-qwik": "latest",
"eslint": "8.12.0",
"node-fetch": "latest",
"undici": "latest",
"np": "7.6.1",
"prettier": "latest",
Expand Down

0 comments on commit 519c048

Please sign in to comment.