mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 14:25:17 +00:00
Changed build scripts for examples and main project
This commit is contained in:
@@ -10,7 +10,7 @@ $ git clone https://github.com/alexandercerutti/passkit-generator.git;
|
||||
$ cd passkit-generator && npm install;
|
||||
$ cd examples && npm install;
|
||||
$ npm run build;
|
||||
$ node <the-example-you-want-to-execute>.js
|
||||
$ npm run example <the-example-you-want-to-execute>.js
|
||||
```
|
||||
|
||||
Certificates paths in examples are linked to a folder `certificates` in the root of this project which is not provided.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import genRoute, { app } from "./webserver";
|
||||
import { createPass, createAbstractModel, AbstractModel } from "..";
|
||||
import { createPass, createAbstractModel, AbstractModel } from "passkit-generator";
|
||||
|
||||
let abstractModel: AbstractModel;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import app from "./webserver";
|
||||
import fetch from "node-fetch";
|
||||
import { createPass } from "..";
|
||||
import { createPass } from "passkit-generator";
|
||||
|
||||
app.all(async function manageRequest(request, response) {
|
||||
let passName = request.params.modelName + "_" + (new Date()).toISOString().split('T')[0].replace(/-/ig, "");
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import app from "./webserver";
|
||||
import { createPass } from "..";
|
||||
import { createPass } from "passkit-generator";
|
||||
|
||||
app.all(async function manageRequest(request, response) {
|
||||
const passName = request.params.modelName + "_" + (new Date()).toISOString().split('T')[0].replace(/-/ig, "");
|
||||
@@ -45,6 +45,7 @@ app.all(async function manageRequest(request, response) {
|
||||
format: "PKBarcodeFormatPDF417"
|
||||
}, {
|
||||
message: "Thank you for using this package <3",
|
||||
// @ts-expect-error
|
||||
format: "PKBarcodeFormatMock44617"
|
||||
});
|
||||
}
|
||||
@@ -65,7 +66,7 @@ app.all(async function manageRequest(request, response) {
|
||||
});
|
||||
|
||||
stream.pipe(response);
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
|
||||
response.set({
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import app from "./webserver";
|
||||
import { createPass } from "..";
|
||||
import { createPass } from "passkit-generator";
|
||||
|
||||
app.all(async function manageRequest(request, response) {
|
||||
if (!request.query.fn) {
|
||||
@@ -51,7 +51,7 @@ app.all(async function manageRequest(request, response) {
|
||||
});
|
||||
|
||||
stream.pipe(response);
|
||||
} catch(err) {
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
|
||||
response.set({
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
import app from "./webserver";
|
||||
import { createPass } from "..";
|
||||
import { createPass } from "passkit-generator";
|
||||
|
||||
app.all(async function manageRequest(request, response) {
|
||||
let passName = "exampleBooking" + "_" + (new Date()).toISOString().split('T')[0].replace(/-/ig, "");
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import app from "./webserver";
|
||||
import { createPass } from "..";
|
||||
import { createPass } from "passkit-generator";
|
||||
|
||||
app.all(async function manageRequest(request, response) {
|
||||
const passName = request.params.modelName + "_" + (new Date()).toISOString().split('T')[0].replace(/-/ig, "");
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
"author": "Alexander P. Cerutti <cerutti.alexander@gmail.com>",
|
||||
"license": "ISC",
|
||||
"scripts": {
|
||||
"build": "cd ..; npm run build; cd examples"
|
||||
"preinstall": "npm run clear:deps && npm unlink --no-save passkit-generator && cd .. && npm run build && npm link && cd examples && npm link passkit-generator",
|
||||
"example": "cd build && node",
|
||||
"build": "npm run build:clear && npx tsc",
|
||||
"build:clear": "rm -rf build",
|
||||
"clear:deps": "rm -rf node_modules"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.17.1",
|
||||
|
||||
9
examples/tsconfig.json
Normal file
9
examples/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "build"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
11
package.json
11
package.json
@@ -2,11 +2,16 @@
|
||||
"name": "passkit-generator",
|
||||
"version": "2.0.5",
|
||||
"description": "The easiest way to generate custom Apple Wallet passes in Node.js",
|
||||
"main": "index.js",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build": "npx tsc",
|
||||
"build": "npm run build:src",
|
||||
"build:all": "npm run build:src && npm run build:examples && npm run build:spec",
|
||||
"build:src": "rm -rf ./lib && npx tsc -p tsconfig.dist.json",
|
||||
"build:examples": "cd examples && npm run build",
|
||||
"build:spec": "rm -rf ./spec/*.js && npx tsc",
|
||||
"prepublishOnly": "npm run build",
|
||||
"test": "npm run build && jasmine spec/index.js"
|
||||
"test": "npm run build:spec && npm run build:src && jasmine spec/index.js",
|
||||
"example": "npm run build:src && npm --prefix examples run example"
|
||||
},
|
||||
"author": "Alexander Patrick Cerutti",
|
||||
"license": "MIT",
|
||||
|
||||
9
tsconfig.dist.json
Normal file
9
tsconfig.dist.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user