Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move top level modules into folders #526

Merged
merged 3 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ const validationCode = standaloneCode(ajv, validate)

const moduleCode = `/* CODE GENERATED BY '${path.basename(__filename)}' DO NOT EDIT! */\n${validationCode}`

fs.writeFileSync(path.join(__dirname, 'schema-validator.js'), moduleCode)
fs.writeFileSync(path.join(__dirname, '../lib/schema-validator.js'), moduleCode)
2 changes: 1 addition & 1 deletion example.js → examples/example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fastJson = require('.')
const fastJson = require('..')
Eomm marked this conversation as resolved.
Show resolved Hide resolved
const stringify = fastJson({
title: 'Example Schema',
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion server.js → examples/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const http = require('http')

const stringify = require('.')({
const stringify = require('fast-json-stringify')({
type: 'object',
properties: {
hello: {
Expand Down
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const merge = require('@fastify/deepmerge')()
const clone = require('rfdc')({ proto: true })
const { randomUUID } = require('crypto')

const validate = require('./schema-validator')
const Serializer = require('./serializer')
const Validator = require('./validator')
const RefResolver = require('./ref-resolver')
const validate = require('./lib/schema-validator')
const Serializer = require('./lib/serializer')
const Validator = require('./lib/validator')
const RefResolver = require('./lib/ref-resolver')

let largeArraySize = 2e4
let largeArrayMechanism = 'default'
Expand Down Expand Up @@ -151,7 +151,7 @@ function build (schema, options) {

if (options.mode === 'standalone') {
// lazy load
const buildStandaloneCode = require('./standalone')
const buildStandaloneCode = require('./lib/standalone')
return buildStandaloneCode(options, validator, contextFunctionCode)
}

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@
"schema-validator.js"
]
},
"runkitExampleFilename": "example.js"
"runkitExampleFilename": "./examples/example.js"
}
2 changes: 1 addition & 1 deletion test/debug-mode.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const test = require('tap').test
const fjs = require('..')

const Ajv = require('ajv').default
const Validator = require('../validator')
const Validator = require('../lib/validator')

function build (opts) {
return fjs({
Expand Down