Skip to content

Commit

Permalink
build: build both fetch-mock and core simultaneously
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Jul 24, 2024
1 parent db8129d commit f47a4a2
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 133 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"types:check": "tsc --project ./jsconfig.json",
"types:lint": "dtslint --expectOnly packages/fetch-mock/types",
"prepare": "husky || echo \"husky not available\"",
"build": "rollup -c",
"build": "npm run build -w=packages/fetch-mock -w=packages/core",
"docs": "npm run start -w docs",
"test:ci": "vitest .",
"test:legacy": "vitest ./packages/fetch-mock/test/specs",
Expand Down
91 changes: 0 additions & 91 deletions packages/ARCHITECTURE.md

This file was deleted.

14 changes: 10 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
{
"name": "@fetch-mock/core",
"description": "Utility for creating mock fetch implementation",
"exports": "src/index.js",
"version": "0.4.0",
"main": "index.js",
"types": "types/index.d.ts",
"main": "./dist/commonjs.js",
"module": "./src/index.js",
"exports": {
"types": "./types/index.d.ts",
"browser": "./src/index.js",
"import": "./src/index.js",
"require": "./dist/commonjs.js"
},
"types": "./types/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "rollup -c"
},
"repository": {
"type": "git",
Expand Down
18 changes: 18 additions & 0 deletions packages/core/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { writeFile, mkdir } from 'fs/promises';
export default {
input: './src/index.js',
output: {
dir: './dist',
entryFileNames: 'commonjs.js',
format: 'commonjs',
},
plugins: [
nodeResolve({ preferBuiltins: false }),
commonjs(),
// sourcemaps(),
// builtins(),
// globals(),
],
};
4 changes: 2 additions & 2 deletions packages/core/src/Route.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@type-check
import { builtInMatchers } from './Matchers';
import statusTextMap from './StatusTextMap';
import { builtInMatchers } from './Matchers.js';
import statusTextMap from './StatusTextMap.js';

/** @typedef {import('./Matchers').RouteMatcher} RouteMatcher */
/** @typedef {import('./CallHistory').CallLog} CallLog */
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type": "module"}
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/fetch-mock/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"require": "./dist/commonjs.js"
},
"types": "./types/index.d.ts",
"scripts": {
"build": "rollup -c"
},
"repository": {
"type": "git",
"url": "git+https://github.com/wheresrhys/fetch-mock.git",
Expand Down
18 changes: 18 additions & 0 deletions packages/fetch-mock/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import { writeFile, mkdir } from 'fs/promises';
export default {
input: './src/index.js',
output: {
dir: './dist',
entryFileNames: 'commonjs.js',
format: 'commonjs',
},
plugins: [
nodeResolve({ preferBuiltins: false }),
commonjs(),
// sourcemaps(),
// builtins(),
// globals(),
],
};
35 changes: 0 additions & 35 deletions rollup.config.js

This file was deleted.

0 comments on commit f47a4a2

Please sign in to comment.