Skip to content

Commit

Permalink
move our packages to use "@malloy-lang" scope (which we own on npm) (#87
Browse files Browse the repository at this point in the history
)

There is a concern that perhaps someone would think we have published npm packages (we have not) and if some nefarious actor grabs a package on npm with a name we're using, some other developer might intend to install a malloy package and accidentally install the bad package.

This change resolves that concern by scoping the packages to @malloy-lang/{package-name} - an organization name in npm that we own - with the exception of the VScode extension. VSCode extensions have chosen (possibly poorly?) to utilize package.json as the manifest file for an extension - but they do not support all possible values for the name property and as such do not support scoped names.

While it is not intended to be installed via npm, we have reserved the malloy-vscode name on npm by publishing the vs-code package to it.

Co-authored-by: Christopher Swenson <crswenson@google.com>
  • Loading branch information
bporterfield and Christopher Swenson authored Nov 1, 2021
1 parent 41a6d20 commit aeeb23e
Show file tree
Hide file tree
Showing 47 changed files with 108 additions and 77 deletions.
4 changes: 2 additions & 2 deletions docs/_scripts/build_docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

import path from "path";
import fs from "fs";
import { Malloy } from "malloy";
import { BigQueryConnection } from "malloy-db-bigquery";
import { Malloy } from "@malloy-lang/malloy";
import { BigQueryConnection } from "@malloy-lang/malloy-db-bigquery";
import { performance } from "perf_hooks";
import { renderDoc } from "./render_document";
import { renderFooter, renderSidebar, Section } from "./page";
Expand Down
4 changes: 2 additions & 2 deletions docs/_scripts/build_docs/render_document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import "prismjs/components/prism-json";
import "prismjs/components/prism-sql";
import { runCode } from "./run_code";
import { log } from "./log";
import { Malloy } from "malloy";
import { BigQueryConnection } from "malloy-db-bigquery";
import { Malloy } from "@malloy-lang/malloy";
import { BigQueryConnection } from "@malloy-lang/malloy-db-bigquery";

Malloy.db = new BigQueryConnection("docs");

Expand Down
4 changes: 2 additions & 2 deletions docs/_scripts/build_docs/run_code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* that depend on that model. If `--watch` is enabled, changes to a model file
* will cause relevant documents to recompile.
*/
import { DataStyles, DataTreeRoot, HtmlView } from "malloy-render";
import { Malloy, MalloyTranslator } from "malloy";
import { DataStyles, DataTreeRoot, HtmlView } from "@malloy-lang/malloy-render";
import { Malloy, MalloyTranslator } from "@malloy-lang/malloy";
import path from "path";
import fs from "fs";
import { performance } from "perf_hooks";
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"version": "0.0.1",
"license": "GPL-2.0",
"name": "@looker-open-source/malloy",
"name": "@malloy-lang/malloy",
"workspaces": {
"packages": [
"packages/*"
Expand All @@ -15,8 +15,8 @@
"samples"
],
"scripts": {
"clean": "yarn workspace malloy clean && yarn tsc --build --clean",
"build": "yarn workspace malloy build-parser && yarn tsc --build",
"clean": "yarn workspace @malloy-lang/malloy clean && yarn tsc --build --clean",
"build": "yarn workspace @malloy-lang/malloy build-parser && yarn tsc --build",
"lint": "yarn eslint '**/*.ts{,x}'",
"test": "yarn lint && yarn build && yarn workspaces run test",
"test-fast": "yarn workspaces run test",
Expand All @@ -26,7 +26,7 @@
"docs-preprocess": "ts-node docs/_scripts/build_docs/index.ts --watch",
"docs-postprocess": "yarn wait-on ./docs/_includes/generated/toc.html && cd docs && bundle exec jekyll serve -l -o",
"docs-serve": "yarn docs-prebuild && yarn concurrently --kill-others 'yarn docs-preprocess' 'yarn docs-postprocess'",
"vscode-webpack-dev": "yarn workspace malloy-vscode webpack-dev",
"vscode-webpack-dev": "yarn workspace @malloy-lang/malloy-vscode webpack-dev",
"third-party-licenses": "ts-node scripts/third_party_licenses"
},
"resolutions": {},
Expand All @@ -45,9 +45,9 @@
"jest": "26.6.0",
"jest-diff": "^27.0.6",
"jest-expect-message": "^1.0.2",
"malloy": "*",
"malloy-db-bigquery": "*",
"malloy-render": "*",
"@malloy-lang/malloy": "*",
"@malloy-lang/malloy-db-bigquery": "*",
"@malloy-lang/malloy-render": "*",
"md5": "^2.3.0",
"prettier": "^2.3.2",
"prismjs": "^1.24.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/malloy-db-bigquery/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "malloy-db-bigquery",
"name": "@malloy-lang/malloy-db-bigquery",
"version": "0.0.1",
"license": "GPL-2.0",
"main": "dist/index.js",
Expand All @@ -14,6 +14,6 @@
"@google-cloud/bigquery": "^5.5.0",
"@google-cloud/common": "^3.6.0",
"gaxios": "^4.2.0",
"malloy": "*"
"@malloy-lang/malloy": "*"
}
}
2 changes: 1 addition & 1 deletion packages/malloy-db-bigquery/src/bigquery.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Malloy } from "malloy";
import { Malloy } from "@malloy-lang/malloy";
import { BigQueryConnection } from "./bigquery_connection";
import { BigQuery as BigQuerySDK, TableMetadata } from "@google-cloud/bigquery";

Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-db-bigquery/src/bigquery_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
FieldTypeDef,
NamedStructDefs,
Connection,
} from "malloy";
} from "@malloy-lang/malloy";

