Skip to content

Commit

Permalink
Merge pull request #82 from lifeomic/separateBrowserFiles
Browse files Browse the repository at this point in the history
Separate browser files
  • Loading branch information
David Tanner authored Jul 4, 2023
2 parents d98827a + aaf7c5a commit c996129
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 23 deletions.
9 changes: 4 additions & 5 deletions esBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ void build({
outdir: 'src',
format: 'cjs',
entryPoints,
outExtension: {
'.js': '.cjs',
},
});

void build({
Expand All @@ -40,11 +37,13 @@ void build({

void build({
bundle: true,
platform: 'browser',
format: 'esm',
plugins: [
esbuildPluginBrowserslist(browserslist('defaults'), {
printUnknownTargets: false,
}),
],
outdir: 'src',
entryPoints,
outfile: 'src/browser.js',
entryPoints: ['src/index.ts'],
});
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "@lifeomic/abac",
"version": "0.0.0",
"description": "LifeOmic Attribute Based Access Control Support Module",
"main": "src/index.cjs",
"main": "src/index.js",
"types": "src/index.d.ts",
"browser": "browser/index.js",
"browser": "src/browser.js",
"module": "src/index.mjs",
"engines": {
"node": ">=16"
Expand All @@ -18,9 +18,9 @@
"types": "./src/index.d.ts",
"node": {
"import": "./src/index.mjs",
"require": "./src/index.cjs"
"require": "./src/index.js"
},
"browser": "./src/index.js"
"browser": "./src/browser.js"
}
},
"typesVersions": {
Expand All @@ -32,7 +32,6 @@
},
"files": [
"src/**/*.js",
"src/**/*.cjs",
"src/**/*.mjs",
"src/**/*.d.ts"
],
Expand Down Expand Up @@ -85,7 +84,6 @@
"ava": {
"timeout": "30s",
"files": [
"test/**/*.test.js",
"test/**/*.test.ts"
],
"require": [
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/Comparison.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export const Comparison = {
$schema: 'http://json-schema.org/draft-07/schema#',
definitions: {
ValidTargetString: {
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/OperationNames.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export const OperationNames = {
$schema: 'http://json-schema.org/draft-07/schema#',
$id: 'OperationNames',
title: 'OperationNames',
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/Policy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export const Policy = {
$schema: 'http://json-schema.org/draft-07/schema#',
$id: 'Policy',
title: 'Policy',
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/ReduceOptions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export const ReduceOptions = {
$schema: 'http://json-schema.org/draft-07/schema#',
$id: 'ReduceOptions',
title: 'ReduceOptions',
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/Rule.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export const Rule = {
$schema: 'http://json-schema.org/draft-07/schema#',
$id: 'Rule',
title: 'Rule',
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/Rules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
export const Rules = {
$schema: 'http://json-schema.org/draft-07/schema#',
$id: 'Rules',
title: 'Rules',
Expand Down
12 changes: 6 additions & 6 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { default as Comparison } from './Comparison';
export { default as Policy } from './Policy';
export { default as Rule } from './Rule';
export { default as Rules } from './Rules';
export { default as OperationNames } from './OperationNames';
export { default as ReduceOptions } from './ReduceOptions';
export { Comparison } from './Comparison';
export { Policy } from './Policy';
export { Rule } from './Rule';
export { Rules } from './Rules';
export { OperationNames } from './OperationNames';
export { ReduceOptions } from './ReduceOptions';

0 comments on commit c996129

Please sign in to comment.