Skip to content

Commit 64683fd

Browse files
Merge pull request #19 from mig8447/prepare-for-npm-package-publishing
fix: prepare package for publishing
2 parents e42dc20 + a44ff7d commit 64683fd

9 files changed

+73
-55
lines changed

CONTRIBUTING.md

+35
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,41 @@ git commit --signoff
3131
Only pull requests from committers that can be verified as having signed the OCA
3232
can be accepted.
3333

34+
## Getting Started
35+
36+
1. Open a terminal window
37+
2. Clone the repository
38+
3. Change into the cloned repository directory
39+
4. Install dependencies by running
40+
41+
```bash
42+
npm install
43+
```
44+
45+
## Building Locally
46+
47+
Once you have set up the project, you can build the library by executing:
48+
49+
```bash
50+
npm run build
51+
```
52+
53+
## Running Tests
54+
55+
Once you have set up the project, you can run the test suite by executing:
56+
57+
```bash
58+
npm run test
59+
```
60+
61+
## Running the Example CLI
62+
63+
Once you have built the library, you can run the example CLI by executing:
64+
65+
```bash
66+
npm run example-cli -- ./test/department_employees.quicksql
67+
```
68+
3469
## Pull request process
3570

3671
1. Ensure there is an issue created to track and discuss the fix or enhancement

README.md

+9-41
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
## Table of Contents <!-- omit in toc -->
66