export interface BigQueryManagerOptions {
credentials?: {
Expand Down
4 changes: 2 additions & 2 deletions packages/malloy-db-postgres/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "malloy-db-postgres",
"name": "@malloy-lang/malloy-db-postgres",
"version": "0.0.1",
"license": "GPL-2.0",
"main": "dist/index.js",
Expand All @@ -12,7 +12,7 @@
},
"dependencies": {
"@types/pg": "^8.6.1",
"malloy": "*",
"@malloy-lang/malloy": "*",
"pg": "^8.7.1"
}
}
2 changes: 1 addition & 1 deletion packages/malloy-db-postgres/src/postgres_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
NamedStructDefs,
AtomicFieldType,
QueryData,
} from "malloy";
} from "@malloy-lang/malloy";
import { Client } from "pg";

const postgresToMalloyTypes: { [key: string]: AtomicFieldType } = {
Expand Down
6 changes: 3 additions & 3 deletions packages/malloy-db-test/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "malloy-db-test",
"name": "@malloy-lang/malloy-db-test",
"version": "0.0.1",
"license": "GPL-2.0",
"main": "dist/index.js",
Expand All @@ -11,7 +11,7 @@
"build": "yarn tsc --build"
},
"dependencies": {
"malloy": "*",
"malloy-db-bigquery": "*"
"@malloy-lang/malloy": "*",
"@malloy-lang/malloy-db-bigquery": "*"
}
}
10 changes: 8 additions & 2 deletions packages/malloy-db-test/src/expr.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
* GNU General Public License for more details.
*/

import { Malloy, ModelDef, QueryModel, QueryResult, StructDef } from "malloy";
import { BigQueryConnection } from "malloy-db-bigquery";
import {
Malloy,
ModelDef,
QueryModel,
QueryResult,
StructDef,
} from "@malloy-lang/malloy";
import { BigQueryConnection } from "@malloy-lang/malloy-db-bigquery";
import { fStringEq, fStringLike } from "./test_utils";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
4 changes: 2 additions & 2 deletions packages/malloy-db-test/src/join.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/
/* eslint-disable no-console */

