Skip to content

Commit

Permalink
Create library @cowprotocol/cms (#12)
Browse files Browse the repository at this point in the history
* Add lib entry point

* Generate a new library

* Include required files

* Publish npm package

* Generate file using the local file

* Add prepublish step
  • Loading branch information
anxolin authored Apr 17, 2024
1 parent ddb37a7 commit 54e2518
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!README.md
!src/lib/README.md
!dist/**/*
31 changes: 19 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
{
"name": "cms",
"private": true,
"version": "0.1.0",
"description": "A Strapi application",
"name": "@cowprotocol/cms",
"version": "0.1.0-rc.0",
"description": "Cow Protocol CMS",
"main": "dist/lib.js",
"types": "dist/lib.d.ts",
"source": "src/lib.ts",
"exports": {
"require": "./dist/lib.js",
"default": "./dist/lib.js"
},
"license": "(MIT OR Apache-2.0)",
"scripts": {
"dev": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"build": "npm run types && npm run build:strapi && npm run build:lib",
"build:strapi": "npx tsc -p tsconfig.lib.json",
"build:lib": "npx tsc -p tsconfig.lib.json",
"strapi": "strapi",
"types": "npm run types:prod",
"types:local": "npx openapi-typescript http://localhost:1337/api/docs/openapi.json -o src/gen/types.ts",
"types:prod": "npx openapi-typescript https://cms.cow.fi/api/docs/openapi.json -o src/gen/types.ts"
"types": "npx openapi-typescript src/extensions/documentation/documentation/1.0.0/full_documentation.json -o src/gen/types.ts",
"prepublish": "npm run build"
},
"devDependencies": {},
"dependencies": {
"dependencies": {},
"devDependencies": {
"@strapi/plugin-documentation": "4.13.3",
"@strapi/plugin-i18n": "4.13.3",
"@strapi/plugin-users-permissions": "4.13.3",
Expand All @@ -31,6 +39,5 @@
"engines": {
"node": ">=16.0.0 <=20.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
}
}
1 change: 1 addition & 0 deletions src/lib.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./gen/types";
22 changes: 22 additions & 0 deletions tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"include": ["src/lib.ts", "src/gen/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
"outDir": "./dist",
"target": "es2016",
"module": "commonjs",
"lib": ["es2018", "dom"],
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noUnusedParameters": true,
"strictNullChecks": true
}
}

0 comments on commit 54e2518

Please sign in to comment.