Skip to content

Commit

Permalink
feat: initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvanhulle committed Nov 12, 2022
1 parent bdac6d9 commit ac580ea
Show file tree
Hide file tree
Showing 19 changed files with 168 additions and 78 deletions.
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"packages/demo": "2.1.0"
"packages/core": "1.0.0",
"packages/demo": "1.0.0"
}
28 changes: 0 additions & 28 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "template",
"version": "1.0.1",
"version": "1.0.0",
"private": true,
"description": "Monorepo template",
"repository": {
Expand Down
6 changes: 6 additions & 0 deletions packages/core/.ncurc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
// timeout of 3 minutes
timeout: '180000',
target: 'minor',
reject: [/@types/],
};
1 change: 1 addition & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Core
18 changes: 18 additions & 0 deletions packages/core/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { pathsToModuleNameMapper } = require('ts-jest');

const tsconfig = require('./tsconfig.json');

const baseConfig = require('../../jest.config.js');

const packageName = 'core';

module.exports = {
...baseConfig,
rootDir: '../..',
roots: [`<rootDir>/packages/${packageName}`],
displayName: packageName,
globals: {},
moduleNameMapper: {
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, { prefix: `<rootDir>/packages/${packageName}` }),
},
};
48 changes: 48 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "@stijnvanhulle/template-core",
"version": "1.0.0",
"description": "Core",
"repository": {
"type": "git",
"url": "git://github.com/stijnvanhulle/template.git",
"directory": "packages/core"
},
"license": "MIT",
"author": "Stijn Van Hulle <[email protected]",
"sideEffects": false,
"main": "dist/index.mjs",
"unpkg": "dist/index.global.js",
"module": "dist/index.js",
"browser": "build/index.global.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"start": "tsup --watch",
"release": "pnpm publish --no-git-check",
"prepack": "pnpm build",
"pre-commit": "echo 'pre-commit not configured'",
"pre-push": "pnpm typecheck",
"test": "jest --config ../../jest.config.js --runInBand --testPathPattern=packages/core/src",
"test:local": "jest --config ../../jest.config.js --testPathPattern=packages/core/src --maxWorkers=50%",
"test:watch": "jest --config ../../jest.config.js --testPathPattern=packages/core/src --maxWorkers=25% --watch",
"upgrade": "ncu -u",
"upgrade:local": "ncu --interactive --doctor",
"typecheck": "tsc -p ./tsconfig.json --noEmit"
},
"devDependencies": {
"tsup": "^6.4.0"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
5 changes: 5 additions & 0 deletions packages/core/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { core } from './index';

test('Core', () => {
expect(core).toBeDefined();
});
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const core = 'Core';
31 changes: 31 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"sourceMap": true,
"strictNullChecks": true,
"jsx": "react",
"declaration": true,
"outDir": "es",
"experimentalDecorators": true,
"skipLibCheck": true,
"baseUrl": ".",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowJs": true,
"typeRoots": [
"node_modules/@types",
"../../node_modules/@types"
],
"paths": {
}
},
"include": ["./src/**/*"],
"exclude": [
"**/node_modules",
"**/types/**",
"**/*.test.ts"
]
}
12 changes: 12 additions & 0 deletions packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'tsup';

export default defineConfig({
entry: ['src/index.ts'],
treeshake: true,
sourcemap: true,
minify: true,
splitting: false,
clean: true,
dts: true,
format: ['cjs', 'esm', 'iife'],
});
42 changes: 0 additions & 42 deletions packages/demo/CHANGELOG.md

This file was deleted.

5 changes: 3 additions & 2 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stijnvanhulle/demo",
"version": "2.1.0",
"name": "@stijnvanhulle/template-demo",
"version": "1.0.0",
"description": "Demo",
"repository": {
"type": "git",
Expand All @@ -26,6 +26,7 @@
],
"scripts": {
"build": "tsup",
"start": "tsup --watch",
"release": "pnpm publish --no-git-check",
"prepack": "pnpm build",
"pre-commit": "echo 'pre-commit not configured'",
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { helloWorld } from "./index";

test("Demo", () => {
expect(helloWorld).toBeDefined();
expect(helloWorld).toBe("Hello World Core!");
});
4 changes: 3 additions & 1 deletion packages/demo/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export const helloWorld = "Hello World!";
import { core } from "@stijnvanhulle/template-core";

export const helloWorld = `Hello World ${core}!`;
1 change: 1 addition & 0 deletions packages/demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"../../node_modules/@types"
],
"paths": {
"@stijnvanhulle/template-core": ["../core/src/index.ts"]
}
},
"include": ["./src/**/*"],
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

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

23 changes: 21 additions & 2 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"separate-pull-requests": true,
"separate-pull-requests": false,
"packages": {
"packages/core": {
"component": "@stijnvanhulle/template-core",
"changelog-path": "CHANGELOG.md",
"release-type": "node",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false
},
"packages/demo": {
"component": "@stijnvanhulle/template-demo",
"changelog-path": "CHANGELOG.md",
"release-type": "node",
"bump-minor-pre-major": false,
"bump-patch-for-minor-pre-major": false,
"draft": false,
"prerelease": false
}
}
},
"plugins": [
{
"type": "linked-versions",
"group-name": "@stijnvanhulle",
"components": [
"@code-regenerator/template-core", "@code-regenerator/template/template-demo"
]
}
]
}
8 changes: 8 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"dist/**"
]
},
"start": {
"dependsOn": [
"^start"
],
"outputs": [

]
},
"test": {
"dependsOn": [],
"outputs": [
Expand Down

0 comments on commit ac580ea

Please sign in to comment.