import { Malloy, QueryModel } from "malloy";
import { BigQueryConnection } from "malloy-db-bigquery";
import { Malloy, QueryModel } from "@malloy-lang/malloy";
import { BigQueryConnection } from "@malloy-lang/malloy-db-bigquery";

Malloy.db = new BigQueryConnection("test");

Expand Down
4 changes: 2 additions & 2 deletions packages/malloy-db-test/src/malloy-to-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
*/
/* eslint-disable no-console */
import * as readline from "readline";
import { Malloy, MalloyTranslator } from "malloy";
import { pretty } from "malloy/src/lang/jest-factories";
import { Malloy, MalloyTranslator } from "@malloy-lang/malloy";
import { pretty } from "@malloy-lang/malloy/src/lang/jest-factories";
import { readFileSync } from "fs";

/*
Expand Down
8 changes: 4 additions & 4 deletions packages/malloy-db-test/src/malloy_query.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
*/

import { test } from "@jest/globals";
import { Malloy, QueryModel } from "malloy";
import { Malloy, QueryModel } from "@malloy-lang/malloy";
import { testModel } from "./models/faa_model";
import { fStringEq } from "./test_utils";

import "malloy/src/lang/jestery";
import { TestTranslator } from "malloy/src/lang/jest-factories";
import "@malloy-lang/malloy/src/lang/jestery";
import { TestTranslator } from "@malloy-lang/malloy/src/lang/jest-factories";
import { FLIGHTS_EXPLORE } from "./models/faa_model";
import { BigQueryConnection } from "malloy-db-bigquery";
import { BigQueryConnection } from "@malloy-lang/malloy-db-bigquery";

Malloy.db = new BigQueryConnection("test");

Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-db-test/src/models/faa_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { ModelDef, StructDef } from "malloy/src/model/malloy_types";
import { ModelDef, StructDef } from "@malloy-lang/malloy";
import { medicareModel, medicareStateFacts } from "./medicare_model";
import { fStringEq, fYearEq } from "../test_utils";

Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-db-test/src/models/medicare_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { StructDef } from "malloy";
import { StructDef } from "@malloy-lang/malloy";

/** Medicare Model */
export const medicareModel: StructDef = {
Expand Down
8 changes: 4 additions & 4 deletions packages/malloy-db-test/src/production-models.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
* GNU General Public License for more details.
*/

import "malloy/src/lang/jestery";
import "@malloy-lang/malloy/src/lang/jestery";
import fs from "fs";
import path from "path";
import { Malloy } from "malloy/src/malloy";
import { MalloyTranslator, TranslateResponse } from "malloy";
import { BigQueryConnection } from "malloy-db-bigquery";
import { Malloy } from "@malloy-lang/malloy/src/malloy";
import { MalloyTranslator, TranslateResponse } from "@malloy-lang/malloy";
import { BigQueryConnection } from "@malloy-lang/malloy-db-bigquery";

Malloy.db = new BigQueryConnection("test");

Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-db-test/src/test_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { FilterExpression, Fragment } from "malloy";
import { FilterExpression, Fragment } from "@malloy-lang/malloy";

export function fStringEq(field: string, value: string): FilterExpression {
return {
Expand Down
4 changes: 2 additions & 2 deletions packages/malloy-render/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "malloy-render",
"name": "@malloy-lang/malloy-render",
"version": "0.0.1",
"license": "GPL-2.0",
"main": "dist/index.js",
Expand All @@ -11,6 +11,6 @@
"build": "yarn tsc --build"
},
"dependencies": {
"malloy": "*"
"@malloy-lang/malloy": "*"
}
}
2 changes: 1 addition & 1 deletion packages/malloy-render/src/data_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
QueryScalar,
FieldDef,
FilterExpression,
} from "malloy";
} from "@malloy-lang/malloy";

export type DataValue = QueryScalar | DataTree;

Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/drill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
isValueDate,
TimeTimeframe,
isFieldTimeBased,
} from "malloy";
} from "@malloy-lang/malloy";
import { DataPointer, DataTree, DataTreeRoot, isDataTree } from "./data_table";

