Skip to content

Commit

Permalink
fix: create shared directory (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas authored Sep 14, 2022
1 parent 8fabd91 commit 9a21c18
Show file tree
Hide file tree
Showing 36 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion deno/lib/stage2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { build, LoadResponse } from 'https://deno.land/x/[email protected]/mod.ts'

import * as path from 'https://deno.land/[email protected]/path/mod.ts'

import type { InputFunction, WriteStage2Options } from '../../src/stage2.ts'
import type { InputFunction, WriteStage2Options } from '../../shared/stage2.ts'
import { PUBLIC_SPECIFIER, STAGE2_SPECIFIER, virtualRoot } from './consts.ts'
import { inlineModule, loadFromVirtualRoot, loadWithRetry } from './common.ts'

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 src/formats/eszip.ts → node/formats/eszip.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { join, resolve } from 'path'
import { fileURLToPath } from 'url'

import type { WriteStage2Options } from '../../shared/stage2.js'
import { DenoBridge } from '../bridge.js'
import type { Bundle } from '../bundle.js'
import { wrapBundleError } from '../bundle_error.js'
import { EdgeFunction } from '../edge_function.js'
import { ImportMap } from '../import_map.js'
import type { WriteStage2Options } from '../stage2.js'
import { getFileHash } from '../utils/sha256.js'

interface BundleESZIPOptions {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
"version": "2.0.1",
"description": "Intelligently prepare Netlify Edge Functions for deployment",
"type": "module",
"main": "./dist/index.js",
"exports": "./dist/index.js",
"main": "./dist/node/index.js",
"exports": "./dist/node/index.js",
"files": [
"deno/**",
"dist/**/*.js",
"dist/**/*.d.ts"
"dist/**/*.d.ts",
"shared/**"
],
"scripts": {
"build": "tsc",
Expand All @@ -30,8 +31,8 @@
"test:ci:ava": "nyc -r lcovonly -r text -r json ava"
},
"config": {
"eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{src,scripts,.github}/**/*.{js,ts,md,html}\" \"*.{js,ts,md,html}\"",
"prettier": "--ignore-path .gitignore --loglevel=warn \"{src,scripts,.github}/**/*.{js,ts,md,yml,json,html}\" \"*.{js,ts,yml,json,html}\" \".*.{js,ts,yml,json,html}\" \"!**/package-lock.json\" \"!package-lock.json\""
"eslint": "--ignore-path .gitignore --cache --format=codeframe --max-warnings=0 \"{node,scripts,.github}/**/*.{js,ts,md,html}\" \"*.{js,ts,md,html}\"",
"prettier": "--ignore-path .gitignore --loglevel=warn \"{node,scripts,.github}/**/*.{js,ts,md,yml,json,html}\" \"*.{js,ts,yml,json,html}\" \".*.{js,ts,yml,json,html}\" \"!**/package-lock.json\" \"!package-lock.json\""
},
"ava": {
"files": [
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { env } from 'process'
import test from 'ava'
import fetch, { Headers } from 'node-fetch'

import { getBootstrapURL } from '../src/formats/javascript.js'
import { getBootstrapURL } from '../node/formats/javascript.js'

test.serial('Imports the bootstrap layer from a valid URL', async (t) => {
const importURL = new URL(getBootstrapURL())
Expand Down
4 changes: 2 additions & 2 deletions test/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import nock from 'nock'
import { spy } from 'sinon'
import tmp, { DirectoryResult } from 'tmp-promise'

import { DenoBridge } from '../src/bridge.js'
import { getPlatformTarget } from '../src/platform.js'
import { DenoBridge } from '../node/bridge.js'
import { getPlatformTarget } from '../node/platform.js'

const require = createRequire(import.meta.url)
const archiver = require('archiver')
Expand Down
4 changes: 2 additions & 2 deletions test/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { fileURLToPath, pathToFileURL } from 'url'
import test from 'ava'
import tmp from 'tmp-promise'

import { BundleError } from '../src/bundle_error.js'
import { bundle, BundleOptions } from '../src/bundler.js'
import { BundleError } from '../node/bundle_error.js'
import { bundle, BundleOptions } from '../node/bundler.js'

const url = new URL(import.meta.url)
const dirname = fileURLToPath(url)
Expand Down
9 changes: 4 additions & 5 deletions test/downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import { execa } from 'execa'
import nock from 'nock'
import tmp from 'tmp-promise'

import { download } from '../src/downloader.js'
import { getLogger } from '../src/logger.js'
import { getPlatformTarget } from '../src/platform.js'
import { download } from '../node/downloader.js'
import { getLogger } from '../node/logger.js'
import { getPlatformTarget } from '../node/platform.js'

const testLogger = getLogger(() => {
})
const testLogger = getLogger(() => {})

const streamError = () => {
const stream = new PassThrough()
Expand Down
2 changes: 1 addition & 1 deletion test/import_map.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from 'ava'

import { ImportMap } from '../src/import_map.js'
import { ImportMap } from '../node/import_map.js'

test('Handles import maps with full URLs without specifying a base URL', (t) => {
const inputFile1 = {
Expand Down
2 changes: 1 addition & 1 deletion test/logger.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import test from 'ava'
import { stub } from 'sinon'

import { getLogger } from '../src/logger.js'
import { getLogger } from '../node/logger.js'

const consoleLog = console.log

Expand Down
4 changes: 2 additions & 2 deletions test/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import nock from 'nock'
import { spy } from 'sinon'
import tmp from 'tmp-promise'

import { DenoBridge } from '../src/bridge.js'
import { getPlatformTarget } from '../src/platform.js'
import { DenoBridge } from '../node/bridge.js'
import { getPlatformTarget } from '../node/platform.js'

const require = createRequire(import.meta.url)
const archiver = require('archiver')
Expand Down
2 changes: 1 addition & 1 deletion test/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { env } from 'process'

import test from 'ava'

import { generateManifest } from '../src/manifest.js'
import { generateManifest } from '../node/manifest.js'

test('Generates a manifest with different bundles', (t) => {
const bundle1 = {
Expand Down
6 changes: 3 additions & 3 deletions test/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import nock from 'nock'
import { stub } from 'sinon'
import tmp from 'tmp-promise'

import { DenoBridge } from '../src/bridge.js'
import { getLogger } from '../src/logger.js'
import { ensureLatestTypes } from '../src/types.js'
import { DenoBridge } from '../node/bridge.js'
import { getLogger } from '../node/logger.js'
import { ensureLatestTypes } from '../node/types.js'

const testLogger = getLogger(() => {
// no-op
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@
"skipLibCheck": true /* Skip type checking of declaration files. */,
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
},
"include": ["src"]
"include": ["node", "shared"]
}

0 comments on commit 9a21c18

Please sign in to comment.