Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 5c4d631

Browse files
committed
chore: add template and new module
1 parent 2e3ce6c commit 5c4d631

File tree

8 files changed

+91
-0
lines changed

8 files changed

+91
-0
lines changed

.moon/templates/js-lib/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# {{ name }}

.moon/templates/js-lib/moon.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tasks:
2+
build:
3+
command: tsup src/index.ts
4+
inputs:
5+
- src/**/*
6+
- tsup.config.ts
7+
outputs:
8+
- dist/**/*
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@storipress/{{ name }}",
3+
"type": "module",
4+
"packageManager": "yarn@4.1.1",
5+
"exports": {
6+
".": {
7+
"types": "./dist/index.d.ts",
8+
"import": "./dist/index.js"
9+
}
10+
},
11+
"scripts": {
12+
"build": "moon run build"
13+
},
14+
"devDependencies": {
15+
"@moonrepo/cli": "1.23.4",
16+
"tsup": "8.0.2",
17+
"typescript": "^5.4.5",
18+
"vitest": "^1.5.0"
19+
}
20+
}

.moon/templates/js-lib/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('Hello world')

.moon/templates/js-lib/template.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://moonrepo.dev/docs/config/template
2+
$schema: 'https://moonrepo.dev/schemas/template.json'
3+
4+
# REQUIRED: Name of the template in a human readable format.
5+
title: JS Library
6+
7+
# REQUIRED: Description of what the template is for and other relevant information.
8+
description: Simple Javascript Library with Typescript
9+
10+
destination: packages/[name]
11+
12+
# Mapping of variables that will be interpolated and rendered within template files.
13+
# Users will be prompted to provide a value when running the generator.
14+
variables:
15+
name:
16+
type: string
17+
default: ''
18+
required: true
19+
prompt: Package name?

.moon/templates/js-lib/tsconfig.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compilerOptions": {
3+
/* AND if you're building for a library in a monorepo: */
4+
"target": "es2022",
5+
/* If your code runs in the DOM: */
6+
/* If your code doesn't run in the DOM: */
7+
"lib": ["es2022"],
8+
"moduleDetection": "force",
9+
/* If NOT transpiling with TypeScript: */
10+
"module": "preserve",
11+
"resolveJsonModule": true,
12+
"allowJs": true,
13+
/* Strictness */
14+
"strict": true,
15+
"noUncheckedIndexedAccess": true,
16+
/* AND if you're building for a library: */
17+
"declaration": true,
18+
"declarationMap": true,
19+
"noEmit": true,
20+
"outDir": "dist",
21+
"sourceMap": true,
22+
/* Base Options: */
23+
"esModuleInterop": true,
24+
"isolatedModules": true,
25+
"skipLibCheck": true
26+
},
27+
"include": ["src/**/*", "tsup.config.ts"]
28+
}

.moon/templates/js-lib/tsup.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'tsup'
2+
3+
export default defineConfig({
4+
entry: ['src/index.ts'],
5+
dts: true,
6+
clean: true,
7+
format: ['esm'],
8+
})

.moon/workspace.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ projects:
1818
custom-field: packages/custom-field
1919
jose-browser: packages/jose-browser
2020
karbon: packages/karbon
21+
karbon-utils: packages/karbon-utils
2122
playground: packages/playground
2223
typesense-xior: packages/typesense-xior
2324

@@ -33,3 +34,8 @@ vcs:
3334
# local branch against. For git, this is is typically "master" or "main",
3435
# and must include the remote prefix (before /).
3536
defaultBranch: main
37+
38+
generator:
39+
templates:
40+
- templates
41+
- .moon/templates

0 commit comments

Comments
 (0)