77
- [Overview](#overview)
8-
- [Installation](#installation)
9-
- [Building Locally](#building-locally)
10-
- [Running Tests](#running-tests)
11-
- [Running the Example CLI](#running-the-example-cli)
8+
- [Install](#install)
129
- [Translating Quick SQL into Oracle SQL Data Definition Language (DDL)](#translating-quick-sql-into-oracle-sql-data-definition-language-ddl)
1310
- [DDL NodeJS ECMA Script Module (ESM) Example](#ddl-nodejs-ecma-script-module-esm-example)
1411
- [DDL NodeJS Common JS (CJS) Example](#ddl-nodejs-common-js-cjs-example)
@@ -36,39 +33,10 @@ module that can be used as seen in the example below:
3633

3734
![Quick ERD](./assets/quick-erd-dark.png)
3835

39-
## Installation
40-
41-
1. Open a terminal window
42-
2. Clone the repository
43-
3. Change into the cloned repository directory
44-
4. Install dependencies by running
45-
46-
```bash
47-
npm install
48-
```
49-
50-
## Building Locally
51-
52-
Once you have set up the project, you can build the library by executing:
36+
## Install
5337

5438
```bash
55-
npm run build
56-
```
57-
58-
## Running Tests
59-
60-
Once you have set up the project, you can run the test suite by executing:
61-
62-
```bash
63-
npm run test
64-
```
65-
66-
## Running the Example CLI
67-
68-
Once you have built the library, you can run the example CLI by executing:
69-
70-
```bash
71-
npm run example-cli -- ./test/department_employees.quicksql
39+
npm install @oracle/quicksql
7240
```
7341

7442
## Translating Quick SQL into Oracle SQL Data Definition Language (DDL)
@@ -83,12 +51,12 @@ See below for examples of how to use this library.
8351
### DDL NodeJS ECMA Script Module (ESM) Example
8452

8553
```js
86-
import quickSQL from "./dist/quick-sql.js";
54+
import { toDDL } from "@oracle/quicksql";
8755
import fs from "fs";
8856

8957
try {
9058
const text = fs.readFileSync( './test/department_employees.quicksql' );
91-
console.log( quickSQL.toDDL( text.toString() ) );
59+
console.log( toDDL( text.toString() ) );
9260
} catch( e ) {
9361
console.error( e );
9462
};
@@ -97,12 +65,12 @@ try {
9765
### DDL NodeJS Common JS (CJS) Example
9866

9967
```js
100-
const quickSQL = require( "./dist/quick-sql.umd.cjs" );
68+
const { toDDL } = require( "@oracle/quicksql" );
10169
const fs = require( "fs" );
10270

10371
try {
10472
const text = fs.readFileSync( './test/department_employees.quicksql' );
105-
console.log( quickSQL.toDDL( text.toString() ) );
73+
console.log( toDDL( text.toString() ) );
10674
} catch( e ) {
10775
console.error( e );
10876
};
@@ -112,8 +80,8 @@ try {
11280

11381
```html
11482
<script type="module">
115-
import quickSQL from './dist/quick-sql.js';
116-
document.body.innerText = quickSQL.toDDL(
83+
import { toDDL } from './dist/quick-sql.js';
84+
document.body.innerText = toDDL(
11785
`departments /insert 2
11886
name /nn
11987
location

dist/quick-erd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ class de {
739739
e.rearrangeDiagram(3, !1), this.paperScroller.centerContent();
740740
}
741741
}
742-
const ue = "1.1.3", fe = {
742+
const ue = "1.1.4", fe = {
743743
Diagram: de,
744744
version: ue
745745
};

dist/quick-erd.umd.cjs

+1-1
Large diffs are not rendered by default.

dist/quick-sql.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8992,7 +8992,7 @@ const Y = {
89928992
};
89938993
return Object.defineProperty(D, "version", {
89948994
writable: !1,
8995-
value: "1.1.3"
8995+
value: "1.1.4"
89968996
}), D;
89978997
}(), be = X.toDDL, pe = X.toERD, ge = X.toQSQL, Ce = X.errors, ve = X.version;
89988998
export {

dist/quick-sql.umd.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,4 +264,4 @@ dv `+D+"_dv "+D,A+=`
264264
Non-default options:
265265
# settings = `+JSON.stringify(this.nonDefaultOptions())+`
266266
`,S+=`
267-
*/`,this.appliedOptions=JSON.parse(JSON.stringify(this.options)),this.resetOptions(),S},this.errors=function(y,p){this.toDDL(y,p),this.options=JSON.parse(JSON.stringify(this.appliedOptions));const S=be.findErrors(this,y);return this.appliedOptions=JSON.parse(JSON.stringify(this.options)),this.resetOptions(),S},this.toQSQL=function(y){const p=JSON.parse(y);return me.introspect(null,p,0)},this.descendants=function(){for(var y=[],p=0;p<this.forest.length;p++)y=y.concat(this.forest[p].descendants());return y},this.additionalColumns=function(){var y=[],p=this.getOptionValue("Auxiliary Columns");if(p==null)return y;for(var S=p.split(","),T=0;T<S.length;T++){var A=S[T].trim(),k="VARCHAR2(4000)",b=A.indexOf(" ");0<b&&(k=A.substring(b+1).toUpperCase(),A=A.substring(0,b)),y[A]=k}return y},this.objPrefix=function(y){var p=this.getOptionValue("schema");p==null&&(p=""),p!=""&&y==null?p=p+".":p="";var S="";return this.getOptionValue("prefix")!=null&&(S=this.getOptionValue("prefix")),p=p+S,S!=""&&(p=p+"_"),p.toLowerCase()}}const f=new m;let D={toDDL:f.toDDL.bind(f),toERD:f.toERD.bind(f),toQSQL:f.toQSQL.bind(f),errorMsgs:f.errors.bind(f)};return Object.defineProperty(D,"version",{writable:!1,value:"1.1.3"}),D}(),pe=X.toDDL,ge=X.toERD,Ce=X.toQSQL,ve=X.errors,Ae=X.version;K.default=X,K.errors=ve,K.toDDL=pe,K.toERD=ge,K.toQSQL=Ce,K.version=Ae,Object.defineProperties(K,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
267+
*/`,this.appliedOptions=JSON.parse(JSON.stringify(this.options)),this.resetOptions(),S},this.errors=function(y,p){this.toDDL(y,p),this.options=JSON.parse(JSON.stringify(this.appliedOptions));const S=be.findErrors(this,y);return this.appliedOptions=JSON.parse(JSON.stringify(this.options)),this.resetOptions(),S},this.toQSQL=function(y){const p=JSON.parse(y);return me.introspect(null,p,0)},this.descendants=function(){for(var y=[],p=0;p<this.forest.length;p++)y=y.concat(this.forest[p].descendants());return y},this.additionalColumns=function(){var y=[],p=this.getOptionValue("Auxiliary Columns");if(p==null)return y;for(var S=p.split(","),T=0;T<S.length;T++){var A=S[T].trim(),k="VARCHAR2(4000)",b=A.indexOf(" ");0<b&&(k=A.substring(b+1).toUpperCase(),A=A.substring(0,b)),y[A]=k}return y},this.objPrefix=function(y){var p=this.getOptionValue("schema");p==null&&(p=""),p!=""&&y==null?p=p+".":p="";var S="";return this.getOptionValue("prefix")!=null&&(S=this.getOptionValue("prefix")),p=p+S,S!=""&&(p=p+"_"),p.toLowerCase()}}const f=new m;let D={toDDL:f.toDDL.bind(f),toERD:f.toERD.bind(f),toQSQL:f.toQSQL.bind(f),errorMsgs:f.errors.bind(f)};return Object.defineProperty(D,"version",{writable:!1,value:"1.1.4"}),D}(),pe=X.toDDL,ge=X.toERD,Ce=X.toQSQL,ve=X.errors,Ae=X.version;K.default=X,K.errors=ve,K.toDDL=pe,K.toERD=ge,K.toQSQL=Ce,K.version=Ae,Object.defineProperties(K,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});

examples/cli.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env node
22

33
/**
4-
* Reads QuickSQL input from a file in the filesystem and outputs the translated
4+
* Reads Quick SQL input from a file in the filesystem and outputs the generated
55
* DDL to console
66
*
77
* Execution:
88
*
99
* ```sh
10-
* ./translate.js <FILE_PATH>
10+
* ./cli.js <FILE_PATH>
1111
* ```
1212
*/
1313

@@ -18,7 +18,7 @@ import quicksql from '../dist/quick-sql.js';
1818
function print_usage() {
1919
console.log(
2020
/* eslint-disable indent */
21-
`QuickSQL ${ quicksql.version } Translation Example
21+
`Quick SQL ${ quicksql.version } DDL Generation Example
2222
2323
Usage: ./cli.js <FILE_PATH>
2424
Example: ./cli.js ../test/project_management.quicksql

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
{
22
"name": "@oracle/quicksql",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Quick SQL to DDL and ERD translator",
5-
"main": "src/index.js",
5+
"main": "./dist/quick-sql.umd.cjs",
6+
"module": "./dist/quick-sql.js",
67
"type": "module",
8+
"exports": {
9+
".": {
10+
"import": "./dist/quick-sql.js",
11+
"require": "./dist/quick-sql.umd.cjs"
12+
},
13+
"./erd": {
14+
"import": "./dist/quick-erd.js",
15+
"require": "./dist/quick-erd.umd.cjs"
16+
}
17+
},
718
"engines": {
8-
"node": ">=14"
19+
"node": ">=16"
920
},
1021
"config": {
1122
"ddlLibraryName": "quickSQL",
@@ -21,7 +32,7 @@
2132
"test": "./test/regression_test.js",
2233
"lint:markdown": "markdownlint-cli2 *.md, doc/**/*.md",
2334
"lint": "run-p lint:*",
24-
"example-cli": "./examples/cli.js ./test/project_management.quicksql",
35+
"example-cli": "./examples/cli.js",
2536
"postversion": "run-s build"
2637
},
2738
"repository": {
@@ -37,12 +48,16 @@
3748
"Diagram"
3849
],
3950
"files": [
40-
"src/*.js"
51+
"assets",
52+
"!(CONTRIBUTING).md",
53+
"doc/user",
54+
"dist"
4155
],
4256
"license": "UPL-1.0",
4357
"dependencies": {
4458
"chance": "^1.1.11"
4559
},
60+
"bundledDependencies": true,
4661
"devDependencies": {
4762
"eslint": "^8.42.0",
4863
"markdownlint-cli2": "^0.10.0",

0 commit comments

Comments
 (0)