type FilterItem = { key: string; value: string | undefined };
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/bar_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { FieldDef, isMeasureLike } from "malloy";
import { FieldDef, isMeasureLike } from "@malloy-lang/malloy";
import {
BarChartRenderOptions,
ChartSize,
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/cartesian_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { QueryData, StructDef } from "malloy";
import { QueryData, StructDef } from "@malloy-lang/malloy";
import * as lite from "vega-lite";
import { HtmlChartRenderer } from "./chart";
import { getColorScale } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
QueryDataRow,
QueryValue,
StructDef,
} from "malloy";
} from "@malloy-lang/malloy";
import { Renderer } from "../renderer";
import { DataPointer, DataValue, isDataTree } from "../data_table";
import { StyleDefaults } from "../data_styles";
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { FieldDef, StructDef } from "malloy";
import { FieldDef, StructDef } from "@malloy-lang/malloy";
import { DataStyles, StyleDefaults } from "../data_styles";
import { ChildRenderers, RenderTree } from "../renderer";
import { makeRenderer } from "./html_view";
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { isDimensional, isMeasureLike } from "malloy";
import { isDimensional, isMeasureLike } from "@malloy-lang/malloy";
import { StyleDefaults } from "../data_styles";
import { DataPointer, DataValue, isDataTree } from "../data_table";
import { ContainerRenderer } from "./container";
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/html_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { FieldDef, StructDef } from "malloy";
import { FieldDef, StructDef } from "@malloy-lang/malloy";
import { TopLevelSpec } from "vega-lite";
import { DataStyles, StyleDefaults } from "../data_styles";
import { Renderer } from "../renderer";
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/line_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { FieldDef, QueryValue } from "malloy";
import { FieldDef, QueryValue } from "@malloy-lang/malloy";
import { HtmlCartesianChartRenderer } from "./cartesian_chart";

export class HtmlLineChartRenderer extends HtmlCartesianChartRenderer {
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { FieldDef, StructDef } from "malloy";
import { FieldDef, StructDef } from "@malloy-lang/malloy";
import { StyleDefaults } from "../data_styles";
import { DataPointer, DataValue, isDataTree } from "../data_table";
import { ContainerRenderer } from "./container";
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/list_detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { FieldDef, StructDef } from "malloy";
import { FieldDef, StructDef } from "@malloy-lang/malloy";
import { HtmlListRenderer } from "./list";

export class HtmlListDetailRenderer extends HtmlListRenderer {
Expand Down
7 changes: 6 additions & 1 deletion packages/malloy-render/src/html/point_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
*/

import * as lite from "vega-lite";
import { FieldDef, QueryData, QueryValue, StructDef } from "malloy";
import {
FieldDef,
QueryData,
QueryValue,
StructDef,
} from "@malloy-lang/malloy";
import usAtlas from "us-atlas/states-10m.json";
import { HtmlChartRenderer } from "./chart";
import { getColorScale } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/malloy-render/src/html/scatter_chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* GNU General Public License for more details.
*/

import { FieldDef, QueryValue } from "malloy";
import { FieldDef, QueryValue } from "@malloy-lang/malloy";
import { HtmlCartesianChartRenderer } from "./cartesian_chart";

export class HtmlScatterChartRenderer extends HtmlCartesianChartRenderer {
Expand Down
7 changes: 6 additions & 1 deletion packages/malloy-render/src/html/segment_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
*/

import * as lite from "vega-lite";
import { FieldDef, QueryData, QueryValue, StructDef } from "malloy";
import {
FieldDef,
QueryData,
QueryValue,
StructDef,
} from "@malloy-lang/malloy";
import usAtlas from "us-atlas/states-10m.json";
import { HtmlChartRenderer } from "./chart";
import { getColorScale } from "./utils";
Expand Down
Loading

0 comments on commit aeeb23e

Please sign in to